23 __all__ = [
"getSipMatrixFromMetadata",
"makeDistortedTanWcs",
"computePixelToDistortedPixel"]
25 from ..coordinates
import Point2D
26 from ..transformFactory
import linearizeTransform, makeTransform
27 from ..skyWcs
import makeModifiedWcs
28 from .wcsUtils
import _getSipMatrixFromMetadata
32 """Extract a SIP matrix from FITS TAN-SIP WCS metadata 34 Omitted coefficients are set to 0 and all coefficients may be omitted. 38 metadata : lsst.daf.base.PropertySet 41 Name of TAN-SIP matrix; one of "A", "B", "Ap", "Bp" 51 If the order keyword <name>_ORDER (e.g. AP_ORDER) is not found, 52 the value of the order keyword cannot be read as an integer, 53 the value of the order keyword is negative, 54 or if a matrix parameter (e.g. AP_5_0) cannot be read as a float. 56 arr = _getSipMatrixFromMetadata(metadata, name)
64 Compute a WCS that includes a model of optical distortion. 66 This is useful in the common case that the initial WCS entirely ignores 67 the effect of optical distortion. 71 tanWcs : lsst.afw.geom.SkyWcs 72 A pure TAN WCS, such as is usually provided in raw data. 73 This should have no existing compensation for optical distortion 74 (though it may include an ACTUAL_PIXELS frame to model pixel-level 76 pixelToFocalPlane : lsst.afw.geom.TransformPoint2ToPoint2 77 Transform parent pixel coordinates to focal plane coordinates. 78 This models the location of the CCD on the focal plane 79 and is almost always an affine transformation. 80 This can be obtained from the detector of an exposure. 81 focalPlaneToFieldAngle : lsst.afw.geom.TransformPoint2ToPoint2 82 Transform focal plane coordinates to field angle coordinates. 83 This is a model for optical distortion, and is often a radial 84 polynomial. This can be obtained from the camera geometry. 90 A copy of `tanWcs` that includes the effect of optical distortion. 95 If the current frame of `wcs` is not a SkyFrame; 97 If 2-dimensional Frames with Domain "PIXELS" and "IWC" 151 return makeModifiedWcs(pixelTransform=pixelToDistortedPixel, wcs=tanWcs, modifyActualPixels=
False)
156 Compute the transform pixelToDistortedPixel, which applies optical 157 distortion specified by focalPlaneToFieldAngle 159 The resulting transform is designed to be used to convert a pure TAN WCS 160 to a WCS that includes a model for optical distortion. In detail, 161 the initial WCS will contain these frames and transforms: 162 PIXELS frame -> pixelToIwc -> IWC frame -> gridToIwc -> SkyFrame 163 To produce the WCS with distortion, replace pixelToIwc with: 164 pixelToDistortedPixel -> pixelToIwc 168 pixelToFocalPlane : lsst.afw.geom.TransformPoint2ToPoint2 169 Transform parent pixel coordinates to focal plane coordinates 170 focalPlaneToFieldAngle : lsst.afw.geom.TransformPoint2ToPoint2 171 Transform focal plane coordinates to field angle coordinates 175 pixelToDistortedPixel : lsst.afw.geom.TransformPoint2ToPoint2 176 A transform that applies the effect of the optical distortion model. 180 return pixelToFocalPlane.then(focalPlaneToFieldAngle) \
181 .
then(focalPlaneToTanFieldAngle.getInverse()) \
182 .
then(pixelToFocalPlane.getInverse())
std::shared_ptr< SkyWcs > makeModifiedWcs(TransformPoint2ToPoint2 const &pixelTransform, SkyWcs const &wcs, bool modifyActualPixels)
Create a new SkyWcs whose pixels are transformed by pixelTransform, as described below.
AffineTransform linearizeTransform(TransformPoint2ToPoint2 const &original, Point2D const &inPoint)
Approximate a Transform by its local linearization.
Point< double, 2 > Point2D
std::shared_ptr< TransformPoint2ToPoint2 > makeTransform(AffineTransform const &affine)
Wrap an AffineTransform as a Transform.
def makeDistortedTanWcs(tanWcs, pixelToFocalPlane, focalPlaneToFieldAngle)
def getSipMatrixFromMetadata(metadata, name)
def computePixelToDistortedPixel(pixelToFocalPlane, focalPlaneToFieldAngle)