<div dir="ltr"><div class="gmail_default" style="font-size:small">Dear Ce Zhu,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The issue may simply be that your original data doesn&#39;t contain any grid points that are close to the boundary you gave it.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">NCL is not going to create contours outside of your non-missing values, and, if there&#39;s a single &quot;good&quot; point surrounded on all four sides by missing values, then that single point will not have any contours on it.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You can see an example of this with the attached script called &quot;mask_example.ncl&quot;.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I&#39;ve created both a &quot;coarse&quot; (lower resolution) and &quot;fine&quot; (higher resolution) version of a dummy lat/lon grid. I masked this grid using outlines from the &quot;mrb.shp&quot; file and called &quot;gsn_coordinates&quot; to draw the locations of the lat/lon grid as tiny dots.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Note that in the &quot;coarser.png&quot; image, the south part of the shapefile outline doesn&#39;t have any contours in the mask data image. This is because the &quot;good&quot; points in that part of the outline are single points, surrounded by missing points. Look around the rest of the red shapefile outline, and you will see that the color contours do not go all the way to the edge. This is simply because the grid is too coarse.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">In the &quot;finer.png&quot; image, the south part has at least three points in a row that fall inside the boundary, and you will see contours in that area.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you want to get points close to the edge of your shapefile outlines, and also include points just outside the outline, then you can try masking your data against a rectangle box that encloses the shapefile outline, with an extra &quot;margin&quot; to enclose a few points outside.  This may give you more points than you want.  See the attached &quot;mask_example_rectangle.ncl&quot; file and the &quot;coarser_rect.png&quot; image.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 31, 2014 at 7:17 AM, Zhu CE <span dir="ltr">&lt;<a href="mailto:lovingzhuce@163.com" target="_blank">lovingzhuce@163.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="line-height:1.7;color:rgb(0,0,0);font-size:14px;font-family:Arial"><div>Dear NCL users,</div><div><br></div><div>Recently I am trying to use the shapefiles downloaded from DIVA-GIS (<a href="http://www.diva-gis.org/gdata)," target="_blank">http://www.diva-gis.org/gdata)</a>. Those files can provide finer boundary information (like Nanjing City in Jiangsu Province, China) than <a href="http://www.ncl.ucar.edu/Document/HLUs/Classes/MapPlotData4_1_earth_3.shtml" style="margin:0px;padding:0px;text-decoration:none;color:rgb(133,45,133);font-family:verdana,sans-serif;font-size:13px;line-height:16px" target="_blank">Earth..3</a> database provides.</div><div>I have known how to plot shapefiles and <a href="http://www.ncl.ucar.edu/Applications/Scripts/shapefiles_4.ncl" style="margin:0px;padding:0px;text-decoration:none;color:rgb(133,45,133);font-family:verdana,sans-serif;font-size:13px;line-height:16px" target="_blank">shapefiles_4.ncl</a> also shows an example of masking out all areas inside or outside this outline.But the masking results are coarser and slower than masking doing by NCL itself.</div><div>I am writing to ask are there some alternative methods to mask area out finer and quicker with shapefiles or to add shapefile information into map <span style="line-height:23.7999992370605px">database like </span><a href="http://www.ncl.ucar.edu/Document/HLUs/Classes/MapPlotData4_1_earth_3.shtml" style="margin:0px;padding:0px;text-decoration:none;color:rgb(133,45,133);font-family:verdana,sans-serif;font-size:13px;line-height:16px" target="_blank">Earth..3</a><span style="line-height:23.7999992370605px">? Could you help me? Thanks a lot.</span></div><div><span style="line-height:23.7999992370605px">Attached is the masked plot using </span><a href="http://www.ncl.ucar.edu/Applications/Scripts/shapefiles_4.ncl" style="margin:0px;padding:0px;text-decoration:none;color:rgb(133,45,133);font-family:verdana,sans-serif;font-size:13px;line-height:16px" target="_blank">shapefiles_4.ncl</a> script.</div><div><br></div><div><span style="line-height:23.7999992370605px">Best wishes,</span></div><div><span style="line-height:23.7999992370605px"><br></span></div><div>Ce Zhu</div><div><br></div><div><img src="cid:65f30660$1$149665a655d$Coremail$lovingzhuce$163.com" style="width: 816px; min-height: 1056px; border: 1px solid rgb(153, 153, 153);"></div><div><br></div></div><br><br><span title="neteasefooter"><span></span></span><br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div></div>