[ncl-talk] mask ocean areas

Karin Meier-Fleischer meier-fleischer at dkrz.de
Tue Mar 6 06:22:11 MST 2018


Hi Sri,

the landsea.nc mask file is OK. If your data is on a 1x1 deg grid too 
than it should look like the attached plot. Maybe you have to regrid 
your data to the same 1x1 deg grid.

If you want to generate mask files yourself for different grids you can 
use the CDOs.
E.g. mask ocean 1x1 deg (r360x180):

   cdo -f nc -expr,'topo = ((topo > 0.0)) ? 1.0 : 0.0' 
-remapycon,r360x180 -topo mask_the_ocean_1x1deg.nc

-Karin

Am 06.03.18 um 13:21 schrieb Sri Nandini:
>
> Hello
>
> Here i attach a plot using the same method as in mask_5.ncl 
> example==>HOWEVER, the landsea.nc mask is quite coarse and covers 
> large grid points.
> Is there a landsea mask available for 1x1 resolution?
>
>
>
>
>
>
> On Mar 5, 2018 11:06:13 PM, Dennis Shea wrote:
>
>     Further ....
>
>     NCL is distributed with a simple 1x1 global mask. This may be
>     adequate for your needs.
>
>     https://www.ncl.ucar.edu/Applications/mask.shtml
>     Example 5
>
>     ----
>
>     https://www.ncl.ucar.edu/Document/Functions/Shea_util/landsea_mask.shtml
>
>     The function indicates that multiple libraries must be loaded.
>     However, if you have 6.2.0 onward these libraries are
>     automatically loaded.
>
>     ---
>     Good luck
>
>     On Mon, Mar 5, 2018 at 1:58 PM, Adam Phillips <asphilli at ucar.edu
>     <mailto:asphilli at ucar.edu>> wrote:
>
>         Hi Sri,
>         To add to Mary's reply you can also tell NCL to color fill the
>         ocean basins last, thereby applying a graphical mask.
>         Example:
>         res at mpFillOn = True
>         res at mpFillColors = (/-1,0,-1,-1/)   ; set ocean to white, see:
>         http://www.ncl.ucar.edu/Document/Graphics/Resources/mp.shtml#mpFillColors
>         res at mpFillDrawOrder = "PostDraw"   ; do the map fill
>         res at mpPerimDrawOrder = "PostDraw"   ; and perimeter draw last
>         res at mpOutlineDrawOrder = "Draw"        ; draw the map outlines
>         second
>         res at cnFillDrawOrder = "PreDraw"          ; draw the
>         color-filled contours first
>
>         Adam
>
>         On Mon, Mar 5, 2018 at 1:06 PM, Mary Haley <haley at ucar.edu
>         <mailto:haley at ucar.edu>> wrote:
>
>             Hi,
>
>             Please see our masking examples at:
>
>             http://www.ncl.ucar.edu/Applications/mask.shtml
>
>             In particular, you may want to look at example mask_5.ncl
>             which uses the landsea_mask function, or example
>             mask_12.ncl which uses a shapefile to do the masking.
>
>             --Mary
>
>
>             On Mon, Mar 5, 2018 at 9:50 AM, Sri Nandini
>             <snandini at marum.de <mailto:snandini at marum.de>> wrote:
>
>                 Hello
>
>                 I am trying to mask out ocean areas in my plot.
>                 Could someone please help me out with this? Is there
>                 mask data i can download from NCL?
>
>
>
>
>                 _______________________________________________
>                 ncl-talk mailing list
>                 ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>
>                 List instructions, subscriber options, unsubscribe:
>                 http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>             _______________________________________________
>             ncl-talk mailing list
>             ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>
>             List instructions, subscriber options, unsubscribe:
>             http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
>         -- 
>         Adam Phillips
>         Associate Scientist, Climate and Global Dynamics Laboratory, NCAR
>         www.cgd.ucar.edu/staff/asphilli/
>         <http://www.cgd.ucar.edu/staff/asphilli/> 303-497-1726
>
>
>         _______________________________________________
>         ncl-talk mailing list
>         ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>
>         List instructions, subscriber options, unsubscribe:
>         http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>     _______________________________________________
>     ncl-talk mailing list
>     ncl-talk at ucar.edu
>     List instructions, subscriber options, unsubscribe:
>     http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180306/fe110a78/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plot_mask_file_global.000003.png
Type: image/png
Size: 111695 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180306/fe110a78/attachment-0001.png>


More information about the ncl-talk mailing list