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

Home » Public Forums » archive » Re: Arrays with NaN values
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: Arrays with NaN values [message #41253] Mon, 04 October 2004 16:58 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
David Fanning wrote:
>
> I think I would try something like this:
>
> index = Where(Finite(image) EQ 0, count)
> IF count NE 0 THEN image[index] = 0

Note that the first line could *not* be replaced by the (apparently
reasonable)

index = Where(NOT Finite(image), count)

because the NOT operator and the WHERE function do not play well
together. The reasons are explained here:

http://www.dfanning.com/code_tips/bitwiselogical.html

In IDL 6.0 the logical not operator, "~" operator was introduced to
avoid this problem, so the following would work

index = Where(~Finite(image), count)

--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Map_grid options
Next Topic: General 3D graphics advise required

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

Current Time: Sat Oct 11 16:46:00 PDT 2025

Total time taken to generate the page: 0.16066 seconds