30 __all__ = [
"TestCamera"]
34 """A simple test Camera
36 There is one ccd with name "0"
37 It has four amplifiers with names "00", "01", "10", and "11"
39 The camera is modeled after a small portion of the LSST sim Summer 2012 camera:
40 a single detector with four amplifiers, consisting of
41 raft 2,2 sensor 0,0, half of channels 0,0 0,1 1,0 and 1,1 (the half closest to the Y centerline)
43 Note that the Summer 2012 camera has one very weird feature: the bias region
44 (rawHOverscanBbox) is actually a prescan (appears before the data pixels).
46 A raw image has the sky in the same orientation on all amplifier subregions,
47 so no amplifier subregions need their pixels to be flipped.
50 amp: amplifier number: one of 00, 01, 10, 11
51 ccd: ccd number: always 0
52 visit: exposure number; test data includes one exposure with visit=1
56 """Construct a TestCamera
59 radialDistortion = 0.925
60 radialCoeff = np.array((0.0, 1.0, 0.0, radialDistortion)) / plateScale.asRadians()
64 {cameraGeom.PUPIL: pupilToFocalPlane})
66 cameraGeom.Camera.__init__(self,
"test", detectorList, cameraTransformMap)
69 """Make a list of detectors
71 @param[in] focalPlaneToPupil lsst.afw.geom.XYTransform from FOCAL_PLANE to PUPIL coordinates
72 @return a list of detectors (lsst.afw.cameraGeom.Detector)
76 for detectorConfig
in detectorConfigList:
78 detector =
makeDetector(detectorConfig, ampInfoCatalog, focalPlaneToPupil)
79 detectorList.append(detector)
83 """Make a list of detector configs
85 @return a list of detector configs (lsst.afw.cameraGeom.DetectorConfig)
90 detector0Config = cameraGeom.DetectorConfig()
91 detector0Config.name =
'0'
92 detector0Config.id = 0
93 detector0Config.serial =
'0000011'
94 detector0Config.detectorType = 0
95 detector0Config.bbox_x0 = 0
96 detector0Config.bbox_x1 = 1017
97 detector0Config.bbox_y0 = 0
98 detector0Config.bbox_y1 = 1999
99 detector0Config.pixelSize_x = 0.01
100 detector0Config.pixelSize_y = 0.01
101 detector0Config.transformDict.nativeSys =
'Pixels'
102 detector0Config.transformDict.transforms =
None
103 detector0Config.refpos_x = 2035.5
104 detector0Config.refpos_y = 999.5
105 detector0Config.offset_x = -42.26073
106 detector0Config.offset_y = -42.21914
107 detector0Config.transposeDetector =
False
108 detector0Config.pitchDeg = 0.0
109 detector0Config.yawDeg = 90.0
110 detector0Config.rollDeg = 0.0
111 return [detector0Config]
114 """Construct an amplifier info catalog
116 The LSSTSim S12 amplifiers are unusual in that they start with 4 pixels
117 of usable bias region (which is used to set rawHOverscanBbox, despite the name),
118 followed by the data. There is no other underscan or overscan.
123 xRawExtent = xDataExtent + xBiasExtent
124 yRawExtent = yDataExtent
126 saturationLevel = 65535
127 linearityType = NullLinearityType
128 linearityCoeffs = [0, 0, 0, 0]
130 schema = AmpInfoTable.makeMinimalSchema()
145 (0, 0): 3.97531706217237,
146 (0, 1): 4.08263755342685,
147 (1, 0): 4.02753931932633,
148 (1, 1): 4.1890610691135,
150 record = ampCatalog.addNew()
151 record.setName(
"%d%d" % (ampX, ampY))
157 x0Raw = ampX * xRawExtent
158 y0Raw = ampY * yRawExtent
163 x0Data = x0Bias + xBiasExtent
178 record.setReadoutCorner(readCorner)
180 record.setReadNoise(readNoise)
181 record.setSaturation(saturationLevel)
182 record.setSuspectLevel(float(
"nan"))
183 record.setLinearityCoeffs([float(val)
for val
in linearityCoeffs])
184 record.setLinearityType(linearityType)
185 record.setHasRawInfo(
True)
186 record.setRawFlipX(
False)
187 record.setRawFlipY(
False)
CatalogT< AmpInfoRecord > AmpInfoCatalog
An integer coordinate rectangle.
A class representing an Angle.
def makeDetector
Make a Detector instance from a detector config and amp info catalog.
def _makeDetectorConfigList