Skip to content

Commit

Permalink
crosstalk: robustify subtractXTalk
Browse files Browse the repository at this point in the history
If an exception is raised in the (large) 'try' block, the 'msk'
variable referred to in the 'finally' may be undefined. Define it
earlier.
  • Loading branch information
PaulPrice committed Oct 18, 2016
1 parent 0ef1cd8 commit 0103056
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/lsst/obs/subaru/crosstalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ def subtractXTalk(mi, coeffs, minPixelToMask=45000, crosstalkStr="CROSSTALK"):
# the ones that we label as causing crosstalk; in reality all pixels cause crosstalk)
#
tempStr = "TEMP" # mask plane used to record the bright pixels that we need to mask
mi.getMask().addMaskPlane(tempStr)
msk = mi.getMask()
msk.addMaskPlane(tempStr)
try:
fs = afwDetect.FootprintSet(mi, afwDetect.Threshold(minPixelToMask), tempStr)

Expand Down

0 comments on commit 0103056

Please sign in to comment.