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 serial = pexConfig.Field(
44 "Serial string associated with this specific detector", str)
45 offset_x = pexConfig.Field(
46 "x offset from the origin of the camera in mm in the transposed system.", float)
47 offset_y = pexConfig.Field(
48 "y offset from the origin of the camera in mm in the transposed system.", float)
49 refpos_x = pexConfig.Field(
"x position of the reference point in the detector in pixels " 50 "in transposed coordinates.", float)
51 refpos_y = pexConfig.Field(
"y position of the reference point in the detector in pixels " 52 "in transposed coordinates.", float)
53 yawDeg = pexConfig.Field(
"yaw (rotation about z) of the detector in degrees. " 54 "This includes any necessary rotation to go from " 55 "detector coordinates to camera coordinates " 56 "after optional transposition.", float)
57 pitchDeg = pexConfig.Field(
58 "pitch (rotation about y) of the detector in degrees", float)
59 rollDeg = pexConfig.Field(
60 "roll (rotation about x) of the detector in degrees", float)
61 pixelSize_x = pexConfig.Field(
"Pixel size in the x dimension in mm", float)
62 pixelSize_y = pexConfig.Field(
"Pixel size in the y dimension in mm", float)
66 transposeDetector = pexConfig.Field(
67 "Transpose the pixel grid before orienting in focal plane?", bool)
69 crosstalk = pexConfig.ListField(
71 doc=(
"Flattened crosstalk coefficient matrix; should have nAmps x nAmps entries. " 72 "Once 'reshape'-ed, ``coeffs[i][j]`` is the fraction of the j-th amp present on the i-th amp."),
77 """Return a 2-D numpy array of crosstalk coefficients of the proper shape""" 81 return np.array(self.
crosstalk, dtype=np.float32).reshape((numAmps, numAmps))
82 except Exception
as e:
83 raise RuntimeError(
"Cannot reshape 'crosstalk' coefficients to square matrix: %s" % (e,))
87 """A configuration that represents (and can be used to construct) a Camera. 89 detectorList = pexConfig.ConfigDictField(
90 "List of detector configs", keytype=int, itemtype=DetectorConfig)
91 transformDict = pexConfig.ConfigField(
92 "Dictionary of camera transforms keyed on the transform type.", TransformMapConfig)
93 name = pexConfig.Field(
"Name of this camera", str)
95 plateScale = pexConfig.Field(
96 "Plate scale of the camera in arcsec/mm", float)
99 radialCoeffs = pexConfig.ListField(
100 "Coefficients for radial distortion", float)
def getCrosstalk(self, numAmps)