[ncl-talk] How to pick out the grids in a chosen area from a polar stereographic projection dataset?

Guido Cioni guidocioni at gmail.com
Mon Aug 22 10:12:01 MDT 2016


Hey Lin,
when dealing with non-monotonic arrays I usually employ the ind function, so I don’t understand why is not working for you…

If you have, say, lon and lat arrays (this assume to have them 1-Dimensional, otherwise it gets fishy…).

min_lon= -50.
max_lon= -70.
min_lat= -180.
max_lat= -180.
box_lon= ind(lon.ge.min_lon .AND. lon.le.max_lon)
box_lat= ind(lat.ge.min_lat .AND. lat.le.max_lat)

should give you exactly all the indices inside the user-prescribed area. Then you can subset using

var_box=var(:,box_lat,box_lon)

Please be reminded that box_values will have different dimensions, since it is a subset of the original variable.
Cheers,

Guido Cioni
http://guidocioni.altervista.org <http://guidocioni.altervista.org/> 

> On 22 Aug 2016, at 01:13, 林祥 <xianglin72 at icloud.com> wrote:
> 
> <latitude.csv>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160822/1b541d62/attachment.html 


More information about the ncl-talk mailing list