<div dir="ltr"><div><div>Maybe ?<br><br><a href="http://www.ncl.ucar.edu/Applications/mask.shtml">http://www.ncl.ucar.edu/Applications/mask.shtml</a><br></div>Example 5<br><br></div>NCL is distributed with a 5-category 1x1 l(land/sea/lake/island/..) mask file. See:<br><br> <a href="http://www.ncl.ucar.edu/Document/Functions/Shea_util/landsea_mask.shtml">http://www.ncl.ucar.edu/Document/Functions/Shea_util/landsea_mask.shtml</a><br> <br><div> f = addfile(....)<br></div><div> var = f->FOO<br></div><div> ; if rectilinear <br></div><div> LAT = f->lat ; or, var&lat<br> LON = f->lon ; var&lon<br><br></div><div> ; if curvilinear<br></div><div> LAT = f->lat2d<br></div><div> LON = f->lon2d <br> ; open 1x1 land sea mask file<br> b = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/<a href="http://landsea.nc">landsea.nc</a>","r")<br></div><div><pre> lsm = landsea_mask(b->LSMASK, LAT, LON) ; import land sea mask<br> ; return mask array<br><br> var_land = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/mask.shtml"><strong>mask</strong></a>(var,lsm.eq.1,False)<br></pre><pre> printVarSummary(lar_land)<br></pre><pre> copy_VarMeta(var,var_land)<br></pre><pre> var_13 = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/mask.shtml"><strong>mask</strong></a>(var,lsm.eq.1 .or. lsm.eq.3,False) <br> <br> copy_VarMeta(var,var_13) <br><br>----<br></pre><pre>If 1x1 is too crude, I have attached a much higher resolution 2-category land/sea mask<br></pre><pre><br>netcdf CERES.HiResLandSeaMask {<br>dimensions:<br>        lat = 1080 ;<br>        lon = 2160 ;<br>variables:<br>        byte LandSea(lat, lon) ;<br>                LandSea:info = "Land=1, Sea=0" ;<br>                LandSea:long_name = "CERES: Land-Sea Mask" ;<br>                LandSea:units = "" ;<br>        float lat(lat) ;<br>                lat:long_name = "latitude" ;<br>                lat:units = "degrees_north" ;<br>        float lon(lon) ;<br>                lon:long_name = "longitude" ;<br>                lon:units = "degrees_east" ;<br> </pre>I have other land/sea mask files also.<br><br></div><div>Good luck<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 10, 2016 at 10:13 AM, Clapp, Corey Elstein <span dir="ltr"><<a href="mailto:cclapp@fas.harvard.edu" target="_blank">cclapp@fas.harvard.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi Rick,</p>
<p><br>
</p>
<p>Thanks for your response, I hope my question isn't redundant with the available documentation. The examples provided that use the built-in map database seem to be doing so with map resources and so the masking is only occurring with what is drawn on a plot.</p>
<p><br>
</p>
<p>I was looking to use the built-in map databases to mask a dataset before plotting. In other words using a built-in database as the marray for the mask function, or using a built-in database as the shapefile in shapefile_mask_data function.</p>
<p><br>
</p>
<p>Thanks,</p>
<p>Corey</p>
</div>
<hr style="display:inline-block;width:98%">
<div dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>><br>
<b>Sent:</b> Monday, October 10, 2016 11:46:16 AM<br>
<b>To:</b> Clapp, Corey Elstein<br>
<b>Cc:</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
<b>Subject:</b> Re: [ncl-talk] Masking Data with NCL Map Databases</font>
<div> </div>
</div><div><div class="h5">
<div>
<div dir="ltr">
<div>
<div>
<div>
<div>Hi,<br>
<br>
</div>
There are a number of examples of masking with the built-in map database at:<br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__ncl.ucar.edu_Applications_mask.shtml&d=CwMFaQ&c=WO-RGvefibhHBZq3fL85hQ&r=c6V7gIN5OFgXqiVE70-k0s95A9XeCqpkaHUsidujhr8&m=Pshm_NtyJvZSnkbXxEGYKsKCfWczqp7N8Umqr70LaPk&s=1C6yjCHcUe4PRJ9h64Y6oI385xebNOLX1bG3hAmwtUo&e=" target="_blank">http://ncl.ucar.edu/<wbr>Applications/mask.shtml</a><br>
<br>
</div>
Do you need to do something more specific?<br>
<br>
</div>
HTH...<br>
</div>
Rick<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Oct 7, 2016 at 3:33 PM, Clapp, Corey Elstein <span dir="ltr">
<<a href="mailto:cclapp@fas.harvard.edu" target="_blank">cclapp@fas.harvard.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif">
<p></p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">Hi,</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><br>
</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">I was wondering if it were possible to mask data using the areas of the NCL map databases (Earth 1-4) instead of using a shapefile. </p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><br>
</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">Thanks,</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">Corey</p>
<br>
<p></p>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.ucar.edu_mailman_listinfo_ncl-2Dtalk&d=CwMFaQ&c=WO-RGvefibhHBZq3fL85hQ&r=c6V7gIN5OFgXqiVE70-k0s95A9XeCqpkaHUsidujhr8&m=Pshm_NtyJvZSnkbXxEGYKsKCfWczqp7N8Umqr70LaPk&s=w3Ci8GW2uAFvT46JQfW_cP7L6W-P3-88G9kNwF6oJS4&e=" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div></div></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>