psf_generator.utils.czt#

A collection of custom 2D FFT functions.

  • custom_fft2: custom 2D FFT

  • custom_ifft2: custom 2D inverse FFT

  • czt1d: 1D chirp Z-transform

  • czt2d: 2D chirp Z-transform

Functions#

custom_fft2(→ torch.Tensor)

Custom 2D FFT that allows to zoom on the region of interest in the Fourier plane.

custom_ifft2(→ torch.Tensor)

Custom 2D inverse FFT that allows to zoom on the region of interest in the Fourier plane.

Module Contents#

psf_generator.utils.czt.custom_fft2(x: torch.Tensor, shape_out=None, k_start: float = 0.0, k_end: float = 2 * torch.pi, norm: str = 'ortho', fftshift_input: bool = False, include_end: bool = False) torch.Tensor[source]#

Custom 2D FFT that allows to zoom on the region of interest in the Fourier plane.

The output image is square.

Parameters#

xtorch.Tensor

Input square image

shape_outsequence of ints, optional

Shape of the output image. If None, same as the shape of the input.

k_startfloat

Start point of sampling on the complex circle. Default is 0.0.

k_endfloat

End point of sampling on the complex circle. Default is \(2\pi\).

norm{“ortho”, “forward”, “backward”}, optional

Normalization mode. Default is “ortho”.

fftshift_inputbool, optional

Whether to apply fftshift on the input image. Default is “False”.

include_endbool, optional

Whether to include the end point of sampling. Default is “False”.

Returns#

outputtorch.Tensor

Custom 2D FFT of the input image.

psf_generator.utils.czt.custom_ifft2(x: torch.Tensor, shape_out=None, k_start: float = 0.0, k_end: float = 2 * torch.pi, norm: str = 'ortho', fftshift_input: bool = False, include_end: bool = False) torch.Tensor[source]#

Custom 2D inverse FFT that allows to zoom on the region of interest in the Fourier plane.

The output image is square.

Parameters#

xtorch.Tensor

Input square image.

shape_outsequence of ints, optional

Shape of the output image. If None, same as the shape of the input.

k_startfloat

Start point of sampling on the complex circle. Default is 0.0.

k_endfloat

End point of sampling on the complex circle. Default is \(2\pi\).

norm{“ortho”, “forward”, “backward”}, optional

Normalization mode. Default is “ortho”.

fftshift_inputbool, optional

Whether to apply fftshift on the input image. Default is “False”.

include_endbool, optional

Whether to include the end point of sampling. Default is “False”.

Returns#

outputtorch.Tensor

Custom 2D inverse FFT of the input image.