ImageDifferenceTask

Python API summary

from lsst.pipe.tasks.imageDifference import ImageDifferenceTask
classImageDifferenceTask(*args, **kwargs)

Subtract an image from a template and measure the result...

attributeconfig

Access configuration fields and retargetable subtasks.

methodrun(exposure=None, selectSources=None, templateExposure=None, templateSources=None, idFactory=None, calexpBackgroundExposure=None, subtractedExposure=None)

PSF matches, subtract two images and perform detection on the difference image...

See also

See the ImageDifferenceTask API reference for complete details.

Retargetable subtasks

applyApCorr

Default
lsst.meas.base.applyApCorr.ApplyApCorrTask
Field type
ConfigurableField
Subtask to apply aperture corrections

astrometer

Default
lsst.meas.astrom.astrometry.AstrometryTask
Field type
ConfigurableField
astrometry task; used to match sources to reference objects, but not to fit a WCS

decorrelate

Default
lsst.ip.diffim.imageDecorrelation.DecorrelateALKernelSpatialTask
Field type
ConfigurableField
Decorrelate effects of A&L kernel convolution on image difference, only if doSubtract is True. If this option is enabled, then detection.thresholdValue should be set to 5.0 (rather than the default of 5.5).

detection

Default
lsst.meas.algorithms.detection.SourceDetectionTask
Field type
ConfigurableField
Low-threshold detection for final measurement

forcedMeasurement

Default
lsst.meas.base.forcedMeasurement.ForcedMeasurementTask
Field type
ConfigurableField
Subtask to force photometer PVI at diaSource location.

getTemplate

Default
lsst.ip.diffim.getTemplate.GetCoaddAsTemplateTask
Field type
ConfigurableField
Subtask to retrieve template exposure and sources

measurement

Default
lsst.ip.diffim.dipoleFitTask.DipoleFitTask
Field type
ConfigurableField
Enable updated dipole fitting method

register

Default
lsst.pipe.tasks.registerImage.RegisterTask
Field type
ConfigurableField
Task to enable image-to-image image registration (warping)

scaleVariance

Default
lsst.meas.algorithms.scaleVariance.ScaleVarianceTask
Field type
ConfigurableField
Subtask to rescale the variance of the template to the statistically expected level

skySources

Default
lsst.meas.algorithms.skyObjects.SkyObjectsTask
Field type
ConfigurableField
Generate sky sources

sourceSelector

Default
lsst.meas.algorithms.objectSizeStarSelector.ObjectSizeStarSelectorTask
Field type
ConfigurableField
Source selection algorithm

subtract

Default
'al'
Field type
Single-selection RegistryField
Choices
'al'
lsst.ip.diffim.imagePsfMatch.ImagePsfMatchTask
'zogy'
lsst.ip.diffim.zogy.ZogyImagePsfMatchTask
Subtraction Algorithm

Configuration fields

coaddName

Default
'deep'
Field type
str Field
coadd name: typically one of deep, goodSeeing, or dcr

connections

Data type
lsst.pipe.base.config.Connections
Field type
ConfigField
Configurations describing the connections of the PipelineTask to datatypes

controlRandomSeed

Default
10
Field type
int Field
Random seed for shuffing the control sample

controlStepSize

Default
5
Field type
int Field
What step size (every Nth one) to select a control sample from the kernelSources

convolveTemplate

Default
True
Field type
bool Field
Which image gets convolved (default = template)

diaSourceMatchRadius

Default
0.5
Field type
float Field
Match radius (in arcseconds) for DiaSource to Source association

doAddCalexpBackground

Default
False
Field type
bool Field
Add background to calexp before processing it. Useful as ipDiffim does background matching.

doAddMetrics

Default
False
Field type
bool Field
Add columns to the source table to hold analysis metrics?

doApCorr

Default
True
Field type
bool Field
Run subtask to apply aperture corrections

doApplyFinalizedPsf

Default
False
Field type
bool Field
Whether to apply finalized psf models and aperture correction map.

doDebugRegister

Default
False
Field type
bool Field
Writing debugging data for doUseRegister

doDecorrelation

