IntrinsicZernikes#

class lsst.ip.isr.IntrinsicZernikes(table=None, table_ocs=None, **kwargs)#

Bases: IsrCalib

Intrinsic Zernike coefficients.

Stores Zernike wavefront-error coefficients sampled at a set of focal-plane field angles. At query time the coefficients are interpolated to an arbitrary field position provided in CCS.

The coefficients are stored in two coordinate systems, each as an independent set of sample points and values:

  • the Camera Coordinate System (CCS), which corresponds to the

focal plane heights and any other CCS contribution and

  • the Optical Coordinate System (OCS), corresponding to

the intrinsics, which are by nature defined in the optical coordinates.

See LSE-349 for the definitions.

The CCS sample points and values are stored on the un-suffixed field_x, field_y and values attributes (and serialized under those same keys). These names are kept unchanged from version 1, which only stored the CCS system, so that version 1 calibrations round-trip unchanged. The OCS system is stored alongside on the *_ocs attributes/keys.

Parameters#

tableastropy.table.Table, optional

Source table in the CCS. Must contain columns:

"x"

Field x positions with angular units (e.g. u.deg).

"y"

Field y positions with angular units (e.g. u.deg).

"Z{j}"

One column per Noll index j, with length units (e.g. u.um).

table_ocsastropy.table.Table, optional

Source table in the OCS, with the same column layout as table.

Attributes#

field_x, field_ynumpy.ndarray

CCS x/y field positions in degrees for all sample points, shape (n_points_ccs,).

field_x_ocs, field_y_ocsnumpy.ndarray

OCS x/y field positions in degrees for all sample points, shape (n_points_ocs,).

noll_indicesnumpy.ndarray

Noll indices of the stored Zernike terms, shape (n_zernikes,).

values, values_ocsnumpy.ndarray

Zernike coefficients in microns for the CCS and OCS sample points, shape (n_points, n_zernikes).

interpolator, interpolator_ocs : scipy.interpolate.LinearNDInterpolator or None

Interpolators built from the CCS and OCS sample points and values. None until the corresponding system is populated.

Version 1.1 adds the OCS coordinate system alongside the CCS system stored by version 1.

Methods Summary

fromDict(dictionary)

Construct an IntrinsicZernikes from dictionary of properties.

fromTable(tableList)

Construct calibration from a list of tables.

getIntrinsicZernikes(field_x, field_y[, ...])

Get the intrinsic Zernike coefficients at a given field position.

readText(filename[, format])

Read calibration representation from a yaml/ecsv file.

toDict()

Return a dictionary containing the calibration properties.

toTable()

Construct a list of tables containing the information in this calibration.

writeText(filename[, format])

Write the calibration data to a text file.

Methods Documentation

classmethod fromDict(dictionary)#

Construct an IntrinsicZernikes from dictionary of properties.

Parameters#

dictionarydict

Dictionary of properties.

Returns#

caliblsst.ip.isr.IntrinsicZernikes

Constructed calibration.

Raises#

RuntimeError

Raised if the supplied dictionary is for a different calibration type.

classmethod fromTable(tableList)#

Construct calibration from a list of tables.

Parameters#

tableListlist [astropy.table.Table]

List of tables to use to construct the intrinsic zernikes calibration. Each table is dispatched to the CCS or OCS coordinate system according to its coord_sys metadata entry (defaulting to "CCS"). A version 1 single-table calibration, which has no coord_sys entry, is therefore read as the CCS system.

Returns#

caliblsst.ip.isr.IntrinsicZernikes

The calibration defined in the tables.

getIntrinsicZernikes(field_x, field_y, rotTelPos=0.0, noll_indices=None)#

Get the intrinsic Zernike coefficients at a given field position.

The returned coefficients are the sum of the CCS contribution (heights_ccs), interpolated at the requested field position, and the OCS contribution (measured_intrinsics), interpolated at the field position rotated by rotTelPos. For calibrations that only store one coordinate system (e.g. version 1 files, which only carry CCS), the missing OCS contribution is simply omitted from the sum.

Parameters#

field_xarray-like

x-field positions in degrees (CCS).

field_yarray-like

y-field positions in degrees (CCS).

rotTelPosfloat, optional

Rotation angle in degrees applied to the query point before interpolating the OCS contribution. Defaults to 0.

noll_indiceslist [int], optional

List of Noll indices to return. If None, return all.

Returns#

zernikesarray-like

Array of Zernike coefficient values in microns corresponding to the requested Noll indices and field positions.

readText(filename, format='auto')#

Read calibration representation from a yaml/ecsv file.

Parameters#

filenamestr

Name of the file containing the calibration definition.

kwargsdict or collections.abc.Mapping`, optional

Set of key=value pairs to pass to the fromDict or fromTable methods.

Returns#

calibIsrCalibType

Calibration class.

Raises#

RuntimeError

Raised if the filename does not end in “.ecsv” or “.yaml”.

toDict()#

Return a dictionary containing the calibration properties.

The dictionary should be able to be round-tripped through fromDict.

Returns#

dictionarydict

Dictionary of properties.

toTable()#

Construct a list of tables containing the information in this calibration.

One table is produced per populated coordinate system. The CCS table is always emitted; the OCS table is only emitted when the OCS system holds sample points, so a CCS-only calibration (e.g. one read from a version 1 file) round-trips to a single table, exactly as in version 1. The list of tables should be able to be round-tripped through fromTable.

Returns#

tableListlist [astropy.table.Table]

List of tables containing the intrinsic zernikes calibration information, one per populated coordinate system.

writeText(filename, format='auto')#

Write the calibration data to a text file.

Parameters#

filenamestr

Name of the file to write.

formatstr
Format to write the file as. Supported values are:

"auto" : Determine filetype from filename. "yaml" : Write as yaml. "ecsv" : Write as ecsv.

Returns#

usedstr

The name of the file used to write the data. This may differ from the input if the format is explicitly chosen.

Raises#

RuntimeError

Raised if filename does not end in a known extension, or if all information cannot be written.

Notes#

The file is written to YAML/ECSV format and will include any associated metadata.