Skip to content

Commit 1fdd410

Browse files
committed
Actually, Astropy's convolve_fft is an order of magnitude slower than scipy's fftconvolve, so we switch back to fftconvolve.
1 parent f7d7672 commit 1fdd410

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎statmorph/statmorph.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from astropy.stats import sigma_clipped_stats
2020
from astropy.modeling import models, fitting
2121
from astropy.utils.exceptions import AstropyUserWarning
22-
from astropy.convolution import convolve, convolve_fft
22+
from astropy.convolution import convolve
2323
import photutils
2424

2525
__all__ = ['ConvolvedSersic2D', 'SourceMorphology', 'source_morphology',
@@ -214,8 +214,9 @@ def evaluate(cls, x, y, amplitude, r_eff, n, x_0, y_0, ellip, theta):
214214
if cls.psf is None:
215215
raise Exception('Must specify PSF using set_psf method.')
216216

217-
return convolve_fft(np.float64(z_sersic), np.float64(cls.psf),
218-
normalize_kernel=False)
217+
# Apparently, scipy.signal also wants double:
218+
return scipy.signal.fftconvolve(
219+
np.float64(z_sersic), np.float64(cls.psf), mode='same')
219220

220221
class SourceMorphology(object):
221222
"""

0 commit comments

Comments
 (0)