Default
True
Field type
bool Field
Perform diffim decorrelation to undo pixel correlation due to A&L kernel convolution (AL only)? If True, also update the diffim PSF.

doDetection

Default
True
Field type
bool Field
Detect sources?

doDipoleFitting

Default
True
Field type
bool Field
Measure dipoles using new algorithm?

doForcedMeasurement

Default
True
Field type
bool Field
Force photometer diaSource locations on PVI?

doMatchSources

Default
False
Field type
bool Field
Match diaSources with input calexp sources and ref catalog sources

doMeasurement

Default
True
Field type
bool Field
Measure diaSources?

doMerge

Default
True
Field type
bool Field
Merge positive and negative diaSources with grow radius set by growFootprint

doPreConvolve

Default
False
Field type
bool Field
Not in use. Superseded by useScoreImageDetection. Deprecated: This option superseded by useScoreImageDetection. Will be removed after v22.

doScaleDiffimVariance

Default
True
Field type
bool Field
Scale variance of the diffim before PSF matching. You may do either this or template variance scaling, or neither. (Doing both is a waste of CPU.)

doScaleTemplateVariance

Default
False
Field type
bool Field
Scale variance of the template before PSF matching

doSelectDcrCatalog

Default
False
Field type
bool Field
Select stars of extreme color as part of the control sample (AL only)

doSelectSources

Default
False
Field type
bool Field
Select stars to use for kernel fitting (AL only)

doSelectVariableCatalog

Default
False
Field type
bool Field
Select stars that are variable to be part of the control sample (AL only)

doSkySources

Default
False
Field type
bool Field
Generate sky sources?

doSpatiallyVarying

Default
False
Field type
bool Field
Perform A&L decorrelation on a grid across the image in order to allow for spatial variations. Zogy does not use this option.

doSubtract

Default
True
Field type
bool Field
Compute subtracted exposure?

doUseRegister

Default
False
Field type
bool Field
Re-compute astrometry on the template. Use image-to-image registration to align template with science image (AL only).

doWriteMatchedExp

Default
False
Field type
bool Field
Write warped and PSF-matched template coadd exposure?

doWriteScoreExp

Default
False
Field type
bool Field
Write AL likelihood or Zogy score exposure?

doWriteSources

Default
True
Field type
bool Field
Write sources?

doWriteSubtractedExp

Default
True
Field type
bool Field
Write difference exposure (AL and Zogy) ?

doWriteWarpedExp

Default
False
Field type
bool Field
Write WCS, warped template coadd exposure?

growFootprint

Default
2
Field type
int Field
Grow positive and negative footprints by this amount before merging

kernelSourcesFromRef

Default
False
Field type
bool Field
Select sources to measure kernel from reference catalog if True, template if false

refObjLoader

Data type
lsst.meas.algorithms.loadReferenceObjects.LoadReferenceObjectsConfig
Field type
ConfigField
reference object loader

requiredTemplateFraction

Default
0.1
Field type
float Field
Do not attempt to run task if template covers less than this fraction of pixels.Setting to 0 will always attempt image subtraction

saveLogOutput

Default
True
Field type
bool Field
Flag to enable/disable saving of log output for a task, enabled by default.

saveMetadata

Default
True
Field type
bool Field
Flag to enable/disable metadata saving for a task, enabled by default.

templateSipOrder

Default
2
Field type
int Field
Sip Order for fitting the Template Wcs (default is too high, overfitting)

useGaussianForPreConvolution

Default
False
Field type
bool Field
Use a simple gaussian PSF model for pre-convolution (oherwise use exposure PSF)? (AL and if useScoreImageDetection=True only)

useScoreImageDetection

Default
False
Field type
bool Field
Calculate the pre-convolved AL likelihood or the Zogy score image. Use it for source detection (if doDetection=True).

Python API reference

lsst.pipe.tasks.imageDifference Module

Classes

ImageDifferenceConfig Config for ImageDifferenceTask.
ImageDifferenceTask([butler]) Subtract an image from a template and measure the result.

Class Inheritance Diagram

Inheritance diagram of lsst.pipe.tasks.imageDifference.ImageDifferenceConfig, lsst.pipe.tasks.imageDifference.ImageDifferenceTask