AlardLuptonPreconvolveSubtractTask

AlardLuptonPreconvolveSubtractTask is a modification of AlardLuptonSubtractTask behavior, and it performs image differencing between the template image and a custom kernel cross-correlated science image.

Description

This task takes the pair of science and template exposures, together with the science image source catalog, and produces difference and matched template exposures as outputs.

The process involves pre-convolving the science image with a predefined kernel (tipically its own PSF) before running the nominal set of steps for image subtraction, that is, selecting sources to obtain a matching convolution kernel, applying this to the template image, and performing the image differencing.

In this case the subtraction produces a score image directly, and it can be used for maximum-likelihood source detection in a straightforward manner. This is done using DetectAndMeasureScoreTask.

Python API summary

from lsst.ip.diffim.subtractImages import AlardLuptonPreconvolveSubtractTask
classAlardLuptonPreconvolveSubtractTask(**kwargs)

Subtract a template from a science image, convolving the science image before computing the kernel, and also convolving the template before subtraction...

attributeconfig

Access configuration fields and retargetable subtasks.

methodrun(template, science, sources, visitSummary=None)

Preconvolve the science image with its own PSF, convolve the template image with a PSF-matching kernel and subtract from the preconvolved science image...

See also

See the AlardLuptonPreconvolveSubtractTask API reference for complete details.

Retargetable subtasks

decorrelate

Default

lsst.ip.diffim.imageDecorrelation.DecorrelateALKernelTask

Field type

ConfigurableField

Task to decorrelate the image difference.

makeKernel

Default

lsst.ip.diffim.makeKernel.MakeKernelTask

Field type

ConfigurableField

Task to construct a matching kernel for convolution.

scaleVariance

Default

lsst.meas.algorithms.scaleVariance.ScaleVarianceTask

Field type

ConfigurableField

Subtask to rescale the variance of the template to the statistically expected level.

sourceSelector

Default

lsst.meas.algorithms.sourceSelector.ScienceSourceSelectorTask

Field type

ConfigurableField

Task to select sources to be used for PSF matching.

Configuration fields

allowKernelSourceDetection

Default
False
Field type

bool Field

Re-run source detection for kernel candidates if an error is encountered while calculating the matching kernel.

badMaskPlanes

Default
('NO_DATA', 'BAD', 'SAT', 'EDGE')
Field type

str ListField

Mask planes to interpolate over.

connections

Data type

lsst.pipe.base.config.AlardLuptonPreconvolveSubtractConfigConnections

Field type

ConfigField

Configurations describing the connections of the PipelineTask to datatypes

detectionThreshold

Default
10
Field type

float Field

Minimum signal to noise ratio of detected sources to use for calculating the PSF matching kernel.

detectionThresholdMax

Default
500
Field type

float Field

Maximum signal to noise ratio of detected sources to use for calculating the PSF matching kernel.

doApplyExternalCalibrations

Default
False
Field type

bool Field

Replace science Exposure’s calibration objects with those in visitSummary. Ignored if `doApplyFinalizedPsf is True.

doDecorrelation

Default
True
Field type

bool Field

Perform diffim decorrelation to undo pixel correlation due to A&L kernel convolution? If True, also update the diffim PSF.

doScaleVariance

Default
True
Field type

bool Field

Scale variance of the image difference?

doSubtractBackground

Default
True
Field type

bool Field

Subtract the background fit when solving the kernel?

excludeMaskPlanes

Default
('NO_DATA', 'BAD', 'SAT', 'EDGE', 'FAKE')
Field type

str ListField

Mask planes to exclude when selecting sources for PSF matching.

maxKernelSources

Default
1000
Field type

int Field

Maximum number of sources to use for calculating the PSF matching kernel.Set to -1 to disable.

minKernelSources

Default
3
Field type

int Field

Minimum number of sources needed for calculating the PSF matching kernel.

minTemplateFractionForExpectedSuccess

Default
0.2
Field type

float Field

Raise NoWorkFound if PSF-matching fails and template covers less than this fraction of pixels. If the fraction of pixels covered by the template is less than this value (and greater than requiredTemplateFraction) this task is attempted but failure is anticipated and tolerated.

preserveTemplateMask

Default
('NO_DATA', 'BAD')
Field type

str ListField

Mask planes from the template to propagate to the image difference.

renameTemplateMask

Default
('SAT', 'INJECTED', 'INJECTED_CORE')
Field type

str ListField

Mask planes from the template to propagate to the image differencewith ‘_TEMPLATE’ appended to the name.

requiredTemplateFraction

Default
0.1
Field type

float Field

Raise NoWorkFound and do not attempt image subtraction 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.