LSST Applications g0265f82a02+c6dfa2ddaf,g1162b98a3f+b2075782a9,g2079a07aa2+1b2e822518,g2bbee38e9b+c6dfa2ddaf,g337abbeb29+c6dfa2ddaf,g3ddfee87b4+a60788ef87,g50ff169b8f+2eb0e556e8,g52b1c1532d+90ebb246c7,g555ede804d+a60788ef87,g591dd9f2cf+ba8caea58f,g5ec818987f+864ee9cddb,g858d7b2824+9ee1ab4172,g876c692160+a40945ebb7,g8a8a8dda67+90ebb246c7,g8cdfe0ae6a+4fd9e222a8,g99cad8db69+5e309b7bc6,g9ddcbc5298+a1346535a5,ga1e77700b3+df8f93165b,ga8c6da7877+aa12a14d27,gae46bcf261+c6dfa2ddaf,gb0e22166c9+8634eb87fb,gb3f2274832+d0da15e3be,gba4ed39666+1ac82b564f,gbb8dafda3b+5dfd9c994b,gbeb006f7da+97157f9740,gc28159a63d+c6dfa2ddaf,gc86a011abf+9ee1ab4172,gcf0d15dbbd+a60788ef87,gdaeeff99f8+1cafcb7cd4,gdc0c513512+9ee1ab4172,ge79ae78c31+c6dfa2ddaf,geb67518f79+ba1859f325,geb961e4c1e+f9439d1e6f,gee10cc3b42+90ebb246c7,gf1cff7945b+9ee1ab4172,w.2024.12
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
lsst.afw.cameraGeom.testUtils.DetectorWrapper Class Reference

Public Member Functions

 __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__()

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< TransformPoint2ToPoint2 > makeRadialTransform(std::vector< double > const &coeffs)
A purely radial polynomial distortion.
constexpr double arcsecToRad(double x) noexcept
Definition Angle.h:56

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: