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

Home » Public Forums » archive » Re: where() and IEEE NaN
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: where() and IEEE NaN [message #17794 is a reply to message #17793] Sat, 06 November 1999 00:00 Go to previous messageGo to previous message
Vincenzo Andretta is currently offline  Vincenzo Andretta
Messages: 1
Registered: November 1999
Junior Member
Try:

WHERE(FINITE(array,/NaN) eq 1)


Example:


IDL> array=[1.0,!VALUES.F_Infinity,-!VALUES.F_Infinity,!VALUES.F_ NaN]
IDL> print,where(finite(array) eq 0)
1 2 3
IDL> print,where(finite(array,/NaN) eq 1)
3
IDL> print,where(finite(array,/infinity) eq 1)
1 2


Note that IDL seems to be able to deal with "infinities", at least to some
extent:


IDL> print,min(array),max(array)
-Inf Inf
% Program caused arithmetic error: Floating illegal operand
IDL> print,1./array
1.00000 0.00000 -0.00000 NaN


I wouldn't rely on this behaviour, but it is conceivable one might want
to know where NaN values are, while ignoring infinities.



Vincenzo Andretta
CUA,NASA/GSFC - Laboratory for Astronomy and Solar Physics
Greenbelt, MD 20771 - USA



P.S:
IDL> help,/structure,!version
** Structure !VERSION, 5 tags, length=80:
ARCH STRING 'alpha'
OS STRING 'OSF'
OS_FAMILY STRING 'unix'
RELEASE STRING '5.2'
BUILD_DATE STRING 'Oct 30 1998'
[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
Read Message
Previous Topic: Re: Center of mass???
Next Topic: Re: contour plots on walls of a cube

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

Current Time: Wed Oct 08 19:02:12 PDT 2025

Total time taken to generate the page: 0.00459 seconds