Skip to content

Commit

Permalink
Merge pull request #212 from lsst/tickets/DM-35008
Browse files Browse the repository at this point in the history
DM-35008: Check whether the mask is present before asking for it
  • Loading branch information
timj committed Jun 1, 2022
2 parents 5b499d1 + d6bafc0 commit 226e1bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/lsst/meas/base/noiseReplacer.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ def __init__(self, config, exposure, footprints, noiseImage=None, exposureId=Non
self.removeplanes = []
bitmasks = []
for maskname in ['THISDET', 'OTHERDET']:
try:
if maskname in mask.getMaskPlaneDict():
# does it already exist?
plane = mask.getMaskPlane(maskname)
if self.log:
self.log.debug('Mask plane "%s" already existed', maskname)
except Exception:
else:
# if not, add it; we should delete it when done.
plane = mask.addMaskPlane(maskname)
self.removeplanes.append(maskname)
Expand Down

0 comments on commit 226e1bc

Please sign in to comment.