22 __all__ = [
"CameraConfig",
"DetectorConfig"]
26 from .transformConfig
import TransformMapConfig
30 """A configuration that represents (and can be used to construct) a 33 transformDict = pexConfig.ConfigField(
34 "Dictionary of camera transforms keyed on the transform type.", TransformMapConfig)
35 name = pexConfig.Field(
"Name of detector slot", str)
36 id = pexConfig.Field(
"ID of detector slot", int)
37 bbox_x0 = pexConfig.Field(
"x0 of pixel bounding box", int)
38 bbox_y0 = pexConfig.Field(
"y0 of pixel bounding box", int)
39 bbox_x1 = pexConfig.Field(
"x1 of pixel bounding box", int)
40 bbox_y1 = pexConfig.Field(
"y1 of pixel bounding box", int)
41 detectorType = pexConfig.Field(
42 "Detector type: SCIENCE=0, FOCUS=1, GUIDER=2, WAVEFRONT=3", int)
43 physicalType = pexConfig.Field(
44 "How this specific detector is constructed; e.g. CCD, E2V, HgCdTe ", str, default=
"CCD")
45 serial = pexConfig.Field(
46 "Serial string associated with this specific detector", str)
47 offset_x = pexConfig.Field(
48 "x offset from the origin of the camera in mm in the transposed system.", float)
49 offset_y = pexConfig.Field(
50 "y offset from the origin of the camera in mm in the transposed system.", float)
51 refpos_x = pexConfig.Field(
"x position of the reference point in the detector in pixels " 52 "in transposed coordinates.", float)
53 refpos_y = pexConfig.Field(
"y position of the reference point in the detector in pixels " 54 "in transposed coordinates.", float)
55 yawDeg = pexConfig.Field(
"yaw (rotation about z) of the detector in degrees. " 56 "This includes any necessary rotation to go from " 57 "detector coordinates to camera coordinates " 58 "after optional transposition.", float)
59 pitchDeg = pexConfig.Field(
60 "pitch (rotation about y) of the detector in degrees", float)
61 rollDeg = pexConfig.Field(
62 "roll (rotation about x) of the detector in degrees", float)
63 pixelSize_x = pexConfig.Field(
"Pixel size in the x dimension in mm", float)
64 pixelSize_y = pexConfig.Field(
"Pixel size in the y dimension in mm", float)
68 transposeDetector = pexConfig.Field(
69 "Transpose the pixel grid before orienting in focal plane?", bool)
71 crosstalk = pexConfig.ListField(
73 doc=(
"Flattened crosstalk coefficient matrix; should have nAmps x nAmps entries. " 74 "Once 'reshape'-ed, ``coeffs[i][j]`` is the fraction of the j-th amp present on the i-th amp."),
79 """Return a 2-D numpy array of crosstalk coefficients of the proper shape""" 83 return np.array(self.
crosstalk, dtype=np.float32).reshape((numAmps, numAmps))
84 except Exception
as e:
85 raise RuntimeError(
"Cannot reshape 'crosstalk' coefficients to square matrix: %s" % (e,))
89 """A configuration that represents (and can be used to construct) a Camera. 91 detectorList = pexConfig.ConfigDictField(
92 "List of detector configs", keytype=int, itemtype=DetectorConfig)
93 transformDict = pexConfig.ConfigField(
94 "Dictionary of camera transforms keyed on the transform type.", TransformMapConfig)
95 name = pexConfig.Field(
"Name of this camera", str)
97 plateScale = pexConfig.Field(
98 "Plate scale of the camera in arcsec/mm", float)
101 radialCoeffs = pexConfig.ListField(
102 "Coefficients for radial distortion", float)
def getCrosstalk(self, numAmps)