[Thread Prev][Thread Next][Index]

Re: [ferret_users] Getting i and j of lon/lat points



Title: Getting i and j of lon/lat points
Hi Vincent,
Just to make sure I understand you, what you have is a curvilinear dataset like this?
yes? show dat
     currently SET data sets:
    1> ./one.nc  (default)
 name     title                 I         J         K         L
SCALAR    variable              1:90      1:173     ...       ...
LONGITUDE geographic longitude  1:90      1:173     ...       ...
LATITUDE  geographic latitude   1:90      1:173     ...       ...
and you want to do something with your data variable on a subset of the region. 

This is not a trivial problem. If you want to just make a plot of a subset of the data of course you can use /VLMITS and /HLIMITS  (possibly also /MODULO on a curvilinear plot command), and see use a part of the data. But this is inefficient as you still load all the data into memory, and for larger datasets this is a real drawback. It also doesn't let you do more general things on a subset of the data.

For another more general discussion of why this is hard, and a way of handling the problem, see this FAQ, "How can I determine the indices that represent longitude and latitude limits for reading a subset of data on a curvilinear grid?"

http://ferret.pmel.noaa.gov/FERRET_17sep07/FAQ/custom_plots/subsetting_curvi_data.html

Ansley

VINCENT_LEFOUEST@xxxxxxxxxx wrote:

Dear all,

I got a 2D field including Longitude, Latitude and another scalar as variables. I'd like to subsample my scalar for a subregion by using longitudes and latitudes. However, the command set region does not work out using longitudes and latitudes as x and y, and I do not know their i and j.

Any help would be greatly appreciated,

Cheers


[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement