[AstroPy] python equivalent to IDL routine smooth

Fabricio Ferrari fabricio@ferrari.pro...
Sat Jul 24 13:21:30 CDT 2010


Hello Jonathan

it is much more efficient to do smoothering in Fourier space, since,
as you know  convolving in normal space is multiplication in Fourier
space.  So, just take the FFT of your data, the FFT of the window
filter with the same size of your data FFT, multiply them and take the
inverse FFT. The is  n-dimensional FFT  in Scipy or Numpy.

Since you have the trouble of doing all this, you should not use a
square window (boxcar) for it is the worst window in the frequency
response sense, it has a lot of frequency leakage. Please try any of
the other windows in scipy.signal, for example hamming window are a
good one.

please tell me if I can help any further, maybe off the list.

Cheers,

Fabricio
..-. ..-.
Fabricio Ferrari       [www.ferrari.pro.br]
Universidade Federal do Pampa
Bagé RS
Brasil

>   2. python equivalent to IDL routine smooth (Jonathan Slavin)
> Message: 2
> Date: Fri, 23 Jul 2010 16:07:53 -0400
> From: Jonathan Slavin <jslavin@cfa.harvard.edu>
> Subject: [AstroPy] python equivalent to IDL routine smooth
> To: astropy@scipy.org
> Message-ID: <1279915673.8463.9.camel@shevek>
> Content-Type: text/plain
>
> Does anyone know of a python equivalent to the IDL routine smooth?  I
> know about the scipy routines convolve and convolve2d, but I need to do
> it 3-D. (Also, using convolve2d gave me strange results.)
>
> My goal is to smooth a noisy 3-D dataset.  A simple boxcar type
> smoothing would be okay.
>
> Jon Slavin
> --
> ______________________________________________________________
> Jonathan D. Slavin              Harvard-Smithsonian CfA
> jslavin@cfa.harvard.edu         60 Garden Street, MS 83
> phone: (617) 496-7981           Cambridge, MA 02138-1516


More information about the AstroPy mailing list