# Re: (no subject)

Date: Mon Aug 12 2013 - 11:55:31 MDT

Hi Yann,
You can use coordinate subscripting:
x({-20:60},{110:270}) = x@_FillValue
The above line assumes x is a 2-dimensional array, that lat and lon are
attached as coordinate variable to x, and that your latitudes run from
south->north and that your longitudes run from 0->360E.

If you have any further questions please post them to ncl-talk.

On 08/12/2013 11:51 AM, Yann Bertrand wrote:
>
> Hi,
> i want to mask a region by lat/lon.
> i've tried this example fromhttp://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml
> x = f->X ; 2d array
> x@lat2d = f->latitude ; 2D coordinate arrays
> x@lon2d = f->longitude
>
> latMin = -20
> latMax = 60
> lonMin = 110
> lonMax = 270
>
> x =*where*((x@lat2d.ge.latMin .and. x@lat2d.le.latMax .and. \
> x@lon2d.ge.lonMin .and. x@lon2d.le.lonMax), x, x@_FillValue)
> But it does not work for me because my lat and my lon are 1d arrays (defined by fpan)
> in this example lat and lon are 2d.
> how can I do with lat(1d) and lon(1d) ?
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

```--
______________________________________________________________