Skip to content

Commit aa9e55c

Browse files
Merge pull request #1668 from leftaroundabout/regression/pyfftw-0.13-normalisation-convention
Fix Fourier normalisation that was changed by PyFFTW-0.13
2 parents 9b93c01 + 53499de commit aa9e55c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

odl/trafos/backends/pyfftw_bindings.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@ def pyfftw_call(array_in, array_out, direction='forward', axes=None,
203203
else:
204204
fftw_plan = fftw_plan_in
205205

206-
fftw_plan(array_in, array_out, normalise_idft=normalise_idft)
206+
if not normalise_idft and direction=='forward':
207+
fftw_plan(array_in, array_out, normalise_idft=True)
208+
else:
209+
fftw_plan(array_in, array_out, normalise_idft=normalise_idft)
207210

208211
if wexport:
209212
try:

odl/trafos/fourier.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,8 @@ def _call_pyfftw(self, x, out, **kwargs):
675675
halfcomplex=self.halfcomplex, planning_effort=effort,
676676
fftw_plan=self._fftw_plan, normalise_idft=True)
677677

678-
# Need to normalize for 'forward', no way to force pyfftw
678+
# Need to normalize for 'forward', pyfftw before version 0.13
679+
# does not offer a way to do this.
679680
if self.sign == '-':
680681
out /= np.prod(np.take(self.domain.shape, self.axes))
681682

0 commit comments

Comments
 (0)