DynamicDetectionConfig#
- class lsst.meas.algorithms.DynamicDetectionConfig(*args, **kw)#
Bases:
SourceDetectionConfigConfiguration for DynamicDetectionTask
Attributes Summary
Fiddle factor to add to the background; debugging only (
float, default0.0)Crowded/large fill-factor fields make it difficult to find suitable locations to lay down sky objects.
Background re-estimation; ignored if reEstimateBackground false (
ConfigurableInstance, default<class 'lsst.meas.algorithms.subtractBackground.SubtractBackgroundConfig'>)Factor by which to increase thresholds in brightMaskFractionMax loop.
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).
Maximum allowed fraction of masked pixes from the "bright" detection stage (to mask regions unsuitable for sky sourcess).
Multiplier to apply to the prelimThresholdFactor for the "bright" detections stage (want this to be large to only detect the brightest sources).
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).
Grow all footprints at the same time? This allows disconnected footprints to merge.
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.
Tweak background level so median PSF flux of sky objects is zero? (
bool, defaultTrue)Do initial bright detection pass where footprints are grown by brightGrowFactor? (
bool, defaultTrue)Enable temporary local background subtraction? (see tempLocalBackground) (
bool, defaultTrue)Do temporary wide (large-scale) background subtraction before footprint detection? (
bool, defaultFalse)Scale the threshold level to get empirically measured S/N requested? (
bool, defaultTrue)Mask planes to exclude when detecting sources.
Multiplier on thresholdValue for whether a source is included in the output catalog.
Grow pixels as isotropically as possible? If False, use a Manhattan metric instead.
Maximum background tweak allowed (i.e. it will be set to this if the computed value is greater than it).
Maximum ratio of peak per footprint in the detection mask.
Maximum threshold scaling allowed (i.e. it will be set to this if the computed value is greater than it).
Mininum background tweak allowed (i.e. it will be set to this if the computed value is smaller than it).
Minimum fraction of the requested number of sky sources for dynamic detection to be considered a success.
Minimum fraction of 'good' pixels required to be deemed worthwhile for an attempt at further processing.
detected sources with fewer than the specified number of pixels will be ignored (
int, default1)Mininum threshold scaling allowed (i.e. it will be set to this if the computed value is smaller than it).
The maximum number of peaks in a Footprint before trying to replace its peaks using the temporary local background (
int, default1)Multiple of PSF RMS size to use for convolution kernel bounding box size; note that this is not a half-size.
Grow detections by nSigmaToGrow * [PSF RMS width]; if 0 then do not grow (
float, default2.4)Multiplier for the negative (relative to positive) polarity detections threshold to use for first pass (to find sky objects).
Factor by which to multiply the main detection threshold (thresholdValue) to use for first pass (to find sky objects).
Estimate the background again after final source detection? (
bool, defaultTrue)Grow detections to set the image mask bits, but return the original (not-grown) footprints (
bool, defaultFalse)Generate sky objects.
Mask planes to ignore when calculating statistics of image (for thresholdType=stdev) (
List, default['BAD', 'SAT', 'EDGE', 'NO_DATA'])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.
A wide (large-scale) background estimation and removal before footprint and peak detection.
Specifies whether to detect positive, or negative sources, or both.
Specifies the meaning of thresholdValue.
Threshold for detecting footprints; exact meaning and units depend on thresholdType.
Methods Summary
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, default0.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, defaultTrue)
- 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, default1.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, default40)
- 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, default0.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, default2000.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, default2.2)
- combinedGrow#
Grow all footprints at the same time? This allows disconnected footprints to merge. (
bool, defaultTrue)
- 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, defaultFalse)
- doBackgroundTweak#
Tweak background level so median PSF flux of sky objects is zero? (
bool, defaultTrue)
- doBrightPrelimDetection#
Do initial bright detection pass where footprints are grown by brightGrowFactor? (
bool, defaultTrue)
- doTempLocalBackground#
Enable temporary local background subtraction? (see tempLocalBackground) (
bool, defaultTrue)
- doTempWideBackground#
Do temporary wide (large-scale) background subtraction before footprint detection? (
bool, defaultFalse)
- doThresholdScaling#
Scale the threshold level to get empirically measured S/N requested? (
bool, defaultTrue)
- 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, default1.0)Valid Range = [0.0,inf)
- isotropicGrow#
Grow pixels as isotropically as possible? If False, use a Manhattan metric instead. (
bool, defaultTrue)
- 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, default100.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, default150.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, default10.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, default0.02)
- minGoodPixelFraction#
Minimum fraction of ‘good’ pixels required to be deemed worthwhile for an attempt at further processing. (
float, default0.005)
- minPixels#
detected sources with fewer than the specified number of pixels will be ignored (
int, default1)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, default0.1)
- nPeaksMaxSimple#
The maximum number of peaks in a Footprint before trying to replace its peaks using the temporary local background (
int, default1)
- 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, default7.0)
- nSigmaToGrow#
Grow detections by nSigmaToGrow * [PSF RMS width]; if 0 then do not grow (
float, default2.4)
- prelimNegMultiplier#
Multiplier for the negative (relative to positive) polarity detections threshold to use for first pass (to find sky objects). (
float, default2.5)
- prelimThresholdFactor#
Factor by which to multiply the main detection threshold (thresholdValue) to use for first pass (to find sky objects). (
float, default0.5)
- reEstimateBackground#
Estimate the background again after final source detection? (
bool, defaultTrue)
- returnOriginalFootprints#
Grow detections to set the image mask bits, but return the original (not-grown) footprints (
bool, defaultFalse)
- 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, default5.0)Valid Range = [0.0,inf)
Methods Documentation
- setDefaults()#
Subclass hook for computing defaults.
Notes#
Derived
Configclasses that must compute defaults rather than using theFieldinstances’s defaults should do so here. To correctly use inherited defaults, implementations ofsetDefaultsmust call their base class’ssetDefaults.
- 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
validatemethods.Complex single-field validation can be defined by deriving new Field types. For convenience, some derived
lsst.pex.config.Field-types (ConfigFieldandConfigChoiceField) are defined inlsst.pex.configthat handle recursing into subconfigs.Inter-field relationships should only be checked in derived
Configclasses after calling this method, and base validation is complete.