DynamicDetectionConfig#

class lsst.meas.algorithms.DynamicDetectionConfig(*args, **kw)#

Bases: SourceDetectionConfig

Configuration for DynamicDetectionTask

Attributes Summary

adjustBackground

Fiddle factor to add to the background; debugging only (float, default 0.0)

allowMaskErode

Crowded/large fill-factor fields make it difficult to find suitable locations to lay down sky objects.

background

Background re-estimation; ignored if reEstimateBackground false (ConfigurableInstance, default <class 'lsst.meas.algorithms.subtractBackground.SubtractBackgroundConfig'>)

bisectFactor

Factor by which to increase thresholds in brightMaskFractionMax loop.

brightGrowFactor

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

Maximum allowed fraction of masked pixes from the "bright" detection stage (to mask regions unsuitable for sky sourcess).

brightMultiplier

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

brightNegFactor

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

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

doApplyFlatBackgroundRatio

Convert from a photometrically flat image to one suitable for background subtraction? Only used if reEstimateBackground is True.If True, then a backgroundToPhotometricRatio must be supplied to the task run method.

doBackgroundTweak

Tweak background level so median PSF flux of sky objects is zero? (bool, default True)

doBrightPrelimDetection

Do initial bright detection pass where footprints are grown by brightGrowFactor? (bool, default True)

doTempLocalBackground

Enable temporary local background subtraction? (see tempLocalBackground) (bool, default True)

doTempWideBackground

Do temporary wide (large-scale) background subtraction before footprint detection? (bool, default False)

doThresholdScaling

Scale the threshold level to get empirically measured S/N requested? (bool, default True)

excludeMaskPlanes

Mask planes to exclude when detecting sources.

includeThresholdMultiplier

Multiplier on thresholdValue for whether a source is included in the output catalog.

isotropicGrow

Grow pixels as isotropically as possible? If False, use a Manhattan metric instead.

maxBackgroundTweak

Maximum background tweak allowed (i.e. it will be set to this if the computed value is greater than it).

maxPeakToFootRatio

Maximum ratio of peak per footprint in the detection mask.

maxThresholdScaleFactor

Maximum threshold scaling allowed (i.e. it will be set to this if the computed value is greater than it).

minBackgroundTweak

Mininum background tweak allowed (i.e. it will be set to this if the computed value is smaller than it).

minFractionSources

Minimum fraction of the requested number of sky sources for dynamic detection to be considered a success.

minGoodPixelFraction

Minimum fraction of 'good' pixels required to be deemed worthwhile for an attempt at further processing.

minPixels

detected sources with fewer than the specified number of pixels will be ignored (int, default 1)

minThresholdScaleFactor

Mininum threshold scaling allowed (i.e. it will be set to this if the computed value is smaller than it).

nPeaksMaxSimple

The maximum number of peaks in a Footprint before trying to replace its peaks using the temporary local background (int, default 1)

nSigmaForKernel

Multiple of PSF RMS size to use for convolution kernel bounding box size; note that this is not a half-size.

nSigmaToGrow

Grow detections by nSigmaToGrow * [PSF RMS width]; if 0 then do not grow (float, default 2.4)

prelimNegMultiplier

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

prelimThresholdFactor

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

reEstimateBackground

Estimate the background again after final source detection? (bool, default True)

returnOriginalFootprints

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

skyObjects

Generate sky objects.

statsMask

Mask planes to ignore when calculating statistics of image (for thresholdType=stdev) (List, default ['BAD', 'SAT', 'EDGE', 'NO_DATA'])

tempLocalBackground

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

A wide (large-scale) background estimation and removal before footprint and peak detection.

thresholdPolarity

Specifies whether to detect positive, or negative sources, or both.

thresholdType

Specifies the meaning of thresholdValue.

thresholdValue

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

Methods Summary

setDefaults()

Subclass hook for computing defaults.

validate()

Validate the Config, raising an exception if invalid.

Attributes Documentation

adjustBackground#

Fiddle factor to add to the background; debugging only (float, default 0.0)

allowMaskErode#

Crowded/large fill-factor fields make it difficult to find suitable locations to lay down sky objects. To allow for best effort sky source placement, if True, this allows for a slight erosion of the detection masks. (bool, default True)

background#

Background re-estimation; ignored if reEstimateBackground false (ConfigurableInstance, default <class 'lsst.meas.algorithms.subtractBackground.SubtractBackgroundConfig'>)

bisectFactor#

Factor by which to increase thresholds in brightMaskFractionMax loop. (float, default 1.2)

brightGrowFactor#

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). (int, default 40)

brightMaskFractionMax#

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. (float, default 0.95)

brightMultiplier#

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

brightNegFactor#

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). (float, default 2.2)

combinedGrow#

Grow all footprints at the same time? This allows disconnected footprints to merge. (bool, default True)

doApplyFlatBackgroundRatio#

Convert from a photometrically flat image to one suitable for background subtraction? Only used if reEstimateBackground is True.If True, then a backgroundToPhotometricRatio must be supplied to the task run method. (bool, default False)

