Hi,
lonFlip worked. Thanks for your help.
Rgs, Marjolaine.
-----Original Message-----
From: Dennis Shea [mailto:shea AT cgd.ucar.edu]
Sent: Tuesday, December 07, 2004 12:44 AM
To: marjolaine AT absamail.co.za
Subject: RE: [ncl-talk] coordinate subscripting
As Sylvia indicates use "lonFlip"
f = addfile (...)
x = f->Some_Variable ; coords o->360
x = lonFlip(x) ; coords -180->180
You could also do the following:
x = lonFlip( f->Some_Variable ) ; coords -180->180
then something like
latS = -75
latN = 30
lonL = -40
lonR = 20
X = x(:,{latS:latN},{lonL:lonR})
good luck
D
>
>Thanks, I will look into it.
>
>Best regards, Marjolaine.
>
>-----Original Message-----
>From: Sylvia Murphy [mailto:murphys AT cgd.ucar.edu]
>Sent: Wednesday, December 01, 2004 7:45 PM
>To: Marjolaine Krug
>Cc: NCL talk
>Subject: RE: [ncl-talk] coordinate subscripting
>
>
>M,
>
>by definition, a coordinate variable must be either monotonically
>increasing or decreasing. this is a requirement of netCDF. Is your
>longitude actually attached?
>
>if the problem is the resultant extraction not being monotonic, then you
>may want to check out the lonFlip function in contributed.ncl which will
>change a 0-360 coordinate to -180 to 180 and vice versa.
>
>sm
>
>
>On Wed, 1 Dec 2004, Marjolaine Krug wrote:
>
>> Dear Sylvia,
>>
>> The domain I want in my data is from 40West to 20East, which correspond
to
>> points from :
>> 320 to 360
>> and
>> 360 (i.e 0) to 20
>> The problem is that my data longitude is not monotonic. So I can't just
>> extract the domain I want. I suppose I could extract both arrays
>> y1 = x({320:360},{minLat:maxLat}) and
>> y2 = x({0:20},{minLat:maxLat}) and then concatenate y1 and y2 into a
>> variable y. Only thing is that I am not sure how to concatenate y1 and
y2.
>>
>> Regards, Marjolaine.
>>
>> -----Original Message-----
>> From: Sylvia Murphy [mailto:murphys AT cgd.ucar.edu]
>> Sent: Monday, November 29, 2004 6:03 PM
>> To: Marjolaine Rouault
>> Cc: ncl-talk AT ucar.edu
>> Subject: Re: coordinate subscripting
>>
>>
>> M,
>>
>> you certainly can use coordinate subscripting. This method is dependent
>> upon what your coordinates look like. if your coordinates go from -180 to
>> +180 then you need to use those values while coordinate subscripting. if,
>> as in your case, they go from 0 to 360 you need to use those values.
>>
>> for example
>>
>> y = x({-20:20},{270:360})
>>
>> in your case you need to mentally convert the region you want into
>> 360-mode and then subscript.
>>
>> sylvia
>>
>>
>>
>> On Mon, 29 Nov 2004, Marjolaine Rouault wrote:
>>
>> > Hi,
>> >
>> > I am reading some data which longitude is not "ordered" in the usual
>way.
>> >
>> > Longitude points from 0 east to 180 east have a longitude which
>increases
>> from 0 to 180.
>> > Longitude points from 180 west to 0 west have a longitude value which
>> increases from 181 to 360.
>> >
>> > I am trying to extract a domain between 40West and 20 East.Is it
>possible
>> to do it with coordinate subscripting? What would you suggest is the best
>> way to extract my domain?
>> >
>> > Many thanks, Marjolaine.
>> >
>> >
>> >
>> > _______________________________________________
>> > ncl-talk mailing list
>> > ncl-talk AT ucar.edu
>> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>> >
>>
>>
>>
>> ******************************************************
>> Sylvia Murphy EML: murphys AT ucar.edu
>> NCAR CGD/CSEG PHN: 303-497-1720
>> 1850 Table Mesa Drive FAX: 303-497-1333
>> Boulder CO 80305
>>
>>
>> WEB: http://www.cgd.ucar.edu/csm/support/
>> http://www.cgd.ucar.edu/csm/support/CSM_Graphics/
>> ******************************************************
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk AT ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
>
>******************************************************
>Sylvia Murphy EML: murphys AT ucar.edu
>NCAR CGD/CSEG PHN: 303-497-1720
>1850 Table Mesa Drive FAX: 303-497-1333
>Boulder CO 80305
>
>
>WEB: http://www.cgd.ucar.edu/csm/support/
> http://www.cgd.ucar.edu/csm/support/CSM_Graphics/
>******************************************************
>
>
>
>_______________________________________________
>ncl-talk mailing list
>ncl-talk AT ucar.edu
>http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
ncl-talk AT ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
This archive was generated by hypermail 2b29 : Tue Dec 07 2004 - 09:01:21 MST