[ncl-talk] mask_data

Mary Haley haley at ucar.edu
Fri May 27 12:16:58 MDT 2016


Hi Kunal,

We have some shapefile masking examples that I believe would do exactly
what you want.

Since you are talking about two different regions with potentially two
different shapefiles, however, I decided to create an example for you.

I used shapefiles downloaded from "gadm.org".  I selected the "country"
option, and then downloaded shapefiles for India and Nepal.  I was then
able to use the "shapefile_mask_data" function that's mentioned on our
shapefiles page:

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

See shapefiles_19.ncl, among others.

I'm not sure how much of Northern India you wanted to include, but you can
easily change modify the region you want on this line:

  opt at shape_names = (/"Uttar Pradesh","Himachal Pradesh","Uttaranchal",
"Punjab","Haryana"/)

I wasn't able to reproduce the plot you had exactly, but hopefully you can
modify the script for your purposes.


--Mary





On Thu, May 26, 2016 at 10:43 AM, Kunal Bali <kunal.bali9 at gmail.com> wrote:

> Dear NCL
>
> please, see the attached two figures (1,2). Figure 1 shows the high values
> in Nepal and in the neighbor region i.e. Uttrakhand (Indian region). I need
> to highlight the only Nepal and Uttrakhand region in figure 2 like figure
> 1. I need to mask the data.
>
> May be this can happen with polyline or shapefile ? but i don't know how
> to do it and also i need to extract the data of the selected mask data.
>
>
> Hope you have understand my point.
>
>
> Kunal
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> 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/20160527/fa787c56/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mask_data_and_plot.ncl
Type: application/octet-stream
Size: 3587 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160527/fa787c56/attachment-0002.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: masked_plots_nopoints.png
Type: image/png
Size: 165215 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160527/fa787c56/attachment-0002.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: masked_plots_points.png
Type: image/png
Size: 191529 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160527/fa787c56/attachment-0003.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shapefile_utils.ncl
Type: application/octet-stream
Size: 19284 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160527/fa787c56/attachment-0003.obj 


More information about the ncl-talk mailing list