maskDECamEdgeBleed#

lsst.ip.isr.maskDECamEdgeBleed(exposure, satMinArea=10000, approachRows=20, nSigma=5.0, nRowsCheck=20, nRowsCheckShort=5, minUsablePixelsPerRow=30, minLowFraction=0.03, minLowFractionExtent=0.01, minBlockedRows=5, marginFraction=0.125, saturatedMaskName='SAT', log=None)#

Mask DECam-style edge bleeds with low rows next to the read register.

For each amplifier that contains a large saturated footprint reaching within approachRows of its read edge, this function identifies a dip using the per-row fraction of usable pixels more than nSigma below the clipped sky, measures how far the dip extends inward, and marks those rows (plus a margin) with the saturation mask plane.

Rows next to the read edge that are unusable are the signature of a drained serial register, which the overscan correction flags as bad; minBlockedRows rows are also flagged, despite not having a dip measurement.

Parameters#

exposurelsst.afw.image.Exposure

Assembled exposure to mask.

satMinAreaint, optional

Minimum area (pixels) of a saturated footprint to be considered.

approachRowsint, optional

A saturated footprint must come within this many rows of the read edge to trigger the edge bleed check.

nSigmafloat, optional

A pixel is “low” if it is more than this many sigma below sky.

nRowsCheckint, optional

Number of rows from the read edge to check for an edge bleed dip.

nRowsCheckShortint, optional

A second, shorter window from the read edge to check for a short edge bleed dip.

minUsablePixelsPerRowint, optional

Minimum number of pixels not saturated, bad or missing to search for dips. Rows with fewer pixels may be “blocked” due to a drained register.

minLowFractionfloat, optional

Mean fraction of usable pixels that are low, over either nRowsCheck or nRowsCheckShort, to confirm a dip.

minLowFractionExtentfloat, optional

Fraction of usable pixels that are low that each row must exceed to count toward the bleed height; the scan stops after five consecutive rows that do not. Should not exceed minLowFraction.

minBlockedRowsint, optional

Minimum number of blocked rows beyond the normal border at the read edge to be masked if found.

marginFractionfloat, optional

Extra rows masked beyond the measured height, as a fraction of that height (plus one row).

saturatedMaskNamestr, optional

Mask plane name for saturation.

loglogging.Logger, optional

Logger to handle messages.

Raises#

RuntimeError

Raised if the exposure has no detector with amplifiers.