opticks.utils.prysm_utils
Package for prysm integration utilities and helpers.
Functions
|
Checks whether RichData object has units. |
|
Generates a deepcopy of the input RichData object with units. |
Classes
|
Create an x, y grid from -1, 1 with n number of samples. |
|
Init with Optical Path Difference. |
- class Grid(shape, dx)[source]
Create an x, y grid from -1, 1 with n number of samples.
- Parameters:
- classmethod from_size(shape, size)[source]
Generates a Grid object from the size of one side.
If sample sizes are not equal in the two dimensions, the larger sample size is taken: dx = size / max(shape)
- shape = None
Number of samples per dimension.
If a scalar value, broadcast to both dimensions. Order is numpy axis convention, (row, col). Type is int or tuple of int.
- class OptPathDiff(opd)[source]
Init with Optical Path Difference.
The input data should be in a format that can be used in prysm. Therefore, it is recommended to initialise this object with from_zernike or similar methods.
- Parameters:
opd (
ndarray) – Optical Path Difference data (in nm)
- classmethod from_zernike(wfe_rms, aperture_diameter, grid, ordering='ansi')[source]
Computes the Optical Path Difference via Zernike Polynomials.
Generates the Zernike Polynomials to the order corresponding to the number of coefficients (e.g., 9 coefficients = mode 8) sums them properly, adding the WFE RMS Zernike coefficients.
The result is the monochromatic OPD for a single location on the PSF plane.
The input coefficients may be supplied in any of the three orderings supported by
prysm: ANSI/OSA (0-based), Noll (1-based), or Fringe (1-based). The selected ordering determines the (n, m) mapping used for each coefficient.Common optical-design tool defaults:
Zemax OpticStudio — Fringe by default (the “Zernike Fringe” surface and Wavefront Analysis outputs). A “Zernike Standard” surface uses ANSI/OSA instead.
CODE V — Fringe by default (University of Arizona / Fringe convention). Noll is also available as an option.
- Parameters:
wfe_rms (
Quantity) – list of aberration coefficients (WFE RMS) (in nm), in the order specified byorderingdiameter (
Quantity) – aperture diameter in mmgrid (
Grid) – aperture grid (in mm and rad)ordering (
str, optional) – Zernike index ordering ofwfe_rms. One of"ansi"(default),"noll", or"fringe". Zemax and CODE V default to"fringe".aperture_diameter (Quantity)
- Returns:
OptPathDiff– Optical Path Difference (OPD)rtype:OptPathDiff
- Return type:
- strip_units(units=Unit('nm'))[source]
Converts the OptPhaseDiff object to the default units.
Converts the internal parameters to float ndarrays and returns a deepcopy of the OptPhaseDiff object.
- Return type:
- Parameters:
units (
Unit, optional) – requested unit, by default “nm”- Returns:
OptPathDiff– New OptPathDiff object with float ndarrays
- richdata_has_units(rich_data)[source]
Checks whether RichData object has units.
- Return type:
- Parameters:
rich_data (RichData)
- richdata_with_units(rich_data, dx_units=Unit('mm'))[source]
Generates a deepcopy of the input RichData object with units.
Adds units to dx and wavelength (if available). The data structure is already without units by definition.
If the input rich_data has units, raises a ValueError exception.
- Return type:
RichData- Parameters:
rich_data (
RichData) – input object without unitsdx_units (
Unit) – units to be used for dx spacing parameter
- Returns:
RichData– output object with units