dft_postprocess_data

odl.trafos.util.ft_utils.dft_postprocess_data(arr, real_grid, recip_grid, shift, axes, interp, sign='-', op='multiply', out=None)[source]

Post-process the Fourier-space data after DFT.

This function multiplies the given data with the separable function:

q(xi) = exp(+- 1j * dot(x[0], xi)) * s * phi_hat(xi_bar)

where x[0] and s are the minimum point and the stride of the real-space grid, respectively, and phi_hat(xi_bar) is the FT of the interpolation kernel. The sign of the exponent depends on the choice of sign. Note that for op='divide' the multiplication with s * phi_hat(xi_bar) is replaced by a division with the same array.

In discretized form on the reciprocal grid, the exponential part of this function becomes an array:

q[k] = exp(+- 1j * dot(x[0], xi[k]))

and the arguments xi_bar to the interpolation kernel are the normalized frequencies:

for 'shift=True'  : xi_bar[k] = -pi + pi * (2*k) / N
for 'shift=False' : xi_bar[k] = -pi + pi * (2*k+1) / N

See [Pre+2007], Section 13.9 “Computing Fourier Integrals Using the FFT” for a similar approach.

Parameters
arrarray-like

Array to be pre-processed. An array with real data type is converted to its complex counterpart.

real_griduniform RectGrid

Real space grid in the transform.

recip_griduniform RectGrid

Reciprocal grid in the transform

shiftbool or sequence of bools

If True, the grid is shifted by half a stride in the negative direction in the corresponding axes. The sequence must have the same length as axes.

axesint or sequence of ints

Dimensions along which to take the transform. The sequence must have the same length as shifts.

interpstring or sequence of strings

Interpolation scheme used in the real-space.

sign{‘-‘, ‘+’}, optional

Sign of the complex exponent.

op{‘multiply’, ‘divide’}, optional

Operation to perform with the stride times the interpolation kernel FT

outnumpy.ndarray, optional

Array in which the result is stored. If out is arr, an in-place modification is performed.

Returns
outnumpy.ndarray

Result of the post-processing. If out was given, the returned object is a reference to it.

References

[Pre+2007] Press, W H, Teukolsky, S A, Vetterling, W T, and Flannery, B P. Numerical Recipes in C - The Art of Scientific Computing (Volume 3). Cambridge University Press, 2007.