lsst.cp.pipe  20.0.0-1-g32a200e+6
Public Member Functions | Static Public Attributes | List of all members
lsst.cp.pipe.defects.FindDefectsTask Class Reference
Inheritance diagram for lsst.cp.pipe.defects.FindDefectsTask:

Public Member Functions

def __init__ (self, *args, **kwargs)
 
def runDataRef (self, dataRef, visitList)
 
def findHotAndColdPixels (self, exp, imageType, setMask=False)
 
def maskBlocksIfIntermitentBadPixelsInColumn (self, defects)
 

Static Public Attributes

 RunnerClass = SingleVisitListTaskRunner
 
 ConfigClass = FindDefectsTaskConfig
 

Detailed Description

Task for finding defects in sensors.

The task has two modes of operation, defect finding in raws and in
master calibrations, which work as follows.

Master calib defect finding
----------------------------

A single visit number is supplied, for which the corresponding flat & dark
will be used. This is because, at present at least, there is no way to pass
a calibration exposure ID from the command line to a command line task.

The task retrieves the corresponding dark and flat exposures for the
supplied visit. If a flat is available the task will (be able to) look
for both bright and dark defects. If only a dark is found then only bright
defects will be sought.

All pixels above/below the specified nSigma which lie with the specified
borders for flats/darks are identified as defects.

Raw visit defect finding
------------------------

A list of exposure IDs are supplied for defect finding. The task will
detect bright pixels in the dark frames, if supplied, and bright & dark
pixels in the flats, if supplied, i.e. if you only supply darks you will
only be given bright defects. This is done automatically from the imageType
of the exposure, so the input exposure list can be a mix.

As with the master calib detection, all pixels above/below the specified
nSigma which lie with the specified borders for flats/darks are identified
as defects. Then, a post-processing step is done to merge these detections,
with pixels appearing in a fraction [0..1] of the images are kept as defects
and those appearing below that occurrence-threshold are discarded.

Definition at line 214 of file defects.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.cp.pipe.defects.FindDefectsTask.__init__ (   self,
args,
**  kwargs 
)

Definition at line 255 of file defects.py.

Member Function Documentation

◆ findHotAndColdPixels()

def lsst.cp.pipe.defects.FindDefectsTask.findHotAndColdPixels (   self,
  exp,
  imageType,
  setMask = False 
)
Find hot and cold pixels in an image.

Using config-defined thresholds on a per-amp basis, mask pixels
that are nSigma above threshold in dark frames (hot pixels),
or nSigma away from the clipped mean in flats (hot & cold pixels).

Parameters
----------
exp : `lsst.afw.image.exposure.Exposure`
    The exposure in which to find defects.
imageType : `str`
    The image type, either 'dark' or 'flat'.
setMask : `bool`
    If true, update exp with hot and cold pixels.
    hot: DETECTED
    cold: DETECTED_NEGATIVE

Returns
-------
defects : `lsst.meas.algorithms.Defect`
    The defects found in the image.

Definition at line 567 of file defects.py.

◆ maskBlocksIfIntermitentBadPixelsInColumn()

def lsst.cp.pipe.defects.FindDefectsTask.maskBlocksIfIntermitentBadPixelsInColumn (   self,
  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.meas.algorithms.Defect`
    The defects found in the image so far

Returns
------
defects: `lsst.meas.algorithms.Defect`
    If the number of bad pixels in a column is not larger or equal than
    self.config.badPixelColumnThreshold, the iput list is returned. Otherwise,
    the defects list returned will include boxes that mask blocks of on-and-of
    pixels.

Definition at line 643 of file defects.py.

◆ runDataRef()

def lsst.cp.pipe.defects.FindDefectsTask.runDataRef (   self,
  dataRef,
  visitList 
)
Run the defect finding task.

Find the defects, as described in the main task docstring, from a
dataRef and a list of visit(s).

Parameters
----------
dataRef : `lsst.daf.persistence.ButlerDataRef`
    dataRef for the detector for the visits to be fit.
visitList : `list` [`int`]
    List of visits to be processed. If config.mode == 'VISITS' then the
    list of visits is used. If config.mode == 'MASTER' then the length
    of visitList must be one, and the corresponding master calibrations
    are used.

Returns
-------
result : `lsst.pipe.base.Struct`
    Result struct with Components:

    - ``defects`` : `lsst.meas.algorithms.Defect`
      The defects found by the task.
    - ``exitStatus`` : `int`
      The exit code.

Definition at line 280 of file defects.py.

Member Data Documentation

◆ ConfigClass

lsst.cp.pipe.defects.FindDefectsTask.ConfigClass = FindDefectsTaskConfig
static

Definition at line 252 of file defects.py.

◆ RunnerClass

lsst.cp.pipe.defects.FindDefectsTask.RunnerClass = SingleVisitListTaskRunner
static

Definition at line 251 of file defects.py.


The documentation for this class was generated from the following file: