Skip to content

Add a generic DataArray._fftconvolve() to implement Spectrum,Image,Cube.fftconvolve()

Martin Shepherd requested to merge mcs_12jul into master

An N-dimensional FFT convolution function has been added to DataArray. This is called DataArray._fftconvolve(). This now provides the implementation of Spectrum.fftconvolve(), Image.fftconvolve() and Cube.fftconvolve(). Note that Cube.fftconvolve() did not exist previously.

In the previous implementation of Image and Spectrum.fftconvolve(), the shape of the 'other' array had to match the size of the Image or Spectrum. In the new version, the 'other' array can be any size up to the size of the MPDAF object that is being convolved.

Another new feature of this implemenation, is that any variances in self are propagated correctly.

The optional interp argument of Image.fftconvolve() has been removed, since it would be difficult to provide the same interpolation options for a cube. Filling masked data and variances with zeros for the duration of the convolution should be sufficient in most cases.

In common with the previous implementations of Image and Spectrum.fftconvolve(), the low level convolutions are performed using scipy.signal.fftconvolve(). This means that the rules for centering filtering functions in the 'other' array remain the same. These rules are now documented in the docstrings of these functions.

Merge request reports