1 from __future__
import absolute_import, division
27 __all__ = [
"makePixelToTanPixel"]
30 """!Make an XYTransform whose forward direction converts PIXEL to TAN_PIXEL for one detector
32 PIXELS and TAN_PIXELS are defined in @ref afwCameraGeomCoordSys in doc/cameraGeom.dox
34 @param[in] bbox detector bounding box (an lsst.afw.geom.Box2I)
35 @param[in] orientation orientation of detector in focal plane (an lsst.afw.cameraGeom.Orientation)
36 @param[in] focalPlaneToPupil an lsst.afw.math.XYTransform that converts from focal plane (mm)
37 to pupil coordinates (radians) in the forward direction
38 @param[in] pixelSizeMm size of the pixel in mm in X and Y (an lsst.afw.geom.Extent2D)
39 @param[in] plateScale plate scale of the camera in arcsec/mm (a double)
41 pixelToFocalPlane = orientation.makePixelFpTransform(pixelSizeMm)
43 meanPixelSizeMm = (pixelSizeMm[0] + pixelSizeMm[1]) / 2.0
44 radPerMeanPix =
afwGeom.Angle(plateScale, afwGeom.arcseconds).asRadians() * meanPixelSizeMm
47 detCtrTanPix = detCtrPix
49 detCtrPupil = focalPlaneToPupil.forwardTransform(pixelToFocalPlane.forwardTransform(detCtrPix))
51 pupilTanPixAngRad = -orientation.getYaw().asRadians()
52 pupilTanPixSin = math.sin(pupilTanPixAngRad)
53 pupilTanPixCos = math.cos(pupilTanPixAngRad)
54 tanPixToPupilRotMat = numpy.array((
55 (pupilTanPixCos, pupilTanPixSin),
56 (-pupilTanPixSin, pupilTanPixCos),
60 tanPixCtrMinus0Pupil = tanPixToPupilRotTransform(detCtrTanPix)
61 tanPix0Pupil = numpy.array(detCtrPupil) - numpy.array(tanPixCtrMinus0Pupil)
def makePixelToTanPixel
Make an XYTransform whose forward direction converts PIXEL to TAN_PIXEL for one detector.
A floating-point coordinate rectangle geometry.