22 __all__ = [
"TestCamera"]
34 """A simple test Camera. 38 The camera has one ccd with name "0". 39 That CCD has four amplifiers with names "00", "01", "10", and "11". 41 The camera is modeled after a small portion of the LSST sim 42 Summer 2012 camera: a single detector with four amplifiers, 43 consisting of raft 2,2 sensor 0,0, half of channels 0,0 0,1 1,0 and 1,1 44 (the half closest to the Y centerline). 46 Note that the Summer 2012 camera has one very weird feature: 47 the bias region (rawHOverscanBbox) is actually a prescan 48 (it appears before the data pixels). 50 A raw image has the sky in the same orientation on all amplifier 51 subregions, so no amplifier subregions need their pixels to be flipped. 55 * ``amp``: amplifier number: one of 00, 01, 10, 11 56 * ``ccd``: ccd number: always 0 57 * ``visit``: exposure number; test data includes one exposure 68 radialCoeff = np.array([0.0, 1.0, 0.0, 0.925]) / plateScale.asRadians()
70 focalPlaneToFieldAngle = fieldAngleToFocalPlane.inverted()
71 cameraTransformMap = cameraGeom.TransformMap(cameraGeom.FOCAL_PLANE,
72 {cameraGeom.FIELD_ANGLE: focalPlaneToFieldAngle})
74 cameraGeom.Camera.__init__(self,
"test", detectorList, cameraTransformMap)
76 def _makeDetectorList(self, focalPlaneToFieldAngle):
77 """Make a list of detectors 81 focalPlaneToFieldAngle : `lsst.afw.geom.TransformPoint2ToPoint2` 82 Transform from ``FOCAL_PLANE`` to ``FIELD_ANGLE`` coordinates 83 in the forward direction. 87 detectorList : `list` of `lsst.afw.cameraGeom.Detector` 92 for detectorConfig
in detectorConfigList:
94 detector =
makeDetector(detectorConfig, ampInfoCatalog, focalPlaneToFieldAngle)
95 detectorList.append(detector)
98 def _makeDetectorConfigList(self):
99 """Make a list of detector configs 103 detectorConfigList : `list` of `lsst.afw.cameraGeom.DetectorConfig` 104 List of detector configs. 109 detector0Config = cameraGeom.DetectorConfig()
110 detector0Config.name =
'0' 111 detector0Config.id = 0
112 detector0Config.serial =
'0000011' 113 detector0Config.detectorType = 0
114 detector0Config.bbox_x0 = 0
115 detector0Config.bbox_x1 = 1017
116 detector0Config.bbox_y0 = 0
117 detector0Config.bbox_y1 = 1999
118 detector0Config.pixelSize_x = 0.01
119 detector0Config.pixelSize_y = 0.01
120 detector0Config.transformDict.nativeSys =
'Pixels' 121 detector0Config.transformDict.transforms =
None 122 detector0Config.refpos_x = 2035.5
123 detector0Config.refpos_y = 999.5
124 detector0Config.offset_x = -42.26073
125 detector0Config.offset_y = -42.21914
126 detector0Config.transposeDetector =
False 127 detector0Config.pitchDeg = 0.0
128 detector0Config.yawDeg = 90.0
129 detector0Config.rollDeg = 0.0
130 return [detector0Config]
132 def _makeAmpInfoCatalog(self):
133 """Construct an amplifier info catalog 137 ampInfoCatalog : `lsst.afw.table.AmpInfoCatalog` 138 Amplifier information catalog. 142 The LSSTSim S12 amplifiers are unusual in that they start with 4 pixels 143 of usable bias region (which is used to set rawHOverscanBbox, despite the name), 144 followed by the data. There is no other underscan or overscan. 149 xRawExtent = xDataExtent + xBiasExtent
150 yRawExtent = yDataExtent
152 saturationLevel = 65535
153 linearityType = NullLinearityType
154 linearityCoeffs = [0, 0, 0, 0]
156 schema = AmpInfoTable.makeMinimalSchema()
171 (0, 0): 3.97531706217237,
172 (0, 1): 4.08263755342685,
173 (1, 0): 4.02753931932633,
174 (1, 1): 4.1890610691135,
176 record = ampInfoCatalog.addNew()
177 record.setName(
"%d%d" % (ampX, ampY))
183 x0Raw = ampX * xRawExtent
184 y0Raw = ampY * yRawExtent
189 x0Data = x0Bias + xBiasExtent
204 record.setReadoutCorner(readCorner)
206 record.setReadNoise(readNoise)
207 record.setSaturation(saturationLevel)
208 record.setSuspectLevel(
float(
"nan"))
209 record.setLinearityCoeffs([
float(val)
for val
in linearityCoeffs])
210 record.setLinearityType(linearityType)
211 record.setHasRawInfo(
True)
212 record.setRawFlipX(
False)
213 record.setRawFlipY(
False)
216 return ampInfoCatalog
A class representing an angle.
std::shared_ptr< TransformPoint2ToPoint2 > makeRadialTransform(std::vector< double > const &forwardCoeffs, std::vector< double > const &inverseCoeffs)
A purely radial polynomial distortion.
CatalogT< AmpInfoRecord > AmpInfoCatalog
def _makeDetectorList(self, focalPlaneToFieldAngle)
def _makeDetectorConfigList(self)
def _makeAmpInfoCatalog(self)
def makeDetector(detectorConfig, ampInfoCatalog, focalPlaneToField)
An integer coordinate rectangle.