[ncl-talk] problem with masking from shape file

Francesco Trotta francesco.trotta4 at unibo.it
Mon Jun 12 11:47:29 MDT 2017


Dear ncl-Team
   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.
   I found the ncl Built-in functions 'create_mask_from_shapefile' and I tried to use it in this way:

//=========================
   mask2dtCoast_surf(0:ny(inest)-1,0:nx(inest)-1) = \
             create_mask_from_shapefile(bathy(0:ny(inest)-1,0:nx(inest)-1),pathfile_regriddataCoastline)

   ;--- Mashera bathy(dentro o fuori la costline)
   do iy=0,ny(inest)-1
      do ix=0,nx(inest)-1
         ;if(mask2dtCoast_surf(iy,ix) .eq. 0) then
         ;   bathy(iy,ix) = 0.
         ;end if
         if(mask2dtCoast_surf(iy,ix) .eq. 1) then
            bathy(iy,ix) = 0.
         end if
      end do
   end do
   ;print(bathy)
//============================

but the bathymetry inside the caspian sea, where there are isle, are not masked (attachment).
Why? Is this function a good choice in order to work with shapfile?

thanks
Francesco


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170612/5c828b6d/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bathyxy.png
Type: image/png
Size: 267670 bytes
Desc: bathyxy.png
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170612/5c828b6d/attachment-0001.png 


More information about the ncl-talk mailing list