IntrinsicZernikes#
- class lsst.ip.isr.IntrinsicZernikes(table=None, table_ocs=None, **kwargs)#
Bases:
IsrCalibIntrinsic 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_yandvaluesattributes (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*_ocsattributes/keys.Parameters#
- table
astropy.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_ocs
astropy.table.Table, optional Source table in the OCS, with the same column layout as
table.
Attributes#
- field_x, field_y
numpy.ndarray CCS x/y field positions in degrees for all sample points, shape
(n_points_ccs,).- field_x_ocs, field_y_ocs
numpy.ndarray OCS x/y field positions in degrees for all sample points, shape
(n_points_ocs,).- noll_indices
numpy.ndarray Noll indices of the stored Zernike terms, shape
(n_zernikes,).- values, values_ocs
numpy.ndarray Zernike coefficients in microns for the CCS and OCS sample points, shape
(n_points, n_zernikes).
interpolator, interpolator_ocs :
scipy.interpolate.LinearNDInterpolatororNoneInterpolators built from the CCS and OCS sample points and values.
Noneuntil 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#
- dictionary
dict Dictionary of properties.
Returns#
- calib
lsst.ip.isr.IntrinsicZernikes Constructed calibration.
Raises#
- RuntimeError
Raised if the supplied dictionary is for a different calibration type.
- dictionary
- classmethod fromTable(tableList)#
Construct calibration from a list of tables.
Parameters#
- tableList
list[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_sysmetadata entry (defaulting to"CCS"). A version 1 single-table calibration, which has nocoord_sysentry, is therefore read as the CCS system.
Returns#
- calib
lsst.ip.isr.IntrinsicZernikes The calibration defined in the tables.
- tableList
- 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_x
array-like x-field positions in degrees (CCS).
- field_y
array-like y-field positions in degrees (CCS).
- rotTelPos
float, optional Rotation angle in degrees applied to the query point before interpolating the OCS contribution. Defaults to 0.
- noll_indices
list[int], optional List of Noll indices to return. If None, return all.
Returns#
- zernikes
array-like Array of Zernike coefficient values in microns corresponding to the requested Noll indices and field positions.
- field_x
- readText(filename, format='auto')#
Read calibration representation from a yaml/ecsv file.
Parameters#
- filename
str Name of the file containing the calibration definition.
- kwargs
dictor collections.abc.Mapping`, optional Set of key=value pairs to pass to the
fromDictorfromTablemethods.
Returns#
- calib
IsrCalibType Calibration class.
Raises#
- RuntimeError
Raised if the filename does not end in “.ecsv” or “.yaml”.
- filename
- toDict()#
Return a dictionary containing the calibration properties.
The dictionary should be able to be round-tripped through
fromDict.Returns#
- dictionary
dict Dictionary of properties.
- dictionary
- 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#
- tableList
list[astropy.table.Table] List of tables containing the intrinsic zernikes calibration information, one per populated coordinate system.
- tableList
- writeText(filename, format='auto')#
Write the calibration data to a text file.
Parameters#
- filename
str Name of the file to write.
- format
str - Format to write the file as. Supported values are:
"auto": Determine filetype from filename."yaml": Write as yaml."ecsv": Write as ecsv.
Returns#
- used
str 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.
- filename