visisipy.analysis.zernike_standard_coefficients#
Calculate the Zernike standard coefficients for an eye model.
Functions#
Calculate the Zernike standard coefficients at the retina surface. |
|
|
Calculate the root-mean-square (RMS) of higher-order aberrations (HOA) in the eye model. |
Module Contents#
- visisipy.analysis.zernike_standard_coefficients.zernike_standard_coefficients(model: visisipy.models.EyeModel | None = None, field_coordinate: tuple[float, float] | None = None, wavelength: float | None = None, field_type: Literal['angle', 'object_height'] = 'angle', sampling: visisipy.types.SampleSize | str | int = 64, maximum_term: int = 45, unit: visisipy.types.ZernikeUnit = 'microns', *, return_raw_result: Literal[False] = False, backend: visisipy.backend.BaseBackend = _AUTOMATIC_BACKEND) visisipy.wavefront.ZernikeCoefficients#
- visisipy.analysis.zernike_standard_coefficients.zernike_standard_coefficients(model: visisipy.models.EyeModel | None = None, field_coordinate: tuple[float, float] | None = None, wavelength: float | None = None, field_type: Literal['angle', 'object_height'] = 'angle', sampling: visisipy.types.SampleSize | str | int = 64, maximum_term: int = 45, unit: visisipy.types.ZernikeUnit = 'microns', *, return_raw_result: Literal[True] = True, backend: visisipy.backend.BaseBackend = _AUTOMATIC_BACKEND) tuple[visisipy.wavefront.ZernikeCoefficients, Any]
Calculate the Zernike standard coefficients at the retina surface.
Zernike standard coefficients are returned in the Noll notation.
- Parameters:
- modelEyeModel | None
The eye model to be used in the ray trace. If None, the current eye model will be used.
- field_coordinatetuple[float, float] | None, optional
The field coordinate for the Zernike calculation. When None, the first field in the backend is used. Defaults to None.
- wavelengthfloat | None, optional
The wavelength for the Zernike calculation. When None, the first wavelength in the backend is used. Defaults to None.
- field_typeLiteral[“angle”, “object_height”], optional
The type of field to be used when setting the field coordinate. This parameter is only used when field_coordinate is specified. Defaults to “angle”.
- samplingSampleSize | str | int, optional
The sampling for the Zernike calculation. Defaults to 64.
- maximum_termint, optional
The maximum term for the Zernike calculation. Defaults to 45.
- unitZernikeUnit, optional
The unit for the Zernike coefficients. Must be either “microns” or “waves”. Defaults to “microns”.
- return_raw_resultbool, optional
Return the raw analysis result from the backend. Defaults to False.
- backendBaseBackend
The backend to be used for the analysis. If not provided, the current backend is used.
- Returns:
- ZernikeCoefficients
Zernike standard coefficients in Noll notation.
- Raises:
- ValueError
If unit is not “microns” or “waves”.
- visisipy.analysis.zernike_standard_coefficients.rms_hoa(model: visisipy.models.EyeModel | None = None, min_order: int = 3, max_order: int = 6, field_coordinate: tuple[float, float] | None = None, wavelength: float | None = None, field_type: visisipy.types.FieldType = 'angle', sampling: visisipy.types.SampleSize | str | int = 64, maximum_term: int | None = None, unit: visisipy.types.ZernikeUnit = 'microns', *, return_raw_result: Literal[False] = False, backend: visisipy.backend.BaseBackend = _AUTOMATIC_BACKEND) float#
- visisipy.analysis.zernike_standard_coefficients.rms_hoa(model: visisipy.models.EyeModel | None = None, min_order: int = 3, max_order: int = 6, field_coordinate: tuple[float, float] | None = None, wavelength: float | None = None, field_type: visisipy.types.FieldType = 'angle', sampling: visisipy.types.SampleSize | str | int = 64, maximum_term: int | None = None, unit: visisipy.types.ZernikeUnit = 'microns', *, return_raw_result: Literal[True] = True, backend: visisipy.backend.BaseBackend = _AUTOMATIC_BACKEND) tuple[float, Any]
Calculate the root-mean-square (RMS) of higher-order aberrations (HOA) in the eye model.
By default, the Zernike orders from 3 to 8 are used. The RMS is calculated following the definition in the ANSI Z80.28-2010 standard [Rebe9195945cb-1]:
\[RMS_{WFE} = \sqrt{ \sum_{n>1, all\ m} (C_{n}^{m})^2 }\]- Parameters:
- modelEyeModel | None
The eye model to be used in the ray trace. If None, the current eye model will be used.
- min_orderint
The minimum Zernike polynomial order to be included in the calculation. Defaults to 3.
- max_orderint
The maximum Zernike polynomial order to be included in the calculation. Defaults to 8.
- field_coordinatetuple[float, float] | None, optional
The field coordinate for the Zernike calculation. When None, the first field in the backend is used. Defaults to None.
- wavelengthfloat | None, optional
The wavelength for the Zernike calculation. When None, the first wavelength in the backend is used. Defaults to None.
- field_typeLiteral[“angle”, “object_height”], optional
The type of field to be used when setting the field coordinate. This parameter is only used when field_coordinate is specified. Defaults to “angle”.
- samplingSampleSize | str | int, optional
The sampling for the Zernike calculation. Defaults to 64.
- maximum_termint | None, optional
The maximum term for the Zernike calculation. If None, the maximum term is set to the largest term of max_order. Defaults to None.
- unitZernikeUnit, optional
The unit for the Zernike coefficients. Must be either “microns” or “waves”. Defaults to “microns”.
- return_raw_resultbool, optional
Return the raw analysis result from the backend. Defaults to False.
- backendBaseBackend
The backend to be used for the analysis. If not provided, the current backend is used.
- Returns:
- float
The root-mean-square (RMS) of higher-order aberrations (HOA) in the eye model.
- Raises:
- ValueError
If min_order or max_order is less than 0. If max_order is less than or equal to min_order. If maximum_term is less than the largest term of max_order.