Skip to content

Commit

Permalink
Fix protections against double-mask-growth.
Browse files Browse the repository at this point in the history
  • Loading branch information
erykoff committed Sep 11, 2024
1 parent 183ea51 commit d81d96c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/lsst/ip/isr/overscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,12 @@ def correctOverscan(self, exposure, amp, imageBBox, overscanBBox,
)
else:
median = np.ma.median(np.ma.masked_where(overscanMask, overscanArray))
bad = np.where(np.abs(overscanArray - median) > self.config.maxDeviation)
bad = np.where((np.abs(overscanArray - median) > self.config.maxDeviation) & (~overscanMask))
# Mark the bad pixels as BAD.
overscanImage.mask.array[bad] = overscanImage.mask.getPlaneBitMask("BAD")

# Check for completely masked row/column.
if maskedRowColumnGrowSize > 0:
if maskedRowColumnGrowSize > 0 and len(bad) > 0:
if isTransposed:
axis = 0
nComp = overscanArray.shape[0]
Expand Down
1 change: 1 addition & 0 deletions tests/test_overscanCorrection.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ def test_bleedParallelOverscanCorrection(self):

configParallel = ipIsr.overscan.ParallelOverscanCorrectionTask.ConfigClass()
configParallel.parallelOverscanMaskGrowSize = 1
configParallel.parallelOverscanMaskedColumnGrowSize = 0
configParallel.fitType = fitType

parallelOverscanTask = ipIsr.overscan.ParallelOverscanCorrectionTask(
Expand Down

0 comments on commit d81d96c

Please sign in to comment.