MeasureDefectsTask#

class lsst.cp.pipe.MeasureDefectsTask(*, config: PipelineTaskConfig | None = None, log: logging.Logger | LsstLogAdapter | None = None, initInputs: dict[str, Any] | None = None, **kwargs: Any)#

Bases: PipelineTask

Measure the defects from one exposure.

Methods Summary

debugHistogram(stepname, ampImage, ...)

Make a histogram of the distribution of pixel values for each amp.

debugView(stepname, ampImage, defects, detector)

Plot the defects found by the task.

dilateSaturatedColumns(exp, defects)

Dilate saturated columns by a configurable amount.

getVampirePixels(ampImg)

Find vampire pixels (bright pixels in flats) and get footprint of extended area around them,

maskBadColumns(exp, defects)

Mask full amplifier columns if they are sufficiently bad.

maskBlocksIfIntermitentBadPixelsInColumn(defects)

Mask blocks in a column if there are on-and-off bad pixels

run(inputExp, camera)

Measure one exposure for defects.

Methods Documentation

debugHistogram(stepname, ampImage, nSigmaUsed, exp)#

Make a histogram of the distribution of pixel values for each amp.

The main image data histogram is plotted in blue. Edge pixels, if masked, are in red. Note that masked edge pixels do not contribute to the underflow and overflow numbers.

Note that this currently only supports the 16-amp LSST detectors.

Parameters#

stepnamestr

Debug frame to request.

ampImagelsst.afw.image.MaskedImage

Amplifier image to display.

nSigmaUsedfloat

The number of sigma used for detection

explsst.afw.image.exposure.Exposure

The exposure in which the defects were found.

debugView(stepname, ampImage, defects, detector)#

Plot the defects found by the task.

Parameters#

stepnamestr

Debug frame to request.

ampImagelsst.afw.image.MaskedImage

Amplifier image to display.

defectslsst.ip.isr.Defects

The defects to plot.

detectorlsst.afw.cameraGeom.Detector

Detector holding camera geometry.

dilateSaturatedColumns(exp, defects)#

Dilate saturated columns by a configurable amount.

Parameters#

explsst.afw.image.exposure.Exposure

The exposure in which to find defects.

defectslsst.ip.isr.Defects

The defects found in the image so far

Returns#

defectslsst.ip.isr.Defects

The expanded defects.

getVampirePixels(ampImg)#

Find vampire pixels (bright pixels in flats) and get footprint of extended area around them,

Parameters#

ampImglsst.afw.image._maskedImage.MaskedImageF

The amplifier masked image to do the vampire pixels search on.

Returns#

fs_growlsst.afw.detection._detection.FootprintSet

The footprint set of areas around vampire pixels in the amplifier.

maskBadColumns(exp, defects)#

Mask full amplifier columns if they are sufficiently bad.

Parameters#

defectslsst.ip.isr.Defects

The defects found in the image so far

Returns#

explsst.afw.image.exposure.Exposure

The exposure in which to find defects.

defectslsst.ip.isr.Defects

If the number of bad pixels in a column is not larger or equal than self.config.badPixelColumnThreshold, the input list is returned. Otherwise, the defects list returned will include boxes that mask blocks of on-and-of pixels.

badColumnCountint

Number of bad columns masked.

maskBlocksIfIntermitentBadPixelsInColumn(defects)#

Mask blocks in a column if there are on-and-off bad pixels

If there’s a column with on and off bad pixels, mask all the pixels in between, except if there is a large enough gap of consecutive good pixels between two bad pixels in the column.

Parameters#

defectslsst.ip.isr.Defects

The defects found in the image so far

Returns#

defectslsst.ip.isr.Defects

If the number of bad pixels in a column is not larger or equal than self.config.badPixelColumnThreshold, the input list is returned. Otherwise, the defects list returned will include boxes that mask blocks of on-and-of pixels.

badColumnCountint

Number of bad columns partially masked.

run(inputExp, camera)#

Measure one exposure for defects.

Parameters#

inputExplsst.afw.image.Exposure

Exposure to examine.

cameralsst.afw.cameraGeom.Camera

Camera to use for metadata.

Returns#

resultslsst.pipe.base.Struct

Results struct containing:

outputDefects

The defects measured from this exposure (lsst.ip.isr.Defects).