Skip to content

Commit

Permalink
Fixing mask issues
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoSanchez committed Oct 17, 2023
1 parent 7d888a3 commit e4e8c90
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion python/lsst/ip/diffim/subtractImages.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,8 +1087,12 @@ def _interpolateImage(maskedImage, badMaskPlanes, fallbackValue=None):
result: `float`
The number of masked pixels that were replaced.
"""
imgBadMaskPlanes = [
maskPlane for maskPlane in badMaskPlanes if maskPlane in maskedImage.mask.getMaskPlaneDict()

Check failure on line 1091 in python/lsst/ip/diffim/subtractImages.py

View workflow job for this annotation

GitHub Actions / call-workflow / lint

E126

continuation line over-indented for hanging indent
]

Check failure on line 1092 in python/lsst/ip/diffim/subtractImages.py

View workflow job for this annotation

GitHub Actions / call-workflow / lint

E121

continuation line under-indented for hanging indent

image = maskedImage.image.array
badPixels = (maskedImage.mask.array & maskedImage.mask.getPlaneBitMask(badMaskPlanes)) > 0
badPixels = (maskedImage.mask.array & maskedImage.mask.getPlaneBitMask(imgBadMaskPlanes)) > 0
image[badPixels] = np.nan
if fallbackValue is None:
fallbackValue = np.nanmedian(image)
Expand Down
1 change: 0 additions & 1 deletion tests/test_subtractTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,6 @@ def test_fake_mask_plane_propagation(self):
template_fake_masked = (template.mask.array & template.mask.getPlaneBitMask("FAKE")) > 0

config = subtractImages.AlardLuptonSubtractTask.ConfigClass()
config.mode = "convolveTemplate"
task = subtractImages.AlardLuptonSubtractTask(config=config)
subtraction = task.run(template, science, sources)

Expand Down

0 comments on commit e4e8c90

Please sign in to comment.