analysis.mtf_vs_field

MTF versus Field Analysis

This module enables the calculation of the Modulation Transfer Function (MTF) versus field coordinate of an optical system.

Kramer Harrison, 2026

Classes

MTFvsField(optic, frequencies[, num_fields, ...])

MTF versus Field Coordinate.

class MTFvsField(optic: Optic, frequencies: list[float], num_fields: int = 32, wavelengths: str | list[float] = 'all', num_rays: int = 128, override_limits: bool = False)[source]

MTF versus Field Coordinate.

This class is used to analyze the Modulation Transfer Function (MTF) versus the field coordinate of an optical system for specified spatial frequencies.

Parameters:
  • optic (Optic) – the optical system.

  • frequencies (list[float]) – the spatial frequencies (in cycles/mm) to analyze.

  • num_fields (int) – the number of fields in the Y direction. Default is 32.

  • wavelengths (str or list) – the wavelengths to be analyzed. Default is ‘all’.

  • num_rays (int) – the number of rays across the pupil in 1D for the SampledMTF calculation. Default is 128.

  • override_limits (bool) – If True, bypasses the limit on the number of frequencies and wavelengths to prevent cluttered plots. Default is False.

MAX_FREQUENCIES = 5
MAX_WAVELENGTHS = 3
view(fig_to_plot_on: Figure | None = None, figsize: tuple[float, float] = (8, 5), *, show: bool = True) tuple[Figure, Axes][source]

Plots the MTF versus the field coordinate for each frequency and wavelength.

Parameters:
  • fig_to_plot_on (Figure, optional) – An existing matplotlib Figure to plot on. If provided, the plot will be embedded in this figure. If None (default), a new figure will be created.

  • figsize (tuple[float, float], optional) – Size of the figure to create if fig_to_plot_on is None. Defaults to (8, 5).

  • show (bool) – If True (default), calls plt.show(). Set False for headless use.

Returns:

The matplotlib Figure and Axes objects

containing the plot.

Return type:

tuple[Figure, Axes]