lsst.afw  14.0-38-g278b05818
Functions
lsst.afw.geom.wcsUtils.wcsUtilsContinued Namespace Reference

Functions

def getSipMatrixFromMetadata (metadata, name)
 
def makeDistortedTanWcs (tanWcs, pixelToFocalPlane, focalPlaneToFieldAngle)
 
def computePixelToDistortedPixel (pixelToFocalPlane, focalPlaneToFieldAngle)
 

Function Documentation

◆ computePixelToDistortedPixel()

def lsst.afw.geom.wcsUtils.wcsUtilsContinued.computePixelToDistortedPixel (   pixelToFocalPlane,
  focalPlaneToFieldAngle 
)
Compute the transform pixelToDistortedPixel, which applies optical
distortion specified by focalPlaneToFieldAngle

The resulting transform is designed to be used to convert a pure TAN WCS
to a WCS that includes a model for optical distortion. In detail,
the initial WCS will contain these frames and transforms:
    PIXELS frame -> pixelToIwc -> IWC frame ->  gridToIwc -> SkyFrame
To produce the WCS with distortion, replace pixelToIwc with:
    pixelToDistortedPixel -> pixelToIwc

Parameters
----------
pixelToFocalPlane : lsst.afw.geom.TransformPoint2ToPoint2
    Transform parent pixel coordinates to focal plane coordinates
focalPlaneToFieldAngle : lsst.afw.geom.TransformPoint2ToPoint2
    Transform focal plane coordinates to field angle coordinates

Returns
-------
pixelToDistortedPixel : lsst.afw.geom.TransformPoint2ToPoint2
    A transform that applies the effect of the optical distortion model.

Definition at line 155 of file wcsUtilsContinued.py.

◆ getSipMatrixFromMetadata()

def lsst.afw.geom.wcsUtils.wcsUtilsContinued.getSipMatrixFromMetadata (   metadata,
  name 
)
Extract a SIP matrix from FITS TAN-SIP WCS metadata

Omitted coefficients are set to 0 and all coefficients may be omitted.

Parameters
----------
metadata : lsst.daf.base.PropertySet
    FITS metadata
name : str
    Name of TAN-SIP matrix; one of "A", "B", "Ap", "Bp"

Returns
-------
numpy.array
    The SIP matrix

Raises
------
TypeError
    If the order keyword <name>_ORDER (e.g. AP_ORDER) is not found,
    the value of the order keyword cannot be read as an integer,
    the value of the order keyword is negative,
    or if a matrix parameter (e.g. AP_5_0) cannot be read as a float.

Definition at line 32 of file wcsUtilsContinued.py.

◆ makeDistortedTanWcs()

def lsst.afw.geom.wcsUtils.wcsUtilsContinued.makeDistortedTanWcs (   tanWcs,
  pixelToFocalPlane,
  focalPlaneToFieldAngle 
)
Compute a WCS that includes a model of optical distortion.

This is useful in the common case that the initial WCS entirely ignores
the effect of optical distortion.

Parameters
----------
tanWcs : lsst.afw.geom.SkyWcs
    A pure TAN WCS, such as is usually provided in raw data.
    This should have no existing compensation for optical distortion
    (though it may include an ACTUAL_PIXELS frame to model pixel-level
    distortions).
pixelToFocalPlane : lsst.afw.geom.TransformPoint2ToPoint2
    Transform parent pixel coordinates to focal plane coordinates.
    This models the location of the CCD on the focal plane
    and is almost always an affine transformation.
    This can be obtained from the detector of an exposure.
focalPlaneToFieldAngle : lsst.afw.geom.TransformPoint2ToPoint2
    Transform focal plane coordinates to field angle coordinates.
    This is a model for optical distortion, and is often a radial
    polynomial. This can be obtained from the camera geometry.


Returns
-------
lsst.afw.geom.SkyWcs
    A copy of `tanWcs` that includes the effect of optical distortion.

Raises
------
RuntimeError
    If the current frame of `wcs` is not a SkyFrame;
LookupError
    If 2-dimensional Frames with Domain "PIXELS" and "IWC"
    are not all found.

Definition at line 63 of file wcsUtilsContinued.py.