doBackgroundTweak#

Tweak background level so median PSF flux of sky objects is zero? (bool, default True)

doBrightPrelimDetection#

Do initial bright detection pass where footprints are grown by brightGrowFactor? (bool, default True)

doTempLocalBackground#

Enable temporary local background subtraction? (see tempLocalBackground) (bool, default True)

doTempWideBackground#

Do temporary wide (large-scale) background subtraction before footprint detection? (bool, default False)

doThresholdScaling#

Scale the threshold level to get empirically measured S/N requested? (bool, default True)

excludeMaskPlanes#

Mask planes to exclude when detecting sources. (List, default [])

includeThresholdMultiplier#

Multiplier on thresholdValue for whether a source is included in the output catalog. For example, thresholdValue=5, includeThresholdMultiplier=10, thresholdType=’pixel_stdev’ results in a catalog of sources at >50 sigma with the detection mask and footprints including pixels >5 sigma. (float, default 1.0)

Valid Range = [0.0,inf)

isotropicGrow#

Grow pixels as isotropically as possible? If False, use a Manhattan metric instead. (bool, default True)

maxBackgroundTweak#

Maximum background tweak allowed (i.e. it will be set to this if the computed value is greater than it). Set to None for no limit. (float, default 100.0)

maxPeakToFootRatio#

Maximum ratio of peak per footprint in the detection mask. This is to help prevent single contiguous footprints that nothing can be done with (i.e. deblending will be skipped). If the current detection plane does not satisfy this constraint, the detection threshold is increased iteratively until it is. This behaviour is intended to be an effective no-op for most “typical” scenes/standard quality observations, but can avoid total meltdown in, e.g. very crowded regions. (float, default 150.0)

maxThresholdScaleFactor#

Maximum threshold scaling allowed (i.e. it will be set to this if the computed value is greater than it). Set to None for no limit. (float, default 10.0)

minBackgroundTweak#

Mininum background tweak allowed (i.e. it will be set to this if the computed value is smaller than it). Set to None for no limit. (float, default -100.0)

minFractionSources#

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, an InsufficientSourcesError error is raised so that this dataId is no longer considered in downstream processing. (float, default 0.02)

minGoodPixelFraction#

Minimum fraction of ‘good’ pixels required to be deemed worthwhile for an attempt at further processing. (float, default 0.005)

minPixels#

detected sources with fewer than the specified number of pixels will be ignored (int, default 1)

Valid Range = [0,inf)

minThresholdScaleFactor#

Mininum threshold scaling allowed (i.e. it will be set to this if the computed value is smaller than it). Set to None for no limit. (float, default 0.1)

nPeaksMaxSimple#

The maximum number of peaks in a Footprint before trying to replace its peaks using the temporary local background (int, default 1)

nSigmaForKernel#

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 (float, default 7.0)

nSigmaToGrow#

Grow detections by nSigmaToGrow * [PSF RMS width]; if 0 then do not grow (float, default 2.4)

prelimNegMultiplier#

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

prelimThresholdFactor#

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

reEstimateBackground#

Estimate the background again after final source detection? (bool, default True)

returnOriginalFootprints#

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

skyObjects#

Generate sky objects. (ConfigurableInstance, default <class 'lsst.meas.algorithms.skyObjects.SkyObjectsConfig'>)

statsMask#

Mask planes to ignore when calculating statistics of image (for thresholdType=stdev) (List, default ['BAD', 'SAT', 'EDGE', 'NO_DATA'])

tempLocalBackground#

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. (ConfigurableInstance, default <class 'lsst.meas.algorithms.subtractBackground.SubtractBackgroundConfig'>)

tempWideBackground#

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. (ConfigurableInstance, default <class 'lsst.meas.algorithms.subtractBackground.SubtractBackgroundConfig'>)

thresholdPolarity#

Specifies whether to detect positive, or negative sources, or both. (str, default 'positive')

Allowed values:

'positive'

detect only positive sources

'negative'

detect only negative sources

'both'

detect both positive and negative sources

thresholdType#

Specifies the meaning of thresholdValue. (str, default 'pixel_stdev')

Allowed values:

'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

thresholdValue#

Threshold for detecting footprints; exact meaning and units depend on thresholdType. (float, default 5.0)

Valid Range = [0.0,inf)

Methods Documentation

setDefaults()#

Subclass hook for computing defaults.

Notes#

Derived Config classes that must compute defaults rather than using the Field instances’s defaults should do so here. To correctly use inherited defaults, implementations of setDefaults must call their base class’s setDefaults.

validate()#

Validate the Config, raising an exception if invalid.

Raises#

lsst.pex.config.FieldValidationError

Raised if verification fails.

Notes#

The base class implementation performs type checks on all fields by calling their validate methods.

Complex single-field validation can be defined by deriving new Field types. For convenience, some derived lsst.pex.config.Field-types (ConfigField and ConfigChoiceField) are defined in lsst.pex.config that handle recursing into subconfigs.

Inter-field relationships should only be checked in derived Config classes after calling this method, and base validation is complete.