ptyrad.optics.propagator

ptyrad.optics.propagator#

Numpy-based propagator functions

Functions

near_field_evolution(Npix_shape, dx, dz, lambd)

Generates the free-space propagation transfer function using the Angular Spectrum Method (ASM).

ptyrad.optics.propagator.near_field_evolution(Npix_shape, dx, dz, lambd)[source]#

Generates the free-space propagation transfer function using the Angular Spectrum Method (ASM).

This function calculates the exact wave propagator in Fourier space, often referred to in literature as the Angular Spectrum Method, rather than the paraxial Fresnel approximation. The transfer function is defined as:

\[H(k_x, k_y) = \exp\left(i \Delta z \sqrt{k^2 - k_x^2 - k_y^2}\right)\]

The output array is shifted via ifftshift so that the zero-frequency component is located at the corners (index [0, 0]). This allows it to be directly multiplied with the output of standard unshifted FFT routines (e.g., fft2).

Note

Translated and simplified from Yi’s fold_slice MATLAB implementation into NumPy by Chia-Hao Lee.

Parameters:
  • Npix_shape (tuple of int) – The dimensions of the 2D grid in pixels, typically given as \((N_y, N_x)\).

  • dx (float) – The real-space pixel size (assumed isotropic in \(x\) and \(y\)).

  • dz (float) – The propagation distance (e.g., slice thickness) along the optical axis.

  • lambd (float) – The wavelength of the electron or illumination wave.

Returns:

A 2D complex array of shape \((N_y, N_x)\) representing the propagation transfer function in \(k\)-space.

Return type:

numpy.ndarray