comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: manipulating structures
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: manipulating structures [message #53358 is a reply to message #53357] Sun, 08 April 2007 07:06 Go to previous messageGo to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <1175997980.025055.256650@e65g2000hsc.googlegroups.com>,
"metachronist" <rkombiyil@gmail.com> wrote:

> Thanks much! I don't trust myself in such circumstances and hence I
> agree with Dr.B :-) This prompts me to ask another trivial question,
> if I may..Since I have lots of missing data, and I do lots of math
> operations (array ops, fft etc. etc.), will these (NaN) propagate all
> the way through in such situations? Should I be using them in
> conjunction with finite statement? Any pointers as to where one oughta
> be careful with these NaNs?
>
> Thanks in advance for your time and sharing your experience,
> ~rk

Many IDL functions include /NAN keywords to skip NaNs in operations
(TOTAL, MEAN, etc.). In other cases, you will have to find the good
data with WHERE(FINITE(...), COUNT = count).

There is one special case that you have to watch out for when using
TOTAL with the /NAN keyword. If *all* of the elements are NaNs, the
result returned is not a NaN, but a zero.

IDL> x = replicate(!values.f_nan, 5)
IDL> print, x
NaN NaN NaN NaN NaN
IDL> print, total(x)
NaN
IDL> print, total(x, /nan)
0.00000

I think this is a serious implementation bug because it renders the
/NAN keyword useless in most circumstances, but I guess we are stuck
with it.

Inconsistently, this happens with TOTAL, but not with MEAN

IDL> print, mean(x, /nan)
NaN


Ken
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: map_proj_init
Next Topic: Re: counting rows

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 19:56:05 PDT 2025

Total time taken to generate the page: 0.48178 seconds