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
Public Member Functions | Public Attributes | List of all members
lsst.afw.cameraGeom.testUtils.DetectorWrapper Class Reference

A Detector and the data used to construct it. More...

Inheritance diagram for lsst.afw.cameraGeom.testUtils.DetectorWrapper:

Public Member Functions

def __init__
 Construct a DetectorWrapper. More...
 

Public Attributes

 name
 
 id
 
 type
 
 serial
 
 bbox
 
 pixelSize
 
 ampExtent
 
 plateScale
 
 radialDistortion
 
 ampInfo
 
 orientation
 
 transMap
 
 detector
 

Detailed Description

A Detector and the data used to construct it.

Intended for use with unit tests, thus saves a copy of all input parameters. Does not support setting details of amplifiers.

Definition at line 17 of file testUtils.py.

Constructor & Destructor Documentation

def lsst.afw.cameraGeom.testUtils.DetectorWrapper.__init__ (   self,
  name = "detector 1",
  id = 1,
  detType = SCIENCE,
  serial = "xkcd722",
  bbox = None,
  numAmps = 3,
  pixelSize = (0.02, 0.02,
  ampExtent = (5, 6,
  orientation = Orientation(),
  plateScale = 20.0,
  radialDistortion = 0.925,
  modFunc = None 
)

Construct a DetectorWrapper.

Parameters
[in]namedetector name
[in]iddetector ID (int)
[in]detTypedetector type (an lsst.afw.cameraGeom.DetectorType)
[in]serialserial "number" (a string)
[in]bboxbounding box; defaults to (0, 0), (1024x1024) (an lsst.afw.geom.Box2I)
[in]numAmpsnumber of amplifiers (int)
[in]pixelSizepixel size (mm) (an lsst.afw.geom.Point2D)
[in]ampExtentdimensions of amplifier image bbox (an lsst.afw.geom.Extent2I)
[in]orientationorientation of CCC in focal plane (lsst.afw.cameraGeom.Orientation)
[in]plateScaleplate scale in arcsec/mm; 20.0 is for LSST
[in]radialDistortionradial distortion, in mm/rad^2 (the r^3 coefficient of the radial distortion polynomial that converts PUPIL in radians to FOCAL_PLANE in mm); 0.925 is the value Dave Monet measured for lsstSim data
[in]modFunca function that can modify attributes just before constructing the detector; modFunc receives one argument: a DetectorWrapper with all attributes except detector set.

Definition at line 36 of file testUtils.py.

36 
37  ):
38  """!Construct a DetectorWrapper
39 
40  @param[in] name detector name
41  @param[in] id detector ID (int)
42  @param[in] detType detector type (an lsst.afw.cameraGeom.DetectorType)
43  @param[in] serial serial "number" (a string)
44  @param[in] bbox bounding box; defaults to (0, 0), (1024x1024) (an lsst.afw.geom.Box2I)
45  @param[in] numAmps number of amplifiers (int)
46  @param[in] pixelSize pixel size (mm) (an lsst.afw.geom.Point2D)
47  @param[in] ampExtent dimensions of amplifier image bbox (an lsst.afw.geom.Extent2I)
48  @param[in] orientation orientation of CCC in focal plane (lsst.afw.cameraGeom.Orientation)
49  @param[in] plateScale plate scale in arcsec/mm; 20.0 is for LSST
50  @param[in] radialDistortion radial distortion, in mm/rad^2
51  (the r^3 coefficient of the radial distortion polynomial
52  that converts PUPIL in radians to FOCAL_PLANE in mm);
53  0.925 is the value Dave Monet measured for lsstSim data
54  @param[in] modFunc a function that can modify attributes just before constructing the detector;
55  modFunc receives one argument: a DetectorWrapper with all attributes except detector set.
56  """
57  # note that (0., 0.) for the reference position is the center of the first pixel
58  self.name = name
59  self.id = int(id)
60  self.type = detType
61  self.serial = serial
62  if bbox is None:
63  bbox = afwGeom.Box2I(afwGeom.Point2I(0, 0), afwGeom.Extent2I(1024, 1048))
64  self.bbox = bbox
65  self.pixelSize = afwGeom.Extent2D(*pixelSize)
66  self.ampExtent = afwGeom.Extent2I(*ampExtent)
67  self.plateScale = float(plateScale)
68  self.radialDistortion = float(radialDistortion)
69  schema = afwTable.AmpInfoTable.makeMinimalSchema()
70  self.ampInfo = afwTable.AmpInfoCatalog(schema)
71  for i in range(numAmps):
72  record = self.ampInfo.addNew()
73  ampName = "amp %d" % (i + 1,)
74  record.setName(ampName)
75  record.setBBox(afwGeom.Box2I(afwGeom.Point2I(-1, 1), self.ampExtent))
76  record.setGain(1.71234e3)
77  record.setReadNoise(0.521237e2)
78  record.setReadoutCorner(afwTable.LL)
79  record.setHasRawInfo(False)
80  self.orientation = orientation
81 
82  # compute TAN_PIXELS transform
83  pScaleRad = afwGeom.arcsecToRad(self.plateScale)
84  radialDistortCoeffs = [0.0, 1.0/pScaleRad, 0.0, self.radialDistortion/pScaleRad]
85  focalPlaneToPupil = afwGeom.RadialXYTransform(radialDistortCoeffs)
86  pixelToTanPixel = makePixelToTanPixel(
87  bbox = self.bbox,
88  orientation = self.orientation,
89  focalPlaneToPupil = focalPlaneToPupil,
90  pixelSizeMm = self.pixelSize,
91  plateScale = self.plateScale,
92  )
93 
94  self.transMap = {
95  FOCAL_PLANE: self.orientation.makePixelFpTransform(self.pixelSize),
96  CameraSys(TAN_PIXELS, self.name): pixelToTanPixel,
97  CameraSys(ACTUAL_PIXELS, self.name): afwGeom.RadialXYTransform([0, 0.95, 0.01]),
98  }
99  if modFunc:
100  modFunc(self)
101  self.detector = Detector(
102  self.name,
103  self.id,
104  self.type,
105  self.serial,
106  self.bbox,
107  self.ampInfo,
108  self.orientation,
109  self.pixelSize,
110  self.transMap,
111  )
A custom container class for records, based on std::vector.
Definition: Catalog.h:94
An integer coordinate rectangle.
Definition: Box.h:53
def makePixelToTanPixel
Make an XYTransform whose forward direction converts PIXEL to TAN_PIXEL for one detector.
A purely radial polynomial distortion, up to 6th order.
Definition: XYTransform.h:186
double arcsecToRad(double x)
Definition: Angle.h:41

Member Data Documentation

lsst.afw.cameraGeom.testUtils.DetectorWrapper.ampExtent

Definition at line 65 of file testUtils.py.

lsst.afw.cameraGeom.testUtils.DetectorWrapper.ampInfo

Definition at line 69 of file testUtils.py.

lsst.afw.cameraGeom.testUtils.DetectorWrapper.bbox

Definition at line 63 of file testUtils.py.

lsst.afw.cameraGeom.testUtils.DetectorWrapper.detector

Definition at line 100 of file testUtils.py.

lsst.afw.cameraGeom.testUtils.DetectorWrapper.id

Definition at line 58 of file testUtils.py.

lsst.afw.cameraGeom.testUtils.DetectorWrapper.name

Definition at line 57 of file testUtils.py.

lsst.afw.cameraGeom.testUtils.DetectorWrapper.orientation

Definition at line 79 of file testUtils.py.

lsst.afw.cameraGeom.testUtils.DetectorWrapper.pixelSize

Definition at line 64 of file testUtils.py.

lsst.afw.cameraGeom.testUtils.DetectorWrapper.plateScale

Definition at line 66 of file testUtils.py.

lsst.afw.cameraGeom.testUtils.DetectorWrapper.radialDistortion

Definition at line 67 of file testUtils.py.

lsst.afw.cameraGeom.testUtils.DetectorWrapper.serial

Definition at line 60 of file testUtils.py.

lsst.afw.cameraGeom.testUtils.DetectorWrapper.transMap

Definition at line 93 of file testUtils.py.

lsst.afw.cameraGeom.testUtils.DetectorWrapper.type

Definition at line 59 of file testUtils.py.


The documentation for this class was generated from the following file: