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:
PipelineTaskMeasure 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.
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#
- stepname
str Debug frame to request.
- ampImage
lsst.afw.image.MaskedImage Amplifier image to display.
- nSigmaUsed
float The number of sigma used for detection
- exp
lsst.afw.image.exposure.Exposure The exposure in which the defects were found.
- stepname
- debugView(stepname, ampImage, defects, detector)#
Plot the defects found by the task.
Parameters#
- stepname
str Debug frame to request.
- ampImage
lsst.afw.image.MaskedImage Amplifier image to display.
- defects
lsst.ip.isr.Defects The defects to plot.
- detector
lsst.afw.cameraGeom.Detector Detector holding camera geometry.
- stepname
- dilateSaturatedColumns(exp, defects)#
Dilate saturated columns by a configurable amount.
Parameters#
- exp
lsst.afw.image.exposure.Exposure The exposure in which to find defects.
- defects
lsst.ip.isr.Defects The defects found in the image so far
Returns#
- defects
lsst.ip.isr.Defects The expanded defects.
- exp
- getVampirePixels(ampImg)#
Find vampire pixels (bright pixels in flats) and get footprint of extended area around them,
Parameters#
- ampImg
lsst.afw.image._maskedImage.MaskedImageF The amplifier masked image to do the vampire pixels search on.
Returns#
- fs_grow
lsst.afw.detection._detection.FootprintSet The footprint set of areas around vampire pixels in the amplifier.
- ampImg
- maskBadColumns(exp, defects)#
Mask full amplifier columns if they are sufficiently bad.
Parameters#
- defects
lsst.ip.isr.Defects The defects found in the image so far
Returns#
- exp
lsst.afw.image.exposure.Exposure The exposure in which to find defects.
- defects
lsst.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.
- badColumnCount
int Number of bad columns masked.
- defects
- 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#
- defects
lsst.ip.isr.Defects The defects found in the image so far
Returns#
- defects
lsst.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.
- badColumnCount
int Number of bad columns partially masked.
- defects
- run(inputExp, camera)#
Measure one exposure for defects.
Parameters#
- inputExp
lsst.afw.image.Exposure Exposure to examine.
- camera
lsst.afw.cameraGeom.Camera Camera to use for metadata.
Returns#
- results
lsst.pipe.base.Struct Results struct containing:
outputDefectsThe defects measured from this exposure (
lsst.ip.isr.Defects).
- inputExp