[ncl-talk] Mediterranean Sea masking

Ufuk Utku Turuncoglu (BE) u.utku.turuncoglu at be.itu.edu.tr
Mon Nov 17 07:16:05 MST 2014


Hi,

You have to define a polygon around the region that you interested and 
you could use gc_inout function to assign different number (oe mask 
value) for different regions. You could create a mask for every 
sub-regions. So, for example

       do r = 0, nregs-1
         do i = 0, nlon-1
           do j = 0, nlat-1
             if (gc_inout(lat2d(j,i), lon2d(j,i), ybox(r,:), xbox(r,:))) 
then
               dmask(k,r,j,i) = r
             end if
           end do
         end do
       end do

in this case, nregs is the number of sub-region and xbox, ybox store the 
polygon information. You could also add land-sea mask to the if clause 
to eliminate the land grid points. Of course, this method works for the 
data that has a grid bu it could be extended to other types of data. I 
hope it helps.

Regards,

--ufuk


More information about the ncl-talk mailing list