22__all__ = [
"getSipMatrixFromMetadata",
"computePixelToDistortedPixel",
23 "createTrivialWcsMetadata",
"deleteBasicWcsMetadata",
"getCdMatrixFromMetadata",
24 "getImageXY0FromMetadata",
"hasSipMatrix",
"makeSipMatrixMetadata",
28from ._geom
import (_getSipMatrixFromMetadata, makeTransform, linearizeTransform,
29 createTrivialWcsMetadata, deleteBasicWcsMetadata, getCdMatrixFromMetadata,
30 getImageXY0FromMetadata, hasSipMatrix, makeSipMatrixMetadata,
35 """Extract a SIP matrix from FITS TAN-SIP WCS metadata.
37 Omitted coefficients are set to 0 and all coefficients may be omitted.
44 Name of TAN-SIP matrix (``
"A"``, ``
"B"``, ``
"Ap"``,
or ``
"Bp"``).
54 If the order keyword ``<name>_ORDER`` (e.g. ``AP_ORDER``)
is not found,
55 the value of the order keyword cannot be read
as an integer,
56 the value of the order keyword
is negative,
57 or if a matrix parameter (e.g. ``AP_5_0``) cannot be read
as a float.
59 arr = _getSipMatrixFromMetadata(metadata, name)
66 """Compute the transform ``pixelToDistortedPixel``, which applies optical
67 distortion specified by ``focalPlaneToFieldAngle``.
69 The resulting transform is designed to be used to convert a pure TAN WCS
70 to a WCS that includes a model
for optical distortion. In detail,
71 the initial WCS will contain these frames
and transforms::
73 PIXELS frame -> pixelToIwc -> IWC frame -> gridToIwc -> SkyFrame
75 To produce the WCS
with distortion, replace ``pixelToIwc``
with::
77 pixelToDistortedPixel -> pixelToIwc
82 Transform parent pixel coordinates to focal plane coordinates
84 Transform focal plane coordinates to field angle coordinates
89 A transform that applies the effect of the optical distortion model.
94 return pixelToFocalPlane.then(focalPlaneToFieldAngle) \
95 .
then(focalPlaneToTanFieldAngle.inverted()) \
96 .
then(pixelToFocalPlane.inverted())
def computePixelToDistortedPixel(pixelToFocalPlane, focalPlaneToFieldAngle)
def getSipMatrixFromMetadata(metadata, name)
std::shared_ptr< TransformPoint2ToPoint2 > makeTransform(lsst::geom::AffineTransform const &affine)
Wrap an lsst::geom::AffineTransform as a Transform.
lsst::geom::AffineTransform linearizeTransform(TransformPoint2ToPoint2 const &original, lsst::geom::Point2D const &inPoint)
Approximate a Transform by its local linearization.