LinearizedOpticalSystem

class hcipy.optics.LinearizedOpticalSystem(static_field: FieldBase, field_response: ModeBasis, modes: ModeBasis, wavelength: float, mode_type: str)[source]

Bases: object

The first-order (linearized) response of an optical system to wavefront error modes.

This model describes the output electric field of an optical system to first order in the coefficients phi of a set of wavefront error modes:

E_out = static_field + field_response * phi

Parameters:
static_fieldField

The complex electric field on the output grid for zero mode coefficients (E_0).

field_responseModeBasis

The per-mode response fields on the output grid (G). The columns of this basis are the derivatives of the output electric field with respect to the mode coefficients.

modesModeBasis

The input wavefront error modes, as passed to linearize_optical_system().

wavelengthscalar

The wavelength for which the model was linearized.

mode_typestr

The semantics of the modes (‘opd’, ‘phase’, ‘amplitude’ or ‘field’), documenting the units of the modes and of the mode coefficients.

Attributes Summary

field_response

input_grid

The grid on which the modes are defined.

mode_type

modes

output_grid

The grid on which the output electric field is defined.

static_field

wavelength

Methods Summary

__call__(coefficients)

Evaluate the linearized output electric field for given mode coefficients.

intensity_from_covariance(P)

The mean intensity on the output grid for mode coefficients with covariance P.

pastis_matrix(weights)

The PASTIS matrix of this linearized optical system, weighted per output point.

Attributes Documentation

field_response: ModeBasis = <dataclasses._MISSING_TYPE object>
input_grid

The grid on which the modes are defined.

mode_type: str = <dataclasses._MISSING_TYPE object>
modes: ModeBasis = <dataclasses._MISSING_TYPE object>
output_grid

The grid on which the output electric field is defined.

static_field: FieldBase = <dataclasses._MISSING_TYPE object>
wavelength: float = <dataclasses._MISSING_TYPE object>

Methods Documentation

__call__(coefficients)[source]

Evaluate the linearized output electric field for given mode coefficients.

This evaluates \(E = E_0 + G * \phi\) on the output grid, using a single matrix-vector product without intermediate copies of the response basis.

Parameters:
coefficientsndarray

The mode coefficients phi, with one entry per mode.

Returns:
Field

The output electric field on the output grid.

intensity_from_covariance(P)[source]

The mean intensity on the output grid for mode coefficients with covariance P.

For mode coefficients phi with zero mean and covariance P, the mean intensity of the linearized field is:

\[E[I] = |E_0|^2 + diag(G P G^H)\]

If P is given as a vector, it is interpreted as the diagonal of the covariance matrix (the per-mode variances). The diagonal of \(G P G^H\) is computed without materializing the (n_out, n_out) covariance matrix of the output field, requiring only (n_out, r) storage.

Parameters:
Pndarray

The covariance matrix of the mode coefficients, of shape (r, r), or a vector of length r containing its diagonal.

Returns:
Field

The mean intensity on the output grid.

Raises:
ValueError

If P is not a vector of length r or a matrix of shape (r, r).

pastis_matrix(weights)[source]

The PASTIS matrix of this linearized optical system, weighted per output point.

The PASTIS matrix describes the second-order response of the weighted sum of the intensity on the output grid to the mode coefficients:

\[M = \Re[G^H W G],\]

with ::math::W = diag(weights). See [Leboulleux2018].

[Leboulleux2018]

L. Leboulleux, J.-F. Sauvage, L. A. Pueyo, T. Fusco, R. Soummer, J. Mazoyer, A. Sivaramakrishnan, M. N’Diaye, and O. Fauvarque, “Pair-based Analytical model for Segmented Telescopes Imaging from Space (PASTIS) for sensitivity analysis,” Journal of Astronomical Telescopes, Instruments, and Systems, 4(3), 035002 (2018). https://doi.org/10.1117/1.JATIS.4.3.035002

Parameters:
weightsField or ndarray

The weights for each point on the output grid, e.g. a dark hole mask.

Returns:
ndarray

The weighted PASTIS matrix, of shape (r, r).