Skip to content

Commit

Permalink
Update the amplifier readout corner if data was flipped.
Browse files Browse the repository at this point in the history
  • Loading branch information
czwa committed Jan 25, 2022
1 parent 9c73e31 commit 42f2739
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions python/lsst/afw/cameraGeom/_amplifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,20 @@ def transform(self, *, outOffset=None, outFlipX=False, outFlipY=False):
bbox.shift(self.getRawXYOffset() + shift - outOffset)

getattr(self, f"setRaw{bboxName}BBox")(bbox)

# Update the Readout Corner if we've flipped anything.
outReadoutCorner = self.getReadoutCorner()
if self.getRawFlipX() != outFlipX:
xFlipMapping = {ReadoutCorner.LL: ReadoutCorner.LR, ReadoutCorner.LR: ReadoutCorner.LL,
ReadoutCorner.UR: ReadoutCorner.UL, ReadoutCorner.UL: ReadoutCorner.UR}
outReadoutCorner = xFlipMapping[outReadoutCorner]
if self.getRawFlipY() != outFlipY:
yFlipMapping = {ReadoutCorner.LL: ReadoutCorner.UL, ReadoutCorner.LR: ReadoutCorner.UR,
ReadoutCorner.UR: ReadoutCorner.LR, ReadoutCorner.UL: ReadoutCorner.LL}
outReadoutCorner = yFlipMapping[outReadoutCorner]
if outReadoutCorner != self.getReadoutCorner():
self.setReadoutCorner(outReadoutCorner)

#
# All of these have now been transferred to the amp geometry
#
Expand Down

0 comments on commit 42f2739

Please sign in to comment.