<div dir="ltr"><div class="gmail_default" style="font-size:small">Francesco,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If I understand your question, I think the issue is because the shapefile you provided has just a single outline, which is the whole outline of the Caspian Sea. There are no individual outlines for those little isles, so there's no way for the shapefile masking routine to know that you don't want data over those areas.</div><div class="gmail_default" style="font-size:small"><br></div>The "GSHHS_h_L1_mysect.shp" shapefile, however, does seem to have the outlines for the isles, so you can use this to further mask your data.<br><br>What I suggest is to first mask your data based on the GSHHS_h_caspSea shapefile, and then mask that masked data against the "mysect_L2" file, but set the "keep" option to False so it throws away the values over the Isles.<div class="gmail_default" style="font-size:small;display:inline"> Something like this:</div><div><div class="gmail_default" style="font-size:small;display:inline"><font face="monospace, monospace"><br></font></div></div><div><div class="gmail_default" style="display:inline"><font face="monospace, monospace"><div> dir = "caspSea/"</div><div> caspian_shape_name = "GSHHS_h_caspSea.shp" ; contains single outline of Caspian Sea</div><div> isles_shape_name = "GSHHS_h_L1_mysect.shp" ; contains several outlines if isles inside Caspian Sea</div><div><br></div></font></div></div><div><font face="monospace, monospace"> opt = True</font></div><div><font face="monospace, monospace"> opt@keep = True ; Keep values inside this <div class="gmail_default" style="font-size:small;display:inline">outline</div></font></div><div><font face="monospace, monospace"> data_mask_casp = shapefile_mask_data(data,caspian_shape_name,opt)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> opt@keep = False<div class="gmail_default" style="font-size:small;display:inline"> ; Throw away values inside these outlines</div></font></div><div><font face="monospace, monospace"><div class="gmail_default" style="display:inline"> data_mask_isles = shapefile_mask_data(data_mask_casp,isles_shape_name,opt)</div><div class="gmail_default" style="font-size:small;display:inline"></div></font><div><br></div><div><div class="gmail_default" style="font-size:small">I created an example for you using dummy data. See shapefiles_22.ncl at:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><a href="http://www.ncl.ucar.edu/Applications/shapefiles.shtml#ex22">http://www.ncl.ucar.edu/Applications/shapefiles.shtml#ex22</a></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div><br><div class="gmail_default" style="font-size:small"><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 12, 2017 at 11:47 AM, Francesco Trotta <span dir="ltr"><<a href="mailto:francesco.trotta4@unibo.it" target="_blank">francesco.trotta4@unibo.it</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" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<div>Dear ncl-Team</div>
<div> I’m using the coastline of NOAA (GSHHS_h_caspSea.shp) (I've upload it in the ftp) and I would like to generate the meshmask from the costline and to mask the bathymetry datasets outside the coastline (landPoint) in the region of Caspian Sea.</div>
<div> I found the ncl Built-in functions '<span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;background-color:rgb(255,255,255)">create_mask_from_shapefile</span>' and I tried to use it in this way:</div>
<div> </div>
<div>//=========================</div>
<div> mask2dtCoast_surf(0:ny(inest)<wbr>-1,0:nx(inest)-1) = \</div>
<div> create_mask_from_shapefile(<wbr>bathy(0:ny(inest)-1,0:nx(<wbr>inest)-1),pathfile_<wbr>regriddataCoastline)</div>
<div><br>
</div>
<div> ;--- Mashera bathy(dentro o fuori la costline)<br>
</div>
<div> do iy=0,ny(inest)-1</div>
<div> do ix=0,nx(inest)-1</div>
<div> ;if(mask2dtCoast_surf(iy,ix) .eq. 0) then</div>
<div> ; bathy(iy,ix) = 0.</div>
<div> ;end if</div>
<div> if(mask2dtCoast_surf(iy,ix) .eq. 1) then</div>
<div> bathy(iy,ix) = 0.</div>
<div> end if</div>
<div> end do</div>
<div> end do</div>
<div> ;print(bathy)</div>
<div>//============================</div>
<div><br>
</div>
<div>but the bathymetry inside the caspian sea, where there are isle, are not masked (attachment).</div>
<div>Why? Is this function a good choice in order to work with shapfile?</div>
<div><br>
</div>
<div>thanks</div><span class="HOEnZb"><font color="#888888">
<div>Francesco<br>
</div>
<div><br>
</div>
<p><br>
</p>
</font></span></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>