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

Home » Public Forums » archive » Smooth()
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Smooth() [message #22875] Wed, 13 December 2000 21:28 Go to previous message
Richard French is currently offline  Richard French
Messages: 173
Registered: December 2000
Senior Member
Out of curiosity, can anyone think of a good reason that the
smooth() function bombs when you ask it to smooth something by 1?

Ex:

print,smooth([1.,3.,4.,2.],3)
1.00000 2.66667 3.00000 2.00000
print,smooth([1.,3.,4.,2.],1)
% SMOOTH: Width must be > 2 and smaller than array dimensions: <INT
( 1)>
% Execution halted at: $MAIN$

I have lots of instances where the amount of smoothing I want to
do is a variable, and it seems silly to have to do my own checking
to see if I actually need any smoothing or not.
It certainly makes sense to me that if the
smoothing width is only one bin, the smooth() function should just
be a no-op and return the input array. This is what the REBIN()
function does, after all - it does not complain if you tell it you
want the array to be rebinned to its actual size!

I've had to construct a 'mysmooth()' function that checks to see
if the number of points by which to smooth things is less than 2,
in which case I just return the calling array.

Are there other functions out there that you can think of that
don't have a sensible default evalution for limiting cases like this?
I would love to see this one changed.

Dick French
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Rotating a Pixmap?
Next Topic: Re: Delayed plotting in object graphics

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

Current Time: Sat Oct 11 00:09:58 PDT 2025

Total time taken to generate the page: 1.60392 seconds