psf.vectorial_huygens

Vectorial Huygens-Fresnel Point Spread Function (PSF) Module

This module provides the VectorialHuygensPSF class, which extends ScalarHuygensPSF to perform a full vectorial diffraction calculation using the Huygens-Fresnel principle. The PSF is computed by summing the intensity contributions from all three Cartesian components (Ex, Ey, Ez) of the electric field at the exit pupil, for each incoherent polarization state. The result is normalized so that an equivalent diffraction-limited system has a peak intensity of 100.

Kramer Harrison, 2026

Classes

VectorialHuygensPSF(optic, field, wavelength)

Vectorial Huygens PSF using the full electric-field formulation.

class VectorialHuygensPSF(optic, field, wavelength: str | float, num_rays=128, image_size=128, strategy='chief_ray', remove_tilt=False, oversample: float = None, pixel_pitch: float = None, normalization: float = None, **kwargs)[source]

Vectorial Huygens PSF using the full electric-field formulation.

This class computes the PSF by integrating the three Cartesian components of the exit-pupil electric field (Ex, Ey, Ez) over all incoherent polarization states. The total intensity at each image point is the incoherent sum of the squared-magnitude contributions from each component.

The class inherits all geometry, coordinate, and visualisation logic from ScalarHuygensPSF and only overrides _compute_psf and _get_normalization.

Parameters:
  • optic (Optic) – The optical system object.

  • field (tuple) – The field point (Hx, Hy) in normalised coordinates.

  • wavelength (str | float) – Wavelength in micrometers or 'primary'.

  • num_rays (int, optional) – Pupil sampling grid size. Defaults to 128.

  • image_size (int, optional) – Image grid size. Defaults to 128.

  • strategy (str) – Wavefront reference strategy. Defaults to "chief_ray".

  • remove_tilt (bool) – Remove tilt/piston from OPD. Defaults to False.

  • oversample (float, optional) – Oversampling ratio for MTF use. Defaults to None.

  • pixel_pitch (float, optional) – Pixel pitch in mm. Defaults to None.

  • **kwargs – Additional keyword arguments forwarded to BasePSF.

static fit_and_remove_tilt(data: WavefrontData, remove_piston: bool = False, ridge: float = 1e-12) be.ndarray

Removes piston and tilt from OPD data using weighted least squares.

Parameters:
  • data (WavefrontData) – The wavefront data containing pupil coordinates and OPD.

  • remove_piston (bool, optional) – If True, removes piston term as well as tilt. Defaults to False.

  • ridge (float, optional) – Small diagonal regularization for stability. Defaults to 1e-12.

Returns:

OPD with piston and tilt removed, shape (N,).

Return type:

opd_detrended (be.ndarray)

get_data(field: tuple[float, float], wl: float) WavefrontData

Retrieves precomputed wavefront data for a field and wavelength.

Parameters:
  • field (tuple[float, float]) – The field coordinates, or a FieldPoint.

  • wl (float) – The wavelength in µm, or a WavelengthPoint.

Returns:

A data container with the computed wavefront results.

Return type:

WavefrontData

strehl_ratio()

Computes the Strehl ratio of the PSF.

The Strehl ratio is the ratio of the peak intensity of the aberrated PSF to the peak intensity of the diffraction-limited PSF. Assumes self.psf is normalized such that its peak would be 1.0 (or 100%) for a diffraction-limited system.

Returns:

The Strehl ratio.

Return type:

float

Raises:

RuntimeError – If the PSF has not been computed.

view(fig_to_plot_on: Figure | None = None, projection: str = '2d', log: bool = False, figsize: tuple = (7, 5.5), threshold: float = 0.05, num_points: int = 128) tuple[Figure, Axes]

Visualizes the PSF.

Parameters:
  • projection (str, optional) – The projection type. Can be ‘2d’ or ‘3d’. Defaults to ‘2d’.

  • log (bool, optional) – Whether to use a logarithmic scale for the intensity. Defaults to False.

  • figsize (tuple, optional) – The figure size. Defaults to (7, 5.5).

  • threshold (float, optional) – The threshold for determining the bounds of the PSF for zoomed view. Defaults to 0.05.

  • num_points (int, optional) – The number of points used for interpolating the PSF for smoother visualization. Defaults to 128.

Returns:

A tuple containing the figure and axes objects.

Return type:

tuple

Raises:
  • RunentimeError – If the PSF has not been computed.

  • ValueError – If the projection is not ‘2d’ or ‘3d’.

  • RuntimeError – If the PSF has not been computed by the subclass.