[ncl-talk] masking non-vegetation areas

Mary Haley haley at ucar.edu
Wed Dec 3 15:43:29 MST 2014


Ashehad,

NCL doesn't have a list of desert regions built into the package, but if
you have a shapefile that contains desert regions, then you can use this
shapefile to either create a new data variable that is set to missing at
any locations that fall inside a desert region, or you can simply draw all
the desert regions in white.

You can usually find shapefiles that contain the information that you need,
by using google.  I found one called "ne_10m_geography_regions_polys.shp",
although I can't vouch for the accuracy. I got it from

http://www.naturalearthdata.com/downloads/10m-physical-vectors/


This shapefile contains a variable on the file called "name", and this
variable is an array of strings containing a region name.  If you search
for "DESERT" you will find several names that match:

ncl_filedump -v name ne_10m_geography_regions_polys.shp | grep -i desert

Black Rock Desert
Negev Desert
Chalbi Desert
Eastern Desert
. . .

These names can be used with the "shapefile_mask_data" function that is
mentioned on this page:

http://www.ncl.ucar.edu/Applications/shapefiles.shtml

Or you can simply fill all the desert areas in white, using gsn_add_polygon.

I've attached two examples, using dummy data, to show both methods.  I'll
make this an example on the shapefiles page too.

--Mary



On Wed, Dec 3, 2014 at 10:09 AM, Ashehad Ali <ashehad at gmail.com> wrote:

> Dear ncl,
>
> This might sound simple but am wondering if it's possible to mask out the
> non-vegetation areas such as desert regions from the land.
>
> Thanks,
> Ashehad
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141203/3140f896/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dummy_contours_with_desert.png
Type: image/png
Size: 335403 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141203/3140f896/attachment-0002.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dummy_contours_with_desert_mask.png
Type: image/png
Size: 334170 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141203/3140f896/attachment-0003.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dummy_contours_with_desert_mask.ncl
Type: application/octet-stream
Size: 3247 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141203/3140f896/attachment-0003.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dummy_contours_with_desert.ncl
Type: application/octet-stream
Size: 3037 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141203/3140f896/attachment-0004.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extra_funcs.ncl
Type: application/octet-stream
Size: 17778 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141203/3140f896/attachment-0005.obj 


More information about the ncl-talk mailing list