22__all__ = [
"CameraConfig",
"DetectorConfig"]
27from ._cameraGeom
import Orientation
28from ._transformConfig
import TransformMapConfig
32 """A configuration that represents (and can be used to construct) a
35 transformDict = pexConfig.ConfigField(
36 "Dictionary of camera transforms keyed on the transform type.", TransformMapConfig)
37 name = pexConfig.Field(
"Name of detector slot", str)
38 id = pexConfig.Field(
"ID of detector slot", int)
39 bbox_x0 = pexConfig.Field(
"x0 of pixel bounding box", int)
40 bbox_y0 = pexConfig.Field(
"y0 of pixel bounding box", int)
41 bbox_x1 = pexConfig.Field(
"x1 of pixel bounding box", int)
42 bbox_y1 = pexConfig.Field(
"y1 of pixel bounding box", int)
43 detectorType = pexConfig.Field(
44 "Detector type: SCIENCE=0, FOCUS=1, GUIDER=2, WAVEFRONT=3", int)
45 physicalType = pexConfig.Field(
46 "How this specific detector is constructed; e.g. CCD, E2V, HgCdTe ", str, default=
"CCD")
47 serial = pexConfig.Field(
48 "Serial string associated with this specific detector", str)
49 offset_x = pexConfig.Field(
50 "x offset from the origin of the camera in mm in the transposed system.", float)
51 offset_y = pexConfig.Field(
52 "y offset from the origin of the camera in mm in the transposed system.", float)
53 offset_z = pexConfig.Field(
54 "z offset from the origin of the camera in mm in the transposed system.", float, default=0.0)
55 refpos_x = pexConfig.Field(
"x position of the reference point in the detector in pixels "
56 "in transposed coordinates.", float)
57 refpos_y = pexConfig.Field(
"y position of the reference point in the detector in pixels "
58 "in transposed coordinates.", float)
59 yawDeg = pexConfig.Field(
"yaw (rotation about z) of the detector in degrees. "
60 "This includes any necessary rotation to go from "
61 "detector coordinates to camera coordinates "
62 "after optional transposition.", float)
63 pitchDeg = pexConfig.Field(
64 "pitch (rotation about y) of the detector in degrees", float)
65 rollDeg = pexConfig.Field(
66 "roll (rotation about x) of the detector in degrees", float)
67 pixelSize_x = pexConfig.Field(
"Pixel size in the x dimension in mm", float)
68 pixelSize_y = pexConfig.Field(
"Pixel size in the y dimension in mm", float)
72 transposeDetector = pexConfig.Field(
73 "Transpose the pixel grid before orienting in focal plane?", bool)
75 crosstalk = pexConfig.ListField(
77 doc=(
"Flattened crosstalk coefficient matrix; should have nAmps x nAmps entries. "
78 "Once 'reshape'-ed, ``coeffs[i][j]`` is the fraction of the j-th amp present on the i-th amp."),
84 """Return a 2-D numpy array of crosstalk coefficients of the proper shape"""
88 if numAmps != int(np.sqrt(len(self.
crosstalk))):
89 numAmps = int(np.sqrt(len(self.
crosstalk)))
91 return np.array(self.
crosstalk, dtype=np.float32).reshape((numAmps, numAmps))
92 except Exception
as e:
93 raise RuntimeError(f
"Cannot reshape 'crosstalk' coefficients to square matrix: {e}")
97 """Return the detector bounding box from the separate box endpoint
105 """Return the detector offset as a Point3D from the separate config
112 """Return the detector reference position as a Point2D from the
113 separate config values.
119 """Return the cameraGeom.Orientation() object defined by the
120 configuration values.
129 """Return the pixel size as an Extent2D from the separate values.
135 """A configuration that represents (and can be used to construct) a Camera.
137 detectorList = pexConfig.ConfigDictField(
138 "List of detector configs", keytype=int, itemtype=DetectorConfig)
139 transformDict = pexConfig.ConfigField(
140 "Dictionary of camera transforms keyed on the transform type.", TransformMapConfig)
141 name = pexConfig.Field(
"Name of this camera", str)
143 plateScale = pexConfig.Field(
144 "Plate scale of the camera in arcsec/mm", float)
147 radialCoeffs = pexConfig.ListField(
148 "Coefficients for radial distortion", float)
table::Point2DKey pixelSize
def getCrosstalk(self, numAmps)