AlardLuptonSubtractTask¶
AlardLuptonSubtractTask performs image differencing, including decorrelation.
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 selecting sources from the science exposure source catalog, obtaining the convolution kernel, applying this to the target
image, and subtracting the images.
As discussed in the general package overview the task has two possible modes: one convolving the template
image and the alternative convolving the science
image.
Both modes share the preparation sub-tasks, but the method that performs the convolution is not the same.
The parameter that controls this behavior is mode
(check AlardLuptonSubtractConfig
), and it allows convolveScience
, convolveTemplate
and finally auto
which means that the decision is made at runtime automatically.
Finally, mask planes are set on the difference and matched template outputs based on the masks of the input science and template images.
Python API summary¶
from lsst.ip.diffim.subtractImages import AlardLuptonSubtractTask
-
class
AlardLuptonSubtractTask
(**kwargs) Compute the image difference of a science and template image using the Alard & Lupton (1998) algorithm
...
- attributeconfig
Access configuration fields and retargetable subtasks.
-
method
run
(template, science, sources, visitSummary=None) PSF match, subtract, and decorrelate two images
...
See also
See the AlardLuptonSubtractTask
API reference for complete details.
Retargetable subtasks¶
decorrelate¶
- Default
lsst.ip.diffim.imageDecorrelation.DecorrelateALKernelTask
- Field type
Task to decorrelate the image difference.
makeKernel¶
- Default
lsst.ip.diffim.makeKernel.MakeKernelTask
- Field type
Task to construct a matching kernel for convolution.
scaleVariance¶
- Default
lsst.meas.algorithms.scaleVariance.ScaleVarianceTask
- Field type
Subtask to rescale the variance of the template to the statistically expected level.
Configuration fields¶
allowKernelSourceDetection¶
Re-run source detection for kernel candidates if an error is encountered while calculating the matching kernel.
badMaskPlanes¶
Mask planes to interpolate over.
badSourceFlags¶
- Default
('sky_source', 'slot_Centroid_flag', 'slot_ApFlux_flag', 'slot_PsfFlux_flag', 'base_PixelFlags_flag_interpolated', 'base_PixelFlags_flag_saturated', 'base_PixelFlags_flag_bad')
- Field type
Flags that, if set, the associated source should not be used to determine the PSF matching kernel.
connections¶
- Data type
lsst.pipe.base.config.AlardLuptonSubtractConfigConnections
- Field type
Configurations describing the connections of the PipelineTask to datatypes
detectionThreshold¶
Minimum signal to noise ratio of detected sources to use for calculating the PSF matching kernel.
detectionThresholdMax¶
Maximum signal to noise ratio of detected sources to use for calculating the PSF matching kernel.
doApplyExternalCalibrations¶
Replace science Exposure’s calibration objects with those in visitSummary. Ignored if `doApplyFinalizedPsf is True.
doDecorrelation¶
Perform diffim decorrelation to undo pixel correlation due to A&L kernel convolution? If True, also update the diffim PSF.
doScaleVariance¶
Scale variance of the image difference?
doSubtractBackground¶
Subtract the background fit when solving the kernel?
excludeMaskPlanes¶
Mask planes to exclude when selecting sources for PSF matching.
maxKernelSources¶
Maximum number of sources to use for calculating the PSF matching kernel.Set to -1 to disable.
minKernelSources¶
Minimum number of sources needed for calculating the PSF matching kernel.
minTemplateFractionForExpectedSuccess¶
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.
mode¶
- Default
'convolveTemplate'
- Field type
str
ChoiceField
(optional)- Choices
'auto'
Choose which image to convolve at runtime.
'convolveScience'
Only convolve the science image.
'convolveTemplate'
Only convolve the template image.
None
Field is optional
Choose which image to convolve at runtime, or require that a specific image is convolved.
preserveTemplateMask¶
Mask planes from the template to propagate to the image difference.
renameTemplateMask¶
Mask planes from the template to propagate to the image differencewith ‘_TEMPLATE’ appended to the name.
requiredTemplateFraction¶
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¶
Flag to enable/disable saving of log output for a task, enabled by default.