[AstroPy] Convolution of NumPy arrays of arbitrary dimension

Adam Ginsburg adam.g.ginsburg at gmail.com
Fri Aug 10 19:56:03 EDT 2018

On Fri, Aug 10, 2018 at 5:51 PM, Jacob Vanderplas <jakevdp at cs.washington.edu
> wrote:

> Hi Foad,
> I'm sorry if I'm misunderstanding something, but does
> scipy.ndimage.convolve not address your use case? It implements
> N-dimensional convolution:
> from scipy.ndimage import convolveimport numpy as np
> x = np.random.rand(10, 10, 10, 10)
> w = np.ones((3, 3, 3, 3))
> result = convolve(x, w)
> For completeness, astropy's convolve_fft supports this same operation
since it's doing an nd fft under the hood, but the direct convolution
(astropy.convolution.convolve) does not, since we had to hard-code the
direct convolution operations in each dimension and so far there has been
no demand for an n-dimensional convolution with n>3.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20180810/43af5e5d/attachment-0001.html>

More information about the AstroPy mailing list