linearize_optical_system
- hcipy.optics.linearize_optical_system(optical_system, aperture, modes, wavelength=1, mode_type='opd')[source]
Linearize an optical system with respect to wavefront error modes.
This function computes the first-order response of an optical system to a set of wavefront error (WFE) modes: E_out = E_0 + G * phi, where phi are the WFE-mode coefficients and G is the complex electric-field sensitivity of the output plane to each mode.
The linearization is exact: for each mode, a single propagation is used to compute the corresponding response field, with no step size and no finite differences, exploiting the complex-linearity of the optical system.
- Parameters:
- optical_systemOpticalElement or callable
The optical system to linearize. This can be anything callable that maps a
Wavefrontto aWavefront. Since OpticalElement.__call__ is aliased to forward, anOpticalSystemcan be passed as-is. The system must be complex-linear in the electric field; all standard HCIPy optical elements are.- apertureField
The entrance electric field A on the input grid. The field may be complex.
- modesModeBasis
The wavefront error modes. Their semantics are defined by mode_type.
- wavelengthscalar
The wavelength for which the model is linearized.
- mode_typestr
The semantics of the modes, and hence the units of the mode coefficients and of the returned response. With ‘opd’, each mode describes an optical path difference shape in meters, and the response column is G[:, j] = 1j * k * F(A * m_j) with k = 2 * pi / wavelength. With ‘phase’, each mode describes a phase shape in radians, and the response column is G[:, j] = 1j * F(A * m_j). With ‘amplitude’, each mode is a dimensionless multiplicative amplitude perturbation, and the response column is G[:, j] = F(A * m_j). With ‘field’, each mode is an additive complex field perturbation whose support is included in the mode itself, and the response column is G[:, j] = F(m_j).
- Returns:
- LinearizedOpticalSystem
The linearized optical system.
- Raises:
- ValueError
If mode_type is not one of the supported values.