[AstroPy] AstroPy Digest, Vol 47, Issue 23

Jonathan Slavin jslavin@cfa.harvard....
Mon Jul 26 07:59:06 CDT 2010


Fabricio,

It is no doubt more efficient and more controllable to do smoothing in
Fourier space, but all I need is a quick and simple method for display
purposes.  For that the method I found (and Michael Kelley also pointed
out) is scipy.ndimage.filters.uniform_filter, or better
scipy.ndimage.filters.gaussian_filter.  These are very fast on my 160**3
grid and do the trick.

Jon

On Sun, 2010-07-25 at 12:00 -0500, astropy-request@scipy.org wrote:
> Date: Sat, 24 Jul 2010 15:21:30 -0300
> From: Fabricio Ferrari <fabricio@ferrari.pro.br>
> Subject: [AstroPy] python equivalent to IDL routine smooth
> To: astropy@scipy.org
> Message-ID:
> 	<AANLkTi=PS3h=w7Lmt43UFAL0A56EbWeM8q8xwA0ukioq@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> 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
> 
> 
> ------------------------------
> 
> _______________________________________________
> AstroPy mailing list
> AstroPy@scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
> 
> 
> End of AstroPy Digest, Vol 47, Issue 23
> ***************************************
-- 
______________________________________________________________
Jonathan D. Slavin              Harvard-Smithsonian CfA
jslavin@cfa.harvard.edu         60 Garden Street, MS 83
phone: (617) 496-7981           Cambridge, MA 02138-1516
 cell: (781) 363-0035           USA
______________________________________________________________



More information about the AstroPy mailing list