<div dir="ltr"><div class="gmail_default" style="font-size:small">Check out the gc_inout function:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/gc_inout.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/gc_inout.shtml</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 28, 2017 at 1:34 PM, Francesco Trotta <span dir="ltr">&lt;<a href="mailto:francesco.trotta4@unibo.it" target="_blank">francesco.trotta4@unibo.it</a>&gt;</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">
<p>Dear ncl-team</p>
<p>    I&#39;ve a file containg the bathymetry (nx * ny) and I would like to mask a subdomain containg inside a closed polyline.</p>
<p><br>
</p>
<p>    For a square polyline a try the solution below, but I would like to extend this procedure to a generic closed polyline.</p>
<p>    Is there in ncl a function which allow me to mask a particular region of a 2d-field?
<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>if(lonWest_isletoMask .ge. lon1dt_surf(0) .or. lonEast_isletoMask .le. lon1dt_surf(nx(inest)-1)) then<br>
      if(latSout_isletoMask .ge. lat1dt_surf(0) .or. latNort_isletoMask .le. lat1dt_surf(ny(inest)-1)) then<br>
         idxlon_isletoMask = ind((lon1dt_surf(0:nx-1) .ge. lonWest_isletoMask) .and. (lon1dt_surf(0:nx-1) .le. lonEast_isletoMask))<br>
         idxlat_isletoMask = ind((lat1dt_surf(0:ny-1) .ge. latSout_isletoMask) .and. (lat1dt_surf(0:ny-1) .le. latNort_isletoMask))<br>
         do j=0,dimsizes(idxlat_<wbr>isletoMask)-1 <br>
                  do i=0,dimsizes(idxlon_<wbr>isletoMask)-1 <br>
                     if((.not.ismissing(idxlon_<wbr>isletoMask(i))) .and. (.not.ismissing(idxlat_<wbr>isletoMask(j))))     
<br>
                        bathy(idxlat_isletoMask(j),<wbr>idxlon_isletoMask(i)) = 0.<br>
                     end if<br>
              end do<br>
          ;print(&quot; &quot;)<br>
           end do<br>
         delete(idxlon_isletoMask)<br>
         delete(idxlat_isletoMask)<br>
      end if<br>
   end if</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>thanks</p><span class="HOEnZb"><font color="#888888">
<p>Francesco<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>