Skip to content

Commit

Permalink
Handle incorrect setting of amp BBoxes when flipping them in assembly
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertLuptonTheGood committed Aug 18, 2017
1 parent 8ecf155 commit d39bc65
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions python/lsst/afw/cameraGeom/assembleImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,19 @@ def makeUpdatedDetector(ccd):

for amp in ampInfoCatalog:
assert amp.getHasRawInfo()
awidth, aheight = amp.getRawBBox().getDimensions()

bbox = amp.getRawBBox()
awidth, aheight = bbox.getDimensions()
#
# Figure out how far flipping the amp LR and/or TB offsets the bboxes
#
boxMin0 = bbox.getMin() # initial position of rawBBox's LLC corner
if amp.getRawFlipX():
bbox.flipLR(awidth)
if amp.getRawFlipY():
bbox.flipTB(aheight)
shift = boxMin0 - bbox.getMin()

for bboxName in ("",
"HorizontalOverscan",
"Data",
Expand All @@ -126,7 +138,7 @@ def makeUpdatedDetector(ccd):
bbox.flipLR(awidth)
if amp.getRawFlipY():
bbox.flipTB(aheight)
bbox.shift(amp.getRawXYOffset())
bbox.shift(amp.getRawXYOffset() + shift)

getattr(amp, "setRaw%sBBox" % bboxName)(bbox)
#
Expand Down

0 comments on commit d39bc65

Please sign in to comment.