lsst.meas.algorithms  14.0-10-g59393990+1
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.meas.algorithms.dynamicDetection.DynamicDetectionTask Class Reference
Inheritance diagram for lsst.meas.algorithms.dynamicDetection.DynamicDetectionTask:

Public Member Functions

def __init__ (self, args, kwargs)
 
def calculateThreshold (self, exposure, seed, sigma=None)
 
def detectFootprints (self, exposure, doSmooth=True, sigma=None, clearMask=True, expId=None)
 

Public Attributes

 skySchema
 
 skyMeasurement
 

Static Public Attributes

 ConfigClass = DynamicDetectionConfig
 

Detailed Description

Detection of sources on an image with a dynamic threshold

We first detect sources using a lower threshold than normal (see config
parameter ``prelimThresholdFactor``) in order to identify good sky regions
(configurable ``skyObjects``). Then we perform forced PSF photometry on
those sky regions. Using those PSF flux measurements and estimated errors,
we set the threshold so that the stdev of the measurements matches the
median estimated error.

Definition at line 25 of file dynamicDetection.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.meas.algorithms.dynamicDetection.DynamicDetectionTask.__init__ (   self,
  args,
  kwargs 
)
Constructor

Besides the usual initialisation of configurables, we also set up
the forced measurement which is deliberately not represented in
this Task's configuration parameters because we're using it as part
of the algorithm and we don't want to allow it to be modified.

Definition at line 38 of file dynamicDetection.py.

Member Function Documentation

◆ calculateThreshold()

def lsst.meas.algorithms.dynamicDetection.DynamicDetectionTask.calculateThreshold (   self,
  exposure,
  seed,
  sigma = None 
)
Calculate new threshold

This is the main functional addition to the vanilla
`SourceDetectionTask`.

We identify sky objects and perform forced PSF photometry on
them. Using those PSF flux measurements and estimated errors,
we set the threshold so that the stdev of the measurements
matches the median estimated error.

Parameters
----------
exposure : `lsst.afw.image.Exposure`
    Exposure on which we're detecting sources.
seed : `int`
    RNG seed to use for finding sky objects.
sigma : `float`, optional
    Gaussian sigma of smoothing kernel; if not provided,
    will be deduced from the exposure's PSF.

Returns
-------
factor : `float`
    Multiplication factor to be applied to the configured detection
    threshold.

Definition at line 60 of file dynamicDetection.py.

◆ detectFootprints()

def lsst.meas.algorithms.dynamicDetection.DynamicDetectionTask.detectFootprints (   self,
  exposure,
  doSmooth = True,
  sigma = None,
  clearMask = True,
  expId = None 
)
Detect footprints with a dynamic threshold

This varies from the vanilla ``detectFootprints`` method because we
do detection twice: one with a low threshold so that we can find
sky uncontaminated by objects, then one more with the new calculated
threshold.

Parameters
----------
exposure : `lsst.afw.image.Exposure`
    Exposure to process; DETECTED{,_NEGATIVE} mask plane will be
    set in-place.
doSmooth : `bool`, optional
    If True, smooth the image before detection using a Gaussian
    of width ``sigma``.
sigma : `float`, optional
    Gaussian Sigma of PSF (pixels); used for smoothing and to grow
    detections; if `None` then measure the sigma of the PSF of the
    ``exposure``.
clearMask : `bool`, optional
    Clear both DETECTED and DETECTED_NEGATIVE planes before running
    detection.
expId : `int`, optional
    Exposure identifier, used as a seed for the random number
    generator. If absent, the seed will be the sum of the image.

Return Struct contents
----------------------
positive : `lsst.afw.detection.FootprintSet`
    Positive polarity footprints (may be `None`)
negative : `lsst.afw.detection.FootprintSet`
    Negative polarity footprints (may be `None`)
numPos : `int`
    Number of footprints in positive or 0 if detection polarity was
    negative.
numNeg : `int`
    Number of footprints in negative or 0 if detection polarity was
    positive.
background : `lsst.afw.math.BackgroundMI`
    Re-estimated background.  `None` if
    ``reEstimateBackground==False``.
factor : `float`
    Multiplication factor applied to the configured detection
    threshold.

Definition at line 113 of file dynamicDetection.py.

Member Data Documentation

◆ ConfigClass

lsst.meas.algorithms.dynamicDetection.DynamicDetectionTask.ConfigClass = DynamicDetectionConfig
static

Definition at line 35 of file dynamicDetection.py.

◆ skyMeasurement

lsst.meas.algorithms.dynamicDetection.DynamicDetectionTask.skyMeasurement

Definition at line 57 of file dynamicDetection.py.

◆ skySchema

lsst.meas.algorithms.dynamicDetection.DynamicDetectionTask.skySchema

Definition at line 56 of file dynamicDetection.py.


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