LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Functions | Variables
lsst.afw.cameraGeom.makePixelToTanPixel Namespace Reference

Functions

def makePixelToTanPixel
 Make an XYTransform whose forward direction converts PIXEL to TAN_PIXEL for one detector. More...
 

Variables

list __all__ = ["makePixelToTanPixel"]
 

Function Documentation

def lsst.afw.cameraGeom.makePixelToTanPixel.makePixelToTanPixel (   bbox,
  orientation,
  focalPlaneToPupil,
  pixelSizeMm,
  plateScale 
)

Make an XYTransform whose forward direction converts PIXEL to TAN_PIXEL for one detector.

PIXELS and TAN_PIXELS are defined in Camera Coordinate Systems in doc/cameraGeom.dox

Parameters
[in]bboxdetector bounding box (an lsst.afw.geom.Box2I)
[in]orientationorientation of detector in focal plane (an lsst.afw.cameraGeom.Orientation)
[in]focalPlaneToPupilan lsst.afw.math.XYTransform that converts from focal plane (mm) to pupil coordinates (radians) in the forward direction
[in]pixelSizeMmsize of the pixel in mm in X and Y (an lsst.afw.geom.Extent2D)
[in]plateScaleplate scale of the camera in arcsec/mm (a double)

Definition at line 29 of file makePixelToTanPixel.py.

29 
30 def makePixelToTanPixel(bbox, orientation, focalPlaneToPupil, pixelSizeMm, plateScale):
31  """!Make an XYTransform whose forward direction converts PIXEL to TAN_PIXEL for one detector
32 
33  PIXELS and TAN_PIXELS are defined in @ref afwCameraGeomCoordSys in doc/cameraGeom.dox
34 
35  @param[in] bbox detector bounding box (an lsst.afw.geom.Box2I)
36  @param[in] orientation orientation of detector in focal plane (an lsst.afw.cameraGeom.Orientation)
37  @param[in] focalPlaneToPupil an lsst.afw.math.XYTransform that converts from focal plane (mm)
38  to pupil coordinates (radians) in the forward direction
39  @param[in] pixelSizeMm size of the pixel in mm in X and Y (an lsst.afw.geom.Extent2D)
40  @param[in] plateScale plate scale of the camera in arcsec/mm (a double)
41  """
42  pixelToFocalPlane = orientation.makePixelFpTransform(pixelSizeMm)
43 
44  meanPixelSizeMm = (pixelSizeMm[0] + pixelSizeMm[1]) / 2.0
45  radPerMeanPix = afwGeom.Angle(plateScale, afwGeom.arcseconds).asRadians() * meanPixelSizeMm
46 
47  detCtrPix = afwGeom.Box2D(bbox).getCenter()
48  detCtrTanPix = detCtrPix # by definition
49 
50  detCtrPupil = focalPlaneToPupil.forwardTransform(pixelToFocalPlane.forwardTransform(detCtrPix))
51 
52  pupilTanPixAngRad = -orientation.getYaw().asRadians()
53  pupilTanPixSin = math.sin(pupilTanPixAngRad)
54  pupilTanPixCos = math.cos(pupilTanPixAngRad)
55  tanPixToPupilRotMat = numpy.array((
56  (pupilTanPixCos, pupilTanPixSin),
57  (-pupilTanPixSin, pupilTanPixCos),
58  )) * radPerMeanPix
59  tanPixToPupilRotTransform = afwGeom.AffineTransform(tanPixToPupilRotMat)
60 
61  tanPixCtrMinus0Pupil = tanPixToPupilRotTransform(detCtrTanPix)
62  tanPix0Pupil = numpy.array(detCtrPupil) - numpy.array(tanPixCtrMinus0Pupil)
63 
64  tanPixToPupilAffine = afwGeom.AffineTransform(tanPixToPupilRotMat, numpy.array(tanPix0Pupil))
65  pupilToTanPix = afwGeom.AffineXYTransform(tanPixToPupilAffine.invert())
66  return afwGeom.MultiXYTransform((pixelToFocalPlane, focalPlaneToPupil, pupilToTanPix))
An affine coordinate transformation consisting of a linear transformation and an offset.
def makePixelToTanPixel
Make an XYTransform whose forward direction converts PIXEL to TAN_PIXEL for one detector.
A floating-point coordinate rectangle geometry.
Definition: Box.h:271
Wrap a sequence of multiple XYTransforms.
Definition: XYTransform.h:133
Wrap an AffineTransform.
Definition: XYTransform.h:152

Variable Documentation

list lsst.afw.cameraGeom.makePixelToTanPixel.__all__ = ["makePixelToTanPixel"]

Definition at line 27 of file makePixelToTanPixel.py.