get_propagation_matrix#

deeptrack.holography.get_propagation_matrix(shape: tuple[int, int], to_z: float, pixel_size: float, wavelength: float, dx: float = 0, dy: float = 0) ndarray#

Computes the propagation matrix for simulating the propagation of an optical field.

The propagation matrix is used to model wavefront propagation in free space based on the angular spectrum method.

Parameters#

shape: tuple[int, int]

The dimensions of the optical field (height, width).

to_z: float

Propagation distance along the z-axis.

pixel_size: float

The physical size of each pixel in the optical field.

wavelength: float

The wavelength of the optical field.

dx: float, optional

Lateral shift in the x-direction (default: 0).

dy: float, optional

Lateral shift in the y-direction (default: 0).

Returns#

np.ndarray

A complex-valued 2D NumPy array representing the propagation matrix.

Notes#

  • Uses np.fft.fftshift to shift the zero-frequency component to the center.

  • Computed based on the wave equation in Fourier space.