# Re: coordinate indexing problem

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Nov 25 2009 - 15:58:44 MST

Hi Nan,

I couldn't reproduce your problem either. I tried it with a dummy
dataset:

ncl 0> pct_pft = random_uniform(0,100,(/17,360,720/))
ncl 1> pct_pft!0 = "pft"
ncl 2> pct_pft!1 = "lat"
ncl 3> pct_pft!2 = "lon"
ncl 4> pct_pft&pft = ispan(1,17,1)
ncl 5> pct_pft&lat = fspan(-89.75,89.75,360)
ncl 6> pct_pft&lon = fspan(0.25,359.75,720)
ncl 7> slat = 60.
ncl 8> elat = 85.
ncl 9> slon = 290.
ncl 10> elon = 345.
ncl 11> doh2 = pct_pft(0,{slat:elat},{slon:elon})
ncl 12>

I think the problem might be with your actual longitude values.

If you print them:

print(pct_pft&lon)

are they monotonically increasing or decreasing?

--Mary

On Nov 25, 2009, at 12:53 PM, Nan Rosenbloom wrote:

> I am having trouble extracting a spatial region from a
> 3 dimensional variable using coordinate indexes.
>
> My data looks like:
>
> Variable: pct_pft
> Type: float
> Total Size: 17625600 bytes
> 4406400 values
> Number of Dimensions: 3
> Dimensions and sizes: [pft | 17] x [lat | 360] x [lon | 720]
> Coordinates:
> pft: [1..17]
> lat: [-89.75..89.75]
> lon: [0.25..359.75]
> Number Of Attributes: 3
> lonFlip : longitude coordinate v has been reordered via lonFlip
> units : unitless
> long_name : percent pft
>
>
> My region and the line that fails:
>
> slat = 60.
> elat = 85.
> slon = 290.
> elon = 345.
>
>
> doh2 = pct_pft(0,{slat:elat},{slon:elon})
>
>
> fatal:NclOneDValGetRangeIndex: Non-monotonic coordinate value being
> used, can't complete coordinate subscript
> fatal:Could not obtain coordinate indexes, unable to perform subscript
> fatal:Execute: Error occurred at or near line 169 in file
> mk_mksrf.warmArctic.ncl
>
>
> My error message is very similar to an archive question, (see below).
> Unfortunately, it looks like Dennis was unable to replicate the
> problem,
> so there is no solution in the archive:
>
> http://www.ncl.ucar.edu/Support/talk_archives/2008/0799.html
>
> thanks in advance for any help -
>
> nanr
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Nov 25 15:58:59 2009

This archive was generated by hypermail 2.1.8 : Sun Nov 29 2009 - 20:52:58 MST