<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"><<a href="mailto:guidocioni@gmail.com" target="_blank">guidocioni@gmail.com</a>></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 <<a href="mailto:nitinpatil85@gmail.com" target="_blank">nitinpatil85@gmail.com</a>> 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 "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/gsn_code.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/gsn_csm.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/csm/contributed.ncl"<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 = "ps" <br> pltName = "regress"<br> pltTitle = "Globe: "+(ymStrt/100)+"-"+(ymLast/100<wbr>)<br><br>;*****************************<wbr>*******************<br>; Read from netCDF file: variable is type short...unpack<br>;*****************************<wbr>*******************<br> diri = "/media/Work/3_LTS_echam6_Data<wbr>/EACSST_ens_1971-2010/"<br> fili = "EACSST_E1_1971-2010_AOD.nc"<br> f = addfile(diri+fili,"r") <br><br> YYYYMM = cd_calendar( f->time, -1)<br><br> iStrt = ind(YYYYMM.eq.ymStrt)<br> iLast = ind(YYYYMM.eq.ymLast)<br><br> <b>x = short2flt( f->tau_aod(iStrt:iLast,{latS:l<wbr>atN},{lonL:lonR}))</b><br> <br> </div><div> x@units= "mm/day"<br><br> printVarSummary(x) <wbr> ; [time| 1344]x[lat| 91]x[lon| 180]<br><br> yyyymm = cd_calendar(x&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&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 = "Trend"<br> rc@units = xann@units+"/year"<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 = ""+nyrs+" year"<br><br>;*****************************<wbr>*******************<br>; plotting parameters <br>;*****************************<wbr>*******************<br> wks = gsn_open_wks("eps","EACSST_tre<wbr>nd_yearly_precip") ; specifies a ps plot<br> gsn_define_colormap(wks,"preci<wbr>p2_15lev")<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 = "RasterFill"<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 = "ManualLevels" ; 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)+"-"+year(nyrs-1) <br> <br> res@tiMainString = "Yearly trend (precip EACSST)" ; 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>