Use the "where" function
http://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtm
prc = where(abs(prc).lt.0.1, 0.0, prc)
Good luck
Wang, Yi wrote:
> Hi Folks:
>
> I have an observation with an uncertain range of -/+ 0.1. Any values within
> the range is considered as 0.0.
>
> I tried with:
>
> mask(prc,abs(prc).lt.0.1,False) ;;;; This set up the 0.0 value to missing
> value.
>
> And:
>
> Prc = prc>0.1 ;;;;; This set up the less than 0.1 value to 0.1.
>
> Both cannot give the right answer to my demand. PRC is the observation.
>
> Is there anyway to realize this without looping over the data?
>
> Thanks in advance,
>
> Yi Wang, PhD
> Pacific Northwest National Lab
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-- ====================================================== Dennis J. Shea tel: 303-497-1361 | P.O. Box 3000 fax: 303-497-1333 | Climate Analysis Section | Climate & Global Dynamics Div. | National Center for Atmospheric Research | Boulder, CO 80307 | USA email: shea 'at' ucar.edu | ====================================================== _______________________________________________ ncl-talk mailing list ncl-talk_at_ucar.edu http://mailman.ucar.edu/mailman/listinfo/ncl-talkReceived on Tue Feb 12 2008 - 17:19:30 MST
This archive was generated by hypermail 2.2.0 : Fri Feb 15 2008 - 17:17:57 MST