MatrixFourierTransform
- class hcipy.fourier.MatrixFourierTransform(input_grid, output_grid, precompute_matrices=None, allocate_intermediate=None)
Bases:
FourierTransform
A Matrix Fourier Transform (MFT) object.
This Fourier transform is based on the MFT described in [Soummer2007]. It requires both the input and output grid to be separated in Cartesian coordinates. Additionally, due to current implementation limitations, this Fourier transform only supports one- and two-dimensional grids.
[Soummer2007]Soummer et al. 2007, “Fast computation of Lyot-style coronagraph propagation”.
- Parameters:
- input_gridGrid
The grid that is expected for the input field.
- output_gridGrid
The grid that is produced by the Fourier transform.
- precompute_matricesboolean or None
Whether to precompute the matrices used in the MFT. Turning this on will provide a 20-30% speedup, in exchange for higher memory usage.If this is False, the matrices will be calculated each time a Fourier transform is performed. If this is True, the matrices will be calculated once, and reused for future evaluations. If this is None, the choice will be determined by the configuration file.
- allocate_intermediateboolean or None
Whether to reserve memory for the intermediate result for the MFT. This provides a 5-10% speedup in exchange for higher memory usage. If this is None, the choice will be determined by the configuration file.
- Raises:
- ValueError
If the input grid is not separated in Cartesian coordinates, if it’s not one- or two- dimensional, or if the output grid has a different dimension than the input grid.
Methods Summary
backward
(field)Returns the inverse Fourier transform of the
Field
field.check_if_supported
(input_grid, output_grid)Check if the specified grids are supported by the Matrix Fourier transform.
compute_complexity
(input_grid, output_grid)Compute the algorithmic complexity for the Matrix Fourier transform.
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.
- classmethod check_if_supported(input_grid, output_grid)
Check if the specified grids are supported by the Matrix Fourier transform.
- Parameters:
- input_gridGrid
The grid that is expected for the input field.
- output_gridGrid
The grid that is produced by the Matrix Fourier transform.
- Raises:
- ValueError
If the grids are not supported. The message will indicate why the grids are not supported.
- classmethod compute_complexity(input_grid, output_grid)
Compute the algorithmic complexity for the Matrix Fourier transform.
- Parameters:
- input_gridGrid
The grid that is expected for the input field.
- output_gridGrid
The grid that is produced by the Matrix Fourier transform.
- Returns:
- AlgorithmicComplexity
The algorithmic complexity for the Fourier transform.
- Raises:
- ValueError
If the grids are not supported. The message will indicate why the grids are not supported.
- 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.