LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
Loading...
Searching...
No Matches
Classes | Functions | Variables
lsst.afw.cameraGeom._amplifier Namespace Reference

Classes

class  Amplifier
 
class  AmplifierGeometryComparison
 

Functions

 transform (self, *outOffset=None, outFlipX=False, outFlipY=False)
 

Variables

dict ReadoutCornerValNameDict
 
dict ReadoutCornerNameValDict
 

Function Documentation

◆ transform()

lsst.afw.cameraGeom._amplifier.transform ( self,
* outOffset = None,
outFlipX = False,
outFlipY = False )
Transform an amplifier builder (in-place) by applying shifts and
flips.

Parameters
----------
outOffset : `lsst.geom.Extent2I`, optional
    Post-transformation return value for ``self.getRawXYOffset()``.
    The default is ``(0, 0)``, which shifts the amplifier to its
    position in the assembled (but still untrimmed) raw image.
outFlipX : `bool`, optional
    Post-transformation return value for ``self.getRawFlipX()``.  The
    default is `False`, which flips the amplifier to its correct
    X orientation in the assembled raw image.
outFlipX : `bool`, optional
    Post-transformation return value for ``self.getRawFlipY()``.  The
    default is `False`, which flips the amplifier to its correct
    Y orientation in the assembled raw image.

Returns
-------
self : `AmplifierBuilder`
    Returned to enable method chaining, e.g.
    ``amplifier.rebuild().transform().finish()``.

Definition at line 132 of file _amplifier.py.

132def transform(self, *, outOffset=None, outFlipX=False, outFlipY=False):
133 """Transform an amplifier builder (in-place) by applying shifts and
134 flips.
135
136 Parameters
137 ----------
138 outOffset : `lsst.geom.Extent2I`, optional
139 Post-transformation return value for ``self.getRawXYOffset()``.
140 The default is ``(0, 0)``, which shifts the amplifier to its
141 position in the assembled (but still untrimmed) raw image.
142 outFlipX : `bool`, optional
143 Post-transformation return value for ``self.getRawFlipX()``. The
144 default is `False`, which flips the amplifier to its correct
145 X orientation in the assembled raw image.
146 outFlipX : `bool`, optional
147 Post-transformation return value for ``self.getRawFlipY()``. The
148 default is `False`, which flips the amplifier to its correct
149 Y orientation in the assembled raw image.
150
151 Returns
152 -------
153 self : `AmplifierBuilder`
154 Returned to enable method chaining, e.g.
155 ``amplifier.rebuild().transform().finish()``.
156 """
157 if outOffset is None:
158 outOffset = Extent2I(0, 0)
159 bbox = self.getRawBBox()
160 awidth, aheight = bbox.getDimensions()
161 #
162 # Figure out how far flipping the amp LR and/or TB offsets the bboxes
163 #
164 boxMin0 = bbox.getMin() # initial position of rawBBox's LLC corner
165 if self.getRawFlipX() != outFlipX:
166 bbox.flipLR(awidth)
167 if self.getRawFlipY() != outFlipY:
168 bbox.flipTB(aheight)
169 shift = boxMin0 - bbox.getMin()
170
171 for bboxName in ("",
172 "HorizontalOverscan",
173 "Data",
174 "VerticalOverscan",
175 "Prescan"):
176 bbox = getattr(self, f"getRaw{bboxName}BBox")()
177 if self.getRawFlipX() != outFlipX:
178 bbox.flipLR(awidth)
179 if self.getRawFlipY() != outFlipY:
180 bbox.flipTB(aheight)
181 bbox.shift(self.getRawXYOffset() + shift - outOffset)
182
183 getattr(self, f"setRaw{bboxName}BBox")(bbox)
184
185 # Update the Readout Corner if we've flipped anything.
186 outReadoutCorner = self.getReadoutCorner()
187 if self.getRawFlipX() != outFlipX:
188 xFlipMapping = {ReadoutCorner.LL: ReadoutCorner.LR, ReadoutCorner.LR: ReadoutCorner.LL,
189 ReadoutCorner.UR: ReadoutCorner.UL, ReadoutCorner.UL: ReadoutCorner.UR}
190 outReadoutCorner = xFlipMapping[outReadoutCorner]
191 if self.getRawFlipY() != outFlipY:
192 yFlipMapping = {ReadoutCorner.LL: ReadoutCorner.UL, ReadoutCorner.LR: ReadoutCorner.UR,
193 ReadoutCorner.UR: ReadoutCorner.LR, ReadoutCorner.UL: ReadoutCorner.LL}
194 outReadoutCorner = yFlipMapping[outReadoutCorner]
195 if outReadoutCorner != self.getReadoutCorner():
196 self.setReadoutCorner(outReadoutCorner)
197
198 #
199 # All of these have now been transferred to the amp geometry
200 #
201 self.setRawXYOffset(outOffset)
202 self.setRawFlipX(outFlipX)
203 self.setRawFlipY(outFlipY)
204 return self
table::Key< int > transform

Variable Documentation

◆ ReadoutCornerNameValDict

dict lsst.afw.cameraGeom._amplifier.ReadoutCornerNameValDict
Initial value:
1= {val: key for key, val in
2 ReadoutCornerValNameDict.items()}

Definition at line 37 of file _amplifier.py.

◆ ReadoutCornerValNameDict

dict lsst.afw.cameraGeom._amplifier.ReadoutCornerValNameDict
Initial value:
1= {
2 ReadoutCorner.LL: "LL",
3 ReadoutCorner.LR: "LR",
4 ReadoutCorner.UR: "UR",
5 ReadoutCorner.UL: "UL",
6}

Definition at line 31 of file _amplifier.py.