22 __all__ = [
"TestCamera"]
32 """A simple test Camera.
36 The camera has one ccd with name "0".
37 That CCD has four amplifiers with names "00", "01", "10", and "11".
39 The camera is modeled after a small portion of the LSST sim
40 Summer 2012 camera: a single detector with four amplifiers,
41 consisting of raft 2,2 sensor 0,0, half of channels 0,0 0,1 1,0 and 1,1
42 (the half closest to the Y centerline).
44 Note that the Summer 2012 camera has one very weird feature:
45 the bias region (rawHOverscanBbox) is actually a prescan
46 (it appears before the data pixels).
48 A raw image has the sky in the same orientation on all amplifier
49 subregions, so no amplifier subregions need their pixels to be flipped.
53 * ``amp``: amplifier number: one of 00, 01, 10, 11
54 * ``ccd``: ccd number: always 0
55 * ``visit``: exposure number; test data includes one exposure
66 radialCoeff = np.array([0.0, 1.0, 0.0, 0.925]) / plateScale.asRadians()
68 focalPlaneToFieldAngle = fieldAngleToFocalPlane.inverted()
70 camera = cameraGeom.Camera.Builder(
"test")
72 camera.setTransformFromFocalPlaneTo(cameraGeom.FIELD_ANGLE, focalPlaneToFieldAngle)
73 return camera.finish()
79 def _makeDetectors(cls, camera, focalPlaneToFieldAngle):
80 """Make a list of detectors
84 camera : `lsst.afw.cameraGeom.camera.Builder`
85 Camera to append detectors to.
86 focalPlaneToFieldAngle : `lsst.afw.geom.TransformPoint2ToPoint2`
87 Transform from ``FOCAL_PLANE`` to ``FIELD_ANGLE`` coordinates
88 in the forward direction.
91 for detectorConfig
in detectorConfigList:
93 detBuilder = cameraGeom.addDetectorBuilderFromConfig(
97 focalPlaneToFieldAngle,
99 if detBuilder
is None:
100 raise RuntimeError(
"Could not add detector!")
103 def _makeDetectorConfigList(cls):
104 """Make a list of detector configs
108 detectorConfigList : `list` of `lsst.afw.cameraGeom.DetectorConfig`
109 List of detector configs.
114 detector0Config = cameraGeom.DetectorConfig()
115 detector0Config.name =
'0'
116 detector0Config.id = 0
117 detector0Config.serial =
'0000011'
118 detector0Config.detectorType = 0
119 detector0Config.bbox_x0 = 0
120 detector0Config.bbox_x1 = 1017
121 detector0Config.bbox_y0 = 0
122 detector0Config.bbox_y1 = 1999
123 detector0Config.pixelSize_x = 0.01
124 detector0Config.pixelSize_y = 0.01
125 detector0Config.transformDict.nativeSys =
'Pixels'
126 detector0Config.transformDict.transforms =
None
127 detector0Config.refpos_x = 2035.5
128 detector0Config.refpos_y = 999.5
129 detector0Config.offset_x = -42.26073
130 detector0Config.offset_y = -42.21914
131 detector0Config.transposeDetector =
False
132 detector0Config.pitchDeg = 0.0
133 detector0Config.yawDeg = 90.0
134 detector0Config.rollDeg = 0.0
135 return [detector0Config]
138 def _makeAmplifierCatalog(cls):
139 """Construct an amplifier info catalog
143 ampCatalog : `List` of `lsst.afw.cameraGeom.Amplifier.Builder()
144 Amplifier information catalog.
148 The LSSTSim S12 amplifiers are unusual in that they start with 4 pixels
149 of usable bias region (which is used to set rawHOverscanBbox, despite the name),
150 followed by the data. There is no other underscan or overscan.
155 xRawExtent = xDataExtent + xBiasExtent
156 yRawExtent = yDataExtent
158 saturationLevel = 65535
159 linearityType = cameraGeom.NullLinearityType
160 linearityCoeffs = [0, 0, 0, 0]
174 (0, 0): 3.97531706217237,
175 (0, 1): 4.08263755342685,
176 (1, 0): 4.02753931932633,
177 (1, 1): 4.1890610691135,
179 amplifier = cameraGeom.Amplifier.Builder()
180 amplifier.setName(
"%d%d" % (ampX, ampY))
186 x0Raw = ampX * xRawExtent
187 y0Raw = ampY * yRawExtent
190 readCorner = cameraGeom.ReadoutCorner.LL
192 x0Data = x0Bias + xBiasExtent
202 amplifier.setRawHorizontalOverscanBBox(
geom.Box2I(
207 amplifier.setReadoutCorner(readCorner)
208 amplifier.setGain(gain)
209 amplifier.setReadNoise(readNoise)
210 amplifier.setSaturation(saturationLevel)
211 amplifier.setSuspectLevel(float(
"nan"))
212 amplifier.setLinearityCoeffs([float(val)
for val
in linearityCoeffs])
213 amplifier.setLinearityType(linearityType)
215 amplifier.setRawFlipX(
False)
216 amplifier.setRawFlipY(
False)
217 amplifier.setRawVerticalOverscanBBox(
geom.Box2I())
219 ampCatalog.append(amplifier)