FastFourierTransform

class hcipy.fourier.FastFourierTransform(input_grid, q=1, fov=1, shift=0, emulate_fftshifts=None)

Bases: hcipy.fourier.fourier_transform.FourierTransform

A Fast Fourier Transform (FFT) object.

This Fourier transform calculates FFTs with zeropadding and cropping. This Fourier transform requires the input grid to be regular in Cartesian coordinates. Every number of dimensions is allowed.

Parameters
input_gridGrid

The grid that is expected for the input field.

qscalar

The amount of zeropadding to perform. A value of 1 denotes no zeropadding.

fovscalar

The amount of cropping to perform in the Fourier domain.

shiftarray_like or scalar

The amount by which to shift the output grid.

emulate_fftshiftsboolean or None

Whether to emulate FFTshifts normally used in the FFT by multiplications in the opposite domain. Enabling this increases performance by 3x, but degrades accuracy of the FFT by 10x. If this is None, the choice will be determined by the configuration file.

Raises
ValueError

If the input grid is not regular or Cartesian.

Methods Summary

backward(field)

Returns the inverse Fourier transform of the Field field.

forward(field)

Returns the forward Fourier transform of the Field field.

Methods Documentation

backward(field)

Returns the inverse Fourier transform of the Field field.

Parameters
fieldField

The field to inverse Fourier transform.

Returns
Field

The inverse Fourier transform of the field.

forward(field)

Returns the forward Fourier transform of the Field field.

Parameters
fieldField

The field to Fourier transform.

Returns
Field

The Fourier transform of the field.