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

Home » Public Forums » archive » Re: Filtering out NaNs
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: Filtering out NaNs [message #8524 is a reply to message #8521] Wed, 19 March 1997 00:00 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Folks,

> |> There are some NaNs in my data which keep making my code fall over. I'd
> |> like to either filter them out or avoid them in the calculation, but doing
> |> something like
> |>
> |> a(where(a eq !values.f_nan) = missing_flag
> |>
> |> doesn't work. Does anyone have any suggestions?

>
> NaNs are characterized by the fact that they are *not* equal
> to any number (that's what it says, isn't it :-)
> In fact, it's not even equal to itself - and this is the distinguishing
> feature that must be used to pick them out. I.e.,
>
>> a(where(a ne a)) = missing_flag

I have to admit that I had convinced myself that this was a bug
in the implementation of NAN. I thank Stein Vidar for enlightening
me. It's always a good feeling when I am reminded that the universe
is far stranger than I imagine it to be most of the time! :-)

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
2642 Bradbury Court, Fort Collins, CO 80521
Phone: 970-221-0438 Fax: 970-221-4762
E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
-----------------------------------------------------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Time Series Analysis
Next Topic: Re: Anything better than ANNOTATE?

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

Current Time: Fri Oct 10 11:04:11 PDT 2025

Total time taken to generate the page: 0.71915 seconds