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

Home » Public Forums » archive » Re: Setting values to 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: Setting values to NaN [message #39934 is a reply to message #39933] Fri, 25 June 2004 04:41 Go to previous messageGo to previous message
Klaus Scipal is currently offline  Klaus Scipal
Messages: 45
Registered: November 1997
Member
Hi Matt

!VALUES.F_NAN is a float but your a array is integer. Convert your a array
to float (float(a)) before setting the NaNs and it will work

Klaus


"Matt" <matt_westmore@yahoo.co.uk> wrote in message
news:c66373b9.0406250228.f6cbaf4@posting.google.com...
> Hi,
> I'd realy appreciate someone pointing out why I'm an idiot.
>
> I'm trying to set some values of an image to NaN so that they are not
> included in further calculations but I can't seem to do it!!!
>
> eg:
> a = indgen(10)
> lt5 = where(a LT 5)
> a(lt5) = !VALUES.F_NAN
> %Program caused arithmetic error: Floating illegal operand
> print, a
> 0 0 0 0 0 5 6 7 8 9
>
> Cheers
> Matt
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: inverse function of binary.pro
Next Topic: Local solar time

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

Current Time: Fri Oct 10 17:12:19 PDT 2025

Total time taken to generate the page: 1.04417 seconds