Re: Coordinate subscripting with floating values

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Aug 07 2013 - 13:58:15 MDT

Hi Abhik,

I don't know if anybody answered this one. I think the issue is that it only gives you the coordinates that are fully contained in the range that you give.

For example:

xf = ispan(1,10,1) ; 1,2,3,...,10
lat = ispan(0,45,5)*1. ; floats
xf!0 = "lat"
xf&lat = lat

print("xf = " + xf + " at latitude " + xf&lat)
print("xf({10.5:25.5}) = " + xf({10.5:25.5}))

produces this:

(0) xf = 1 at latitude 0
(1) xf = 2 at latitude 5
(2) xf = 3 at latitude 10
(3) xf = 4 at latitude 15
(4) xf = 5 at latitude 20
(5) xf = 6 at latitude 25
(6) xf = 7 at latitude 30
(7) xf = 8 at latitude 35
(8) xf = 9 at latitude 40
(9) xf = 10 at latitude 45
(0) xf({10.5:25.5}) = 4
(1) xf({10.5:25.5}) = 5
(2) xf({10.5:25.5}) = 6

You only get the latitude values at 15,20,and 25, because they are inside the range of 10.5 to 25.5

I don't know what your longitude values look like, but you might need to increase your coordinate subscript range so that it includes the outer boundaries of the range you want.

--Mary

> Dear NCL-users,
>
> I want to subscript longitude coordinates, e.g. {90.5:120.5}. [31 points]
> Since it takes the nearest integer value, so my coordinates become {91:120}. [30 points]
> How can I put the exact values without losing any grid-point?
> Thanks in advance for your suggestion.
>
> Regards,
> Abhik
> ___________________________________________
>
> Abhik Santra
> CSIR Research Fellow,
> Indian Institute of Tropical Meteorology,
> Pune - 411008.
> India
> ___________________________________________
> _______________________________________________
> 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 Aug 7 13:58:27 2013

This archive was generated by hypermail 2.1.8 : Wed Aug 14 2013 - 18:35:09 MDT