Skip to content

Commit

Permalink
Mask edges when doBrighterFatter=True.
Browse files Browse the repository at this point in the history
The edges of amplifiers that have had the brighter-fatter correction
applied may not have had the appropriate correction applied.  To
reflect this fact, ensure that the number of edge pixels matching the
convolution boundary (1/2 the kernel size) are masked with the EDGE
bit, using the maskEdges method.

Docstring clarification.
  • Loading branch information
czwa committed Aug 5, 2019
1 parent 5c12f8e commit a35b660
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions python/lsst/ip/isr/isrTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,16 @@ def run(self, ccdExposure, camera=None, bias=None, linearizer=None, crosstalkSou
bfCorr -= interpExp.getMaskedImage().getImage()
image += bfCorr

# Applying the brighter-fatter correction applies a
# convolution to the science image. At the edges this
# convolution may not have sufficient valid pixels to
# produce a valid correction. Mark pixels within the size
# of the brighter-fatter kernel as EDGE to warn of this
# fact.
self.maskEdges(ccdExposure, numEdgePixels=numpy.max(bfKernel.shape) // 2,
maskPlane="EDGE")
self.log.warn("Ensuring image edges are masked as SUSPECT to the brighter-fatter kernel size.")

self.debugView(ccdExposure, "doBrighterFatter")

if self.config.doDark:
Expand Down Expand Up @@ -2070,7 +2080,7 @@ def maskDefect(self, exposure, defectBaseList):
Exposure to process.
defectBaseList : `lsst.meas.algorithms.Defects` or `list` of
`lsst.afw.image.DefectBase`.
List of defects to mask and interpolate.
List of defects to mask.
Notes
-----
Expand Down Expand Up @@ -2117,8 +2127,13 @@ def maskAndInterpolateDefects(self, exposure, defectBaseList):
----------
exposure : `lsst.afw.image.Exposure`
Exposure to process.
defectBaseList : `List` of `Defects`
defectBaseList : `lsst.meas.algorithms.Defects` or `list` of
`lsst.afw.image.DefectBase`.
List of defects to mask and interpolate.
See Also
--------
lsst.ip.isr.isrTask.maskDefect()
"""
self.maskDefect(exposure, defectBaseList)
self.maskEdges(exposure, numEdgePixels=self.config.numEdgeSuspect,
Expand Down

0 comments on commit a35b660

Please sign in to comment.