DynamicDetectionTask

DynamicDetectionTask detects sources on an image with a dynamic threshold.

Processing summary

DynamicDetectionTask runs this sequence of operations:

  1. Detects sources using a lower threshold than normal in order to identify good sky regions.

  2. Performs forced PSF photometry on identified sky regions.

  3. Sets threshold so that the standard deviation of measurements matches median estimated error using PSF flux measurements and estimated errors.

Python API summary

from lsst.meas.algorithms.dynamicDetection import DynamicDetectionTask
classDynamicDetectionTask(*args, **kwargs)

Detection of sources on an image with a dynamic threshold...

attributeconfig

Access configuration fields and retargetable subtasks.

methodrun(table, exposure, doSmooth=True, sigma=None, clearMask=True, expId=None, background=None)

Detect sources and return catalog(s) of detections...

See also

See the DynamicDetectionTask API reference for complete details.

Retargetable subtasks

background

Default

lsst.meas.algorithms.subtractBackground.SubtractBackgroundTask

Field type

ConfigurableField

Background re-estimation; ignored if reEstimateBackground false

skyObjects

Default

lsst.meas.algorithms.skyObjects.SkyObjectsTask

Field type

ConfigurableField

Generate sky objects.

tempLocalBackground

Default

lsst.meas.algorithms.subtractBackground.SubtractBackgroundTask

Field type

ConfigurableField

A local (small-scale), temporary background estimation step run between detecting above-threshold regions and detecting the peaks within them; used to avoid detecting spuerious peaks in the wings.

tempWideBackground

Default

lsst.meas.algorithms.subtractBackground.SubtractBackgroundTask

Field type

ConfigurableField

A wide (large-scale) background estimation and removal before footprint and peak detection. It is added back into the image after detection. The purpose is to suppress very large footprints (e.g., from large artifacts) that the deblender may choke on.

Configuration fields

adjustBackground

Default
0.0
Field type

float Field

Fiddle factor to add to the background; debugging only

bisectFactor

Default
1.2
Field type

float Field

Factor by which to increase thresholds in brightMaskFractionMax loop.

brightGrowFactor

Default
40
Field type

int Field

Factor by which to grow the footprints of sources detected in the “bright” detections stage (want this to be large to mask wings of bright sources).

brightMaskFractionMax

Default
0.95
Field type

float Field

Maximum allowed fraction of masked pixes from the “bright” detection stage (to mask regions unsuitable for sky sourcess). If this fraction is exeeded, the detection threshold for this stage will be increased by bisectFactor until the fraction of masked pixels drops below this threshold.

brightMultiplier

Default
2000.0
Field type

float Field

Multiplier to apply to the prelimThresholdFactor for the “bright” detections stage (want this to be large to only detect the brightest sources).

brightNegFactor

Default
2.2
Field type

float Field

Factor by which to multiply the threshold for the negative polatiry detections for the “bright” detections stage (this needs to be fairly low given the nature of the negative polarity detections in the very large positive polarity threshold).

combinedGrow

Default
True
Field type

bool Field

Grow all footprints at the same time? This allows disconnected footprints to merge.

doBackgroundTweak

Default
True
Field type

bool Field

Tweak background level so median PSF flux of sky objects is zero?

doBrightPrelimDetection

Default
True
Field type

bool Field

Do initial bright detection pass where footprints are grown by brightGrowFactor?

doTempLocalBackground

Default
True
Field type

bool Field

Enable temporary local background subtraction? (see tempLocalBackground)

doTempWideBackground

Default
False
Field type

bool Field

Do temporary wide (large-scale) background subtraction before footprint detection?

excludeMaskPlanes

Default
[]
Field type

str ListField

Mask planes to exclude when detecting sources.

includeThresholdMultiplier

Default
1.0
Field type

float RangeField

Range

[0.0,inf)

Include threshold relative to thresholdValue

isotropicGrow

Default
False
Field type

bool Field

Pixels should be grown as isotropically as possible (slower)

minFractionSources

Default
0.02
Field type

float Field

Minimum fraction of the requested number of sky sources for dynamic detection to be considered a success. If the number of good sky sources identified falls below this threshold, a NoWorkFound error is raised so that this dataId is no longer considered in downstream processing.

minPixels

Default
1
Field type

int RangeField

Range

[0,inf)

detected sources with fewer than the specified number of pixels will be ignored

nPeaksMaxSimple

Default
1
Field type

int Field

The maximum number of peaks in a Footprint before trying to replace its peaks using the temporary local background

nSigmaForKernel

Default
7.0
Field type

float Field

Multiple of PSF RMS size to use for convolution kernel bounding box size; note that this is not a half-size. The size will be rounded up to the nearest odd integer

nSigmaToGrow

Default
2.4
Field type

float Field

Grow detections by nSigmaToGrow * [PSF RMS width]; if 0 then do not grow

prelimNegMultiplier

Default
2.5
Field type

float Field

Multiplier for the negative (relative to positive) polarity detections threshold to use for first pass (to find sky objects).

prelimThresholdFactor

Default
0.5
Field type

float Field

Factor by which to multiply the main detection threshold (thresholdValue) to use for first pass (to find sky objects).

reEstimateBackground

Default
True
Field type

bool Field

Estimate the background again after final source detection?

returnOriginalFootprints

Default
False
Field type

bool Field

Grow detections to set the image mask bits, but return the original (not-grown) footprints

statsMask

Default
['BAD', 'SAT', 'EDGE', 'NO_DATA']
Field type

str ListField

Mask planes to ignore when calculating statistics of image (for thresholdType=stdev)

thresholdPolarity

Default
'positive'
Field type

str ChoiceField

Choices
'positive'

detect only positive sources

'negative'

detect only negative sources

'both'

detect both positive and negative sources

specifies whether to detect positive, or negative sources, or both

thresholdType

Default
'stdev'
Field type

str ChoiceField

Choices
'variance'

threshold applied to image variance

'stdev'

threshold applied to image std deviation

'value'

threshold applied to image value

'pixel_stdev'

threshold applied to per-pixel std deviation

specifies the desired flavor of Threshold

thresholdValue

Default
5.0
Field type

float RangeField

Range

[0.0,inf)

Threshold for footprints; exact meaning and units depend on thresholdType.