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 #64323] Sun, 21 December 2008 01:59
gatf12 is currently offline  gatf12
Messages: 2
Registered: December 2008
Junior Member
Hi Kevin,

i'm running 6.3 but did not get such error messages.
however the nan's remain after smoothing. if they disturb you, you
could do something like this:

out=smooth(mydata>0.,5,/nan)

?
Cheers,
Tal
Re: smooth function with nan keyword but still getting "Floating illegal operand" messages [message #64326 is a reply to message #64323] Sat, 20 December 2008 19:40 Go to previous message
jkj is currently offline  jkj
Messages: 48
Registered: April 2007
Member
On Dec 20, 9:49 am, FÖLDY Lajos <fo...@rmki.kfki.hu> wrote:
> 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. :-)

Thanks Lajos... of course, the [5.5] manual says nothing about MISSING
as a keyword and my missing data are marked as NaN values... setting
EDGE does resolve the error message without changing the results of
smoothing... I'm taking care of the edge values explicitly in how the
array is built but can see that that is pointless and I should just
use EDGE, although I don't really understand internally, form the doc
description, why setting EDGE would eliminate those messages. No
error message appears in the degenerate case of a vector consisting
entirely of NaN values!

Very cool and thanks again!
-Kevin
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Remotely running IDL on a Mac using X11
Next Topic: Problem reading data from stdin using EOF(0) in version 6.0 and 7.0

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

Current Time: Wed Oct 08 18:44:45 PDT 2025

Total time taken to generate the page: 0.01097 seconds