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

Home » Public Forums » archive » Mean and NaNs
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Mean and NaNs [message #83130] Wed, 06 February 2013 08:16
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
Hi IDLers,

I know I have been annoying with NaNs lately, but is the following
"Floating illegal operand" supposed to happen???

IDL> print, !VERSION
{ x86_64 linux unix linux 8.2.2 Jan 23 2013 64 64}

IDL> data = FINDGEN(10,10,10)
IDL> data[5,5,*] = !VALUES.F_NAN
IDL> help, mean(data, /NAN)
<Expression> FLOAT = 499.444
IDL> help, mean(data, DIMENSION=3, /NAN)
<Expression> FLOAT = Array[10, 10]
% Program caused arithmetic error: Floating illegal operand

Which is related to:
IDL> print, mean(!VALUES.F_NAN)
NaN
IDL> print, mean(!VALUES.F_NAN, /NAN)
-NaN
% Program caused arithmetic error: Floating illegal operand

Is it my job to catch those cases or is something wrong?

Thanks,

Fabien
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: HOw to change the axis size/type font size/type in CG plots?
Next Topic: controling a warped image: How to do it?

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

Current Time: Wed Oct 08 15:06:01 PDT 2025

Total time taken to generate the page: 0.00448 seconds