Re: Taking log of an array

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri May 27 2011 - 10:44:29 MDT

   x@_FillValue = 1e20
   x = where(x.eq.0., x@_FillValue, x)
   x = log(x)

On 05/27/2011 10:38 AM, Agnes Lim wrote:
> Hi
>
> I wish to take the natural log of my cloud mixing ratio array.
> The results will have -inf if the input is 0.
>
> How can i have this value assign to FillValue so that i can plot the non
> infinity values.
> Or how could i assign the 0 values in the cloud array to FillValues so
> that log function will ignore.
>
> I tried to set _FillValue=0 but when plotting i had the following warning
> warning:ContourPlotInitialize: 0.0 not currently supported as a missing
> value; expect inaccurate plot
>
> Thanks
> Agnes
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> 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
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri May 27 10:44:36 2011

This archive was generated by hypermail 2.1.8 : Wed Jun 01 2011 - 12:41:15 MDT