LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Member Functions | Public Attributes | List of all members
lsst.afw.cameraGeom.testUtils.DetectorWrapper Class Reference

Public Member Functions

def __init__ (self, name="detector 1", id=1, detType=DetectorType.SCIENCE, serial="xkcd722", bbox=None, numAmps=3, pixelSize=(0.02, 0.02), ampExtent=(5, 6), orientation=Orientation(), plateScale=20.0, radialDistortion=0.925, crosstalk=None, modFunc=None, physicalType="CCD", cameraBuilder=None)
 

Public Attributes

 name
 
 id
 
 type
 
 serial
 
 bbox
 
 pixelSize
 
 ampExtent
 
 plateScale
 
 orientation
 
 radialDistortion
 
 transMap
 
 crosstalk
 
 physicalType
 
 ampList
 
 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.

Parameters
----------
name : `str` (optional)
    Detector name.
id : `int` (optional)
    Detector ID.
detType : `lsst.afw.cameraGeom.DetectorType` (optional)
    Detector type.
serial : `str` (optional)
    Serial "number".
bbox : `lsst.geom.Box2I` (optional)
    Bounding box; defaults to (0, 0), (1024x1024).
numAmps : `int` (optional)
    Number of amplifiers.
pixelSize : `lsst.geom.Point2D` (optional)
    Pixel size (mm).
ampExtent : `lsst.geom.Extent2I` (optional)
    Dimensions of amplifier image bbox.
orientation : `lsst.afw.cameraGeom.Orientation` (optional)
    Orientation of CCC in focal plane.
plateScale : `float` (optional)
    Plate scale in arcsec/mm; 20.0 is for LSST.
radialDistortion : `float` (optional)
    Radial distortion, in mm/rad^2.
    The r^3 coefficient of the radial distortion polynomial
    that converts FIELD_ANGLE in radians to FOCAL_PLANE in mm;
    0.925 is the value Dave Monet measured for lsstSim data
crosstalk : `iterable` (optional)
    Crosstalk coefficient matrix. If None, then no crosstalk correction
    can be performed.
modFunc : `callable` (optional)
    A function that can modify attributes just before constructing the
    detector; modFunc receives one argument: a DetectorWrapper with all
    attributes except detector set.
physicalType : `str` (optional)
    The physical type of the device, e.g. CCD, E2V, HgCdTe

Definition at line 42 of file testUtils.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 86 of file testUtils.py.

