<div dir="ltr">Thanks Guido Cioni, I will try this.<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>--</div>Regards,<div>Nitin Patil</div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Thu, Aug 11, 2016 at 3:19 PM, Guido Cioni <span dir="ltr">&lt;<a href="mailto:guidocioni@gmail.com" target="_blank">guidocioni@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Nitin, if you want to ignore the values in computations/plot you can easily mask the variable making use of the _FillValue attribute. NCL will ignore every missing value when computing stuff, e.g. averages or making contour plots.<div><br></div><div>I would do something like that</div><div><br></div><div><font face="Menlo"><b>x=where(x .ge. 1, x@_FillValue, x)</b></font></div><div><font face="Menlo"><b><br></b></font></div><div><font face="Arial">that means, where <b>x is greater than or equal to 1 put a _FillValue, otherwise preserve the original x value.</b></font></div><div><br></div><div>You need the _FillValue attribute to be already defined at the time of execution, but I thing that wouldn’t be a problem since x is already defined as float. <br><div>
<div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br>Guido Cioni</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="http://guidocioni.altervista.org" target="_blank">http://guidocioni.altervista.<wbr>org</a> </div>

</div>
<br><div><blockquote type="cite"><div><div class="h5"><div>On 11 Aug 2016, at 11:43, Nitin Patil &lt;<a href="mailto:nitinpatil85@gmail.com" target="_blank">nitinpatil85@gmail.com</a>&gt; wrote:</div><br></div></div><div><div><div class="h5"><div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div>Dear NCL usrs,<br><br></div>In my script I want to ignore AOD values which are greater than 1.0, any idea where to put it?<br><div><div><br>=================<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/gsn_code.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/gsn_csm.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/contributed.ncl&quot;<br><br>begin<br><br>;*****************************<wbr>*******************<br>; Specify geographical region and time span (year-month start and end<br>;*****************************<wbr>*******************<br><br>  latS     = -90               <br>  latN     =  90<br>  lonL     =  0<br>  lonR     = 360<br><br>  ymStrt   = 197101     <br>  ymLast   = 201012<br>  <br>  pltType  = &quot;ps&quot;  <br>  pltName  = &quot;regress&quot;<br>  pltTitle = &quot;Globe: &quot;+(ymStrt/100)+&quot;-&quot;+(ymLast/100<wbr>)<br><br>;*****************************<wbr>*******************<br>; Read from netCDF file: variable is type short...unpack<br>;*****************************<wbr>*******************<br>   diri   = &quot;/media/Work/3_LTS_echam6_Data<wbr>/EACSST_ens_1971-2010/&quot;<br>   fili   = &quot;EACSST_E1_1971-2010_AOD.nc&quot;<br>   f      = addfile(diri+fili,&quot;r&quot;) <br><br>   YYYYMM = cd_calendar( f-&gt;time, -1)<br><br>   iStrt  = ind(YYYYMM.eq.ymStrt)<br>   iLast  = ind(YYYYMM.eq.ymLast)<br><br>   <b>x      = short2flt( f-&gt;tau_aod(iStrt:iLast,{latS:l<wbr>atN},{lonL:lonR}))</b><br>    <br>   </div><div>  x@units= &quot;mm/day&quot;<br><br>   printVarSummary(x)            <wbr>                ; [time| 1344]x[lat| 91]x[lon| 180]<br><br>   yyyymm = cd_calendar(x&amp;time, -1)<br>   yyyy   = yyyymm/100<br><br>   dimx = dimsizes(x)<br>   ntim = dimx(0)                ; all years and months<br>   nlat = dimx(1)<br>   mlon = dimx(2)<br><br>   year  = ispan(yyyy(0), yyyy(ntim-1), 1)<br>   nyrs  = dimsizes(year)<br><br>;*****************************<wbr>*******************<br>; Areal averages: cos(lat) is good enough<br>;*****************************<wbr>*******************<br><br>   xann  = month_to_annual(x , 1)                 ; [year| 112]x[lat| 91]x[lon| 180]<br>   xann&amp;year  = year<br>   printVarSummary(xann)<br><br>;*****************************<wbr>*******************<br>; Calculate the regression coefficients (slopes)    <br>;*****************************<wbr>*******************<br>   rc           = regCoef(year,xann(lat|:,lon|:,<wbr>year|:))            <br>   <br>   rc@long_name = &quot;Trend&quot;<br>   rc@units     = xann@units+&quot;/year&quot;<br>   copy_VarCoords(xann(0,:,:), rc)                ; copy lat,lon coords<br><br>   printVarSummary(rc)<br><br>;*****************************<wbr>*******************<br>; for illustration: change units to degC/period-used<br>;*****************************<wbr>*******************<br>   rc           = rc*nyrs                       ; (C/year)*(nyrs)<br>   rc@units     = &quot;&quot;+nyrs+&quot; year&quot;<br><br>;*****************************<wbr>*******************<br>; plotting parameters <br>;*****************************<wbr>*******************<br>   wks  = gsn_open_wks(&quot;eps&quot;,&quot;EACSST_tre<wbr>nd_yearly_precip&quot;)       ; specifies a ps plot<br>   gsn_define_colormap(wks,&quot;preci<wbr>p2_15lev&quot;)<br>   res                       = True     <br>   res@gsnMaximize           = True             ; make large<br><br>   res@cnFillOn              = True             ; turn on color<br>   res@cnLinesOn             = False            ; turn off contour lines<br>   res@cnLineLabelsOn        = False            ; turn off contour line labels<br> ;;res@cnFillMode            = &quot;RasterFill&quot;<br><br>   res@mpMinLatF             =  5                  ;-- sub-region minimum latitude<br>   res@mpMaxLatF             =  40                 ;-- sub-region maximum latitude<br>   res@mpMinLonF             =  60                  ;-- sub-region minimum longitude<br>   res@mpMaxLonF             =  100                  ;-- sub-region maximum longitude<br><br><br>   res@cnLevelSelectionMode  = &quot;ManualLevels&quot;   ; set manual contour levels<br>   res@cnMinLevelValF        =  -0.18            ; set min contour level<br>   res@cnMaxLevelValF        =  0.18            ; set max contour level<br>   res@cnLevelSpacingF       =  0.01            ; set contour interval<br><br>   res@mpFillOn              = False            ; turn off default background gray<br>  ;res@mpCenterLonF          = 180<br><br>   res@gsnCenterString       = year(0)+&quot;-&quot;+year(nyrs-1) <br>   <br>   res@tiMainString          = &quot;Yearly trend (precip EACSST)&quot;    ; fili<br>   plot = gsn_csm_contour_map_ce(wks,rc,<wbr>res)    <br>  end<br>=================<br clear="all"><div><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><br></div><div>--</div>Regards,<div>Nitin Patil</div></div></div></div></div></div></div></div></div></div>
</div></div></div>
</div><br></div></div></div>
______________________________<wbr>_________________<br>ncl-talk mailing list<br><a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>List instructions, subscriber options, unsubscribe:<br><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br></div></blockquote></div><br></div></div></blockquote></div><br></div>