Re: How to cut a mask

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Tue, 06 Mar 2007 12:52:14 -0700

Hi Luciana,

You will want to use coordinate subscripting to do this. But make sure
that the coordinate variables in both the mask file and the archive
files run the same way. In your email you stated that the mask latitudes
run from 90N->90S, and the archive latitudes run from 56S->12N... So the
mask latitudes should be flipped to match the archive latitudes.

For example:
;(mask file is in arr_mask, archive file is in data)
temp = arr_mask(::-1,:) ; flip the latitudes
delete(arr_mask)
arr_mask_1 = temp({-56:12.},{-91.5:-35.0})
delete(temp)
printVarSummary(arr_mask_1)
printVarSummary(data)

data = mask(data,arr_mask_1.eq.0,False) ; set to data@_FillValue all

                                         ; areas of data where
                                         ; arr_mask_1 = 0

Good luck,
Adam

luciana mara freitas diniz wrote:
> Hi, NCL users!
>
> I need to cut a mask 0.5x0.5 (LATITUDE: 90N to 90S, LONGITUDE: -180W to
> 180E) to apply it in one archive 0.5x0.5 that it only contains
> coordinate of the South America (LATITUDE:-56.0 to 12.0, LONGITUDE:
> -91.5 to -35.0).
>
> How can I do this?
>
> Thanks...
>
> --
> Luciana Mara Freitas Diniz
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Mar 06 2007 - 12:52:14 MST

This archive was generated by hypermail 2.2.0 : Tue Mar 06 2007 - 18:06:24 MST