102  ):
103  # note that (0., 0.) for the reference position is the center of the
104  # first pixel
105  self.name = name
106  self.id = int(id)
107  self.type = detType
108  self.serial = serial
109  if bbox is None:
110  bbox = lsst.geom.Box2I(lsst.geom.Point2I(0, 0), lsst.geom.Extent2I(1024, 1048))
111  self.bbox = bbox
112  self.pixelSize = lsst.geom.Extent2D(*pixelSize)
113  self.ampExtent = lsst.geom.Extent2I(*ampExtent)
114  self.plateScale = float(plateScale)
115  self.orientation = orientation
116  self.radialDistortion = float(radialDistortion)
117 
118  # compute TAN_PIXELS transform
119  pScaleRad = lsst.geom.arcsecToRad(self.plateScale)
120  radialDistortCoeffs = [0.0, 1.0/pScaleRad,
121  0.0, self.radialDistortion/pScaleRad]
122  focalPlaneToField = afwGeom.makeRadialTransform(radialDistortCoeffs)
123  pixelToTanPixel = makePixelToTanPixel(
124  bbox=self.bbox,
125  orientation=self.orientation,
126  focalPlaneToField=focalPlaneToField,
127  pixelSizeMm=self.pixelSize,
128  )
129  tanPixelSys = CameraSys(TAN_PIXELS, self.name)
130  actualPixelSys = CameraSys(ACTUAL_PIXELS, self.name)
131  self.transMap = {
132  FOCAL_PLANE: self.orientation.makePixelFpTransform(self.pixelSize),
133  tanPixelSys: pixelToTanPixel,
134  actualPixelSys: afwGeom.makeRadialTransform([0, 0.95, 0.01]),
135  }
136  if crosstalk is None:
137  crosstalk = [[0.0 for _ in range(numAmps)] for _ in range(numAmps)]
138  self.crosstalk = crosstalk
139  self.physicalType = physicalType
140  if cameraBuilder is None:
141  cameraBuilder = Camera.Builder("CameraForDetectorWrapper")
142  self.ampList = []
143  for i in range(numAmps):
144  ampBuilder = Amplifier.Builder()
145  ampName = f"amp {i + 1}"
146  ampBuilder.setName(ampName)
147  ampBuilder.setBBox(lsst.geom.Box2I(lsst.geom.Point2I(-1, 1), self.ampExtent))
148  ampBuilder.setGain(1.71234e3)
149  ampBuilder.setReadNoise(0.521237e2)
150  ampBuilder.setReadoutCorner(ReadoutCorner.LL)
151  self.ampList.append(ampBuilder)
152  if modFunc:
153  modFunc(self)
154  detectorBuilder = cameraBuilder.add(self.name, self.id)
155  detectorBuilder.setType(self.type)
156  detectorBuilder.setSerial(self.serial)
157  detectorBuilder.setPhysicalType(self.physicalType)
158  detectorBuilder.setBBox(self.bbox)
159  detectorBuilder.setOrientation(self.orientation)
160  detectorBuilder.setPixelSize(self.pixelSize)
161  detectorBuilder.setTransformFromPixelsTo(tanPixelSys, self.transMap[tanPixelSys])
162  detectorBuilder.setTransformFromPixelsTo(actualPixelSys, self.transMap[actualPixelSys])
163  detectorBuilder.setCrosstalk(np.array(self.crosstalk, dtype=np.float32))
164  for ampBuilder in self.ampList:
165  detectorBuilder.append(ampBuilder)
166  camera = cameraBuilder.finish()
167  self.detector = camera[self.name]
168 
169 
An integer coordinate rectangle.
Definition: Box.h:55
std::shared_ptr< FrameSet > append(FrameSet const &first, FrameSet const &second)
Construct a FrameSet that performs two transformations in series.
Definition: functional.cc:33
def makePixelToTanPixel(bbox, orientation, focalPlaneToField, pixelSizeMm)
std::shared_ptr< TransformPoint2ToPoint2 > makeRadialTransform(std::vector< double > const &coeffs)
A purely radial polynomial distortion.
constexpr double arcsecToRad(double x) noexcept
Definition: Angle.h:55

Member Data Documentation

◆ ampExtent

lsst.afw.cameraGeom.testUtils.DetectorWrapper.ampExtent

Definition at line 113 of file testUtils.py.

◆ ampList

lsst.afw.cameraGeom.testUtils.DetectorWrapper.ampList

Definition at line 142 of file testUtils.py.

◆ bbox

lsst.afw.cameraGeom.testUtils.DetectorWrapper.bbox

Definition at line 111 of file testUtils.py.

◆ crosstalk

lsst.afw.cameraGeom.testUtils.DetectorWrapper.crosstalk

Definition at line 138 of file testUtils.py.

◆ detector

lsst.afw.cameraGeom.testUtils.DetectorWrapper.detector

Definition at line 167 of file testUtils.py.

◆ id

lsst.afw.cameraGeom.testUtils.DetectorWrapper.id

Definition at line 106 of file testUtils.py.

◆ name

lsst.afw.cameraGeom.testUtils.DetectorWrapper.name

Definition at line 105 of file testUtils.py.

◆ orientation

lsst.afw.cameraGeom.testUtils.DetectorWrapper.orientation

Definition at line 115 of file testUtils.py.

◆ physicalType

lsst.afw.cameraGeom.testUtils.DetectorWrapper.physicalType

Definition at line 139 of file testUtils.py.

◆ pixelSize

lsst.afw.cameraGeom.testUtils.DetectorWrapper.pixelSize

Definition at line 112 of file testUtils.py.

◆ plateScale

lsst.afw.cameraGeom.testUtils.DetectorWrapper.plateScale

Definition at line 114 of file testUtils.py.

◆ radialDistortion

lsst.afw.cameraGeom.testUtils.DetectorWrapper.radialDistortion

Definition at line 116 of file testUtils.py.

◆ serial

lsst.afw.cameraGeom.testUtils.DetectorWrapper.serial

Definition at line 108 of file testUtils.py.

◆ transMap

lsst.afw.cameraGeom.testUtils.DetectorWrapper.transMap

Definition at line 131 of file testUtils.py.

◆ type

lsst.afw.cameraGeom.testUtils.DetectorWrapper.type

Definition at line 107 of file testUtils.py.


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