Re: log10

From: Mike Page (mpage AT XXXXXX)
Date: Fri Jan 30 2004 - 16:10:32 MST


Log(0) is still INF. I suggested a max function but the problem then is
to decide what to choose as a cutoff value.

On Jan 30, 2004, at 4:04 PM, Sylvia Murphy wrote:

> Hi ben,
> you're right, NCL does not have a where function, but it does have
> the algerbraic > and < operators. In your case I think this will work
> if
> you
> don't mind setting all negative values to zero rather than missing:
>
>
> x<0
>
> will take all values in x < 0 and set them to 0.
>
> sm
>
>
>
> On Fri, 30 Jan 2004, Ben Foster wrote:
>
>>
>> Hi ncl-talk:
>>
>> Here's a simple question. I want to plot log10 of my field, e.g.:
>>
>> var = a->$vars(n)$(time2plot,:,:,lons2plot(i))
>> var = log10(var)
>> ...
>> plot var
>>
>> If there are values of var <= 0., I get -INF in those areas of the
>> array after the log10 (no error or warning messages). It then hangs
>> in the plot call.
>>
>> I don't think ncl has a "where" function, and I don't want to loop
>> w/ conditionals, so what is the best way to take log10 of the field
>> and substitute a fill_value where the array is <= 0.? Thanks,
>>
>> --Ben
>>
>>
>> ----------------------------------------------------------------------
>> -
>> Ben Foster High Altitude Observatory (HAO)
>> foster@ucar.edu phone: 303-497-1595 fax: 303-497-1589
>> Nat. Center for Atmos. Res. P.O. Box 3000 Boulder CO 80307 USA
>> ----------------------------------------------------------------------
>> -
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk@ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
> --
>
>
> ******************************************************
> Sylvia Murphy EML: murphys@ucar.edu
> NCAR CGD/CSEG PHN: 303-497-1720
> 1850 Table Mesa Drive FAX: 303-497-1333
> Boulder CO 80305
>
>
> WEB: http://www.cgd.ucar.edu/csm/support/
> http://www.cgd.ucar.edu/csm/support/CSM_Graphics/
> ******************************************************
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk@ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk



This archive was generated by hypermail 2b29 : Fri Jan 30 2004 - 15:56:33 MST