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

Home » Public Forums » archive » Re: smooth function with nan keyword but still getting "Floating illegal operand" messages
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
Re: smooth function with nan keyword but still getting "Floating illegal operand" messages [message #64328] Sat, 20 December 2008 07:49
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Sat, 20 Dec 2008, jkj wrote:

> Why would SMOOTH have a NaN keyword and still produce error messages?
> It looks like in order to get the best boxcar average of this quality
> of data without the "Floating illegal operand" messages that I will
> have to write an explicit boxcar average? any thoughts? Leaving a
> trail of these messages does nothing to build the researcher's
> confidence in the code! Apparently the SMOOTH function is internally
> still executing a division even when no valid elements exist within
> the boxcar.
>
> Thanks,
> -Kevin
>

SMOOTH uses a sliding window, so everything will be a NaN after the first
NaN if NAN is not set. If it is set, there is still the possibility that
all values in a window are NaNs, resulting in 0/0, which is NaN again.
SMOOTH uses the MISSING value for these cases (which defaults to NaN).
Also, you should use EDGE_TRUNCATE to eliminate NaNs at the edges. So,
use something like

x=smooth(mydata, 5, /nan, missing=0, /edge)

regards,
lajos

ps: I know this from the IDL manual. :-)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: smooth function with nan keyword but still getting "Floating illegal operand" messages
Next Topic: Remotely running IDL on a Mac using X11

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

Current Time: Wed Oct 08 11:44:58 PDT 2025

Total time taken to generate the page: 0.00542 seconds