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 #8510 is a reply to message #8502] Thu, 20 March 1997 00:00 Go to previous messageGo to previous message
bowman is currently offline  bowman
Messages: 121
Registered: September 1991
Senior Member
In article <5grgr3$7ih@News.Dal.Ca>, sritcey@is.dal.ca (Stephen Ritcey) wrote:

> while Ken Bowman suggested using the FINITE function:
>
> b= a (finite (a)) ; exclude .... what? (see below)
>

>
> What exactly does FINITE do on IDL?

You may also find the new IDL system variable, !VALUES handy.

IDL> HELP, !VALUES, /STRUCT
** Structure !VALUES, 4 tags, length=24:
F_INFINITY FLOAT INF
F_NAN FLOAT NaNQ
D_INFINITY DOUBLE INF
D_NAN DOUBLE NaNQ


IDL> x = FINDGEN(3)
IDL> x(1) = !VALUES.F_NAN
IDL> x(2) = !VALUES.F_INFINITY
IDL> PRINT, x
0.00000 NaNQ INF
IDL> PRINT, WHERE(x EQ !VALUES.F_NAN)
-1
IDL> PRINT, WHERE(x EQ !VALUES.F_INFINITY)
2
IDL> PRINT, FINITE(x)
1 0 0

So in IDL, at least, infinity is equal to infinity, but NAN is not equal
to NAN. FINITE returns false for both infinity and NAN with no error
message.

BTW, this is on:
IDL. Version 4.0.1a (OSF alpha).
Your mileage may vary by platform.


One last tidbit


IDL> x(2) = -!VALUES.F_INFINITY
IDL> print, x
0.00000 NaNQ -INF
IDL> PRINT, WHERE(x EQ !VALUES.F_INFINITY)
-1

So you can test for + or - infinity.

Ken Bowman

--
Kenneth P. Bowman, Assoc. Prof. 409-862-4060
Department of Meteorology 409-862-4132 fax
Texas A&M University bowman@csrp.tamu.edu
College Station, TX 77843-3150
Satellite ozone movies on CD-ROM --> http://www.lenticular.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: Sun Nov 30 20:59:02 PST 2025

Total time taken to generate the page: 0.96488 seconds