Skip to content

Commit 132dca9

Browse files
keflavichastrofrog
authored andcommitted
added copyrights
USE_NUMPY_FFT added as a configurationoption
1 parent e6a26d5 commit 132dca9

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

astropy/nddata/convolution/convolve.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1+
# Licensed under a 3-clause BSD style license - see PYFITS.rst
2+
13
import numpy as np
24
import warnings
5+
from astropy.config import ConfigurationItem
6+
7+
USE_NUMPY_FFT = ConfigurationItem('use_numpy_fft', False,
8+
"Use numpy's fft instead of fftw. This will be forced True if fftw is unavailable.")
9+
10+
311
try:
412
import fftw3
513
has_fftw = True
@@ -23,6 +31,8 @@ def ifftwn(array, nthreads=1):
2331
fftn = np.fft.fftn
2432
ifftn = np.fft.ifftn
2533
has_fftw = False
34+
USE_NUMPY_FFT=True
35+
2636

2737
from .boundary_none import convolve1d_boundary_none, \
2838
convolve2d_boundary_none, \
@@ -203,7 +213,7 @@ def convolve_fft(array, kernel, boundary='fill', fill_value=0,
203213
crop=True, return_fft=False, fft_pad=True,
204214
psf_pad=False, interpolate_nan=False, quiet=False,
205215
ignore_edge_zeros=False, min_wt=0.0, normalize_kernel=False,
206-
use_numpy_fft=not has_fftw, nthreads=1):
216+
use_numpy_fft=USE_NUMPY_FFT, nthreads=1):
207217
"""
208218
Convolve an ndarray with an nd-kernel. Returns a convolved image with
209219
shape = array.shape. Assumes kernel is centered.

astropy/nddata/convolution/make_kernel.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Licensed under a 3-clause BSD style license - see PYFITS.rst
2+
13
import numpy as np
24

35
def make_kernel(kernelshape, kernelwidth=3, kerneltype='gaussian',

0 commit comments

Comments
 (0)