<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Times New Roman","serif";
        color:#1F497D;
        font-weight:normal;
        font-style:normal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Hi Kunal,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><a href="https://www.ncl.ucar.edu/Applications/mask.shtml">https://www.ncl.ucar.edu/Applications/mask.shtml</a><o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Have you tried to find the info on NCL’s website? They have great resources and examples on it. <o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Regards,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Yuqiang<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> ncl-talk-bounces@ucar.edu [mailto:ncl-talk-bounces@ucar.edu] <b>On Behalf Of </b>Kunal Bali<br><b>Sent:</b> Tuesday, October 07, 2014 8:23 AM<br><b>To:</b> ncl-talk@ucar.edu<br><b>Subject:</b> [ncl-talk] masking query<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><div><div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Dear NCL users<o:p></o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'>Here i am trying to display the data only over OCEAN regions. I don't want to include the land data.But i am not getting the exact results. The result is coming over both land and ocean regions. <o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>I want only ocean data. <o:p></o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'>Here is my script<br>;----------------------------------------------------------------------<br><br>load &quot;/usr/local/lib/ncl/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>load &quot;/usr/local/lib/ncl/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;<br>load &quot;/usr/local/lib/ncl/lib/ncarg/nclscripts/csm/shea_util.ncl&quot;<br><br>begin<br>;---Read data<br>&nbsp; a&nbsp;&nbsp; = addfile(&quot;/home/kunal/Pictures/NCL_Scripts/<a href="http://04-01.nc">04-01.nc</a>&quot;,&quot;r&quot;)<br>&nbsp; totc = a-&gt;TotCH4_A<br>&nbsp; printVarSummary(totc)<br><br>;---Open workstation and change color map<br>&nbsp; <br>&nbsp;&nbsp;&nbsp; wks_type = &quot;pdf&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; wks_type@wkPaperSize = &quot;A4&quot;<br>&nbsp;&nbsp;&nbsp; wks = gsn_open_wks(wks_type,&quot;sample2&quot;)&nbsp; <br><br><br>;---Set some resources<br>&nbsp; res&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = True<br><br>&nbsp; res@gsnMaximize&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = True&nbsp;&nbsp;&nbsp;&nbsp; ; maximize plot in frame<br><br>&nbsp; res@cnFillOn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = True&nbsp;&nbsp;&nbsp;&nbsp; ; turn on contour fill<br>&nbsp; res@cnLinesOn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = False&nbsp;&nbsp;&nbsp; ; turn off contour lines<br>&nbsp; res@cnLineLabelsOn&nbsp;&nbsp;&nbsp; = False&nbsp;&nbsp;&nbsp; ; turn off line labels<br><br>&nbsp; res@tiMainString&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &quot;MAP&quot;<br><br>&nbsp; res@gsnAddCyclic&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = False<br><br>&nbsp; plot = gsn_csm_contour_map(wks,totc,res)<br><br>;---Mask totc using land/sea mask file<br>&nbsp; mfile&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = addfile(&quot;/usr/local/lib/ncl/lib/ncarg/data/cdf/<a href="http://landsea.nc">landsea.nc</a>&quot;,&quot;r&quot;)<br>&nbsp; lsmask&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = mfile-&gt;LSMASK<br>&nbsp; lsm&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = landsea_mask(lsmask,totc&amp;Latitude,totc&amp;Longitude)<br>&nbsp; totc_ocean_only = mask(totc,lsm.ge.0,True)<br>&nbsp; copy_VarMeta(totc,totc_ocean_only)<br><br>&nbsp; res@tiMainString&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &quot;mask&quot;<br>&nbsp; plot = gsn_csm_contour_map(wks,totc_ocean_only,res)<br>end<br><br><o:p></o:p></p></div><p class=MsoNormal>Thank You<o:p></o:p></p><div><div><p class=MsoNormal>&nbsp; <br clear=all><o:p></o:p></p><div><div><div><div><div><p class=MsoNormal>Kunal Bali<o:p></o:p></p></div><div><p class=MsoNormal>Research Scholar <o:p></o:p></p></div><div><p class=MsoNormal>Radio &amp; Atmospheric Science Division <o:p></o:p></p></div><div><p class=MsoNormal>CSIR - National Physical Laboratory<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>New Delhi - 110012<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif"'><o:p>&nbsp;</o:p></span></p></div></div></div></div></div></div></div></div></div></body></html>