MatchBackgroundsTask#

class lsst.pipe.tasks.matchBackgrounds.MatchBackgroundsTask(*args, **kwargs)#

Bases: PipelineTask

Match the backgrounds of a list of warped exposures to a reference

Attributes#

configMatchBackgroundsConfig

Configuration for this task.

statsCtrlStatisticsControl

Statistics control object.

Notes#

This task is a part of the background subtraction pipeline. It matches the backgrounds of a list of warped science exposures to that of a reference image.

Methods Summary

matchBackgrounds(warps, skyMap, refVisitId)

Match science visit's background level to that of reference visit

run(warps, skyMap)

Match the backgrounds of a list of warped exposures to the same patches in a reference visit

Methods Documentation

matchBackgrounds(warps, skyMap, refVisitId)#

Match science visit’s background level to that of reference visit

Process creates binned images of the full focal plane (in tract coordinates) for all visit IDs, subtracts each from a similarly binned FFP reference image, then generates TractBackground objects.

The TractBackground objects representing the difference image backgrounds are then used to generate ‘offset’ images for each warp comprising the full science exposure visit, which are then added to each warp to match the background to that of the reference visit at the warp’s location within the tract.

Best practice uses psf_matched_warp images without the detections mask plane set. When using direct_warp, sources may bias the difference image background estimation. Mask planes are set in TractBackgroundConfig.

Fit diagnostics are also calculated and returned.

Parameters#

warpslist`[`~lsst.daf.butler.DeferredDatasetHandle]

List of warped exposures (of type ExposureF). This is ordered by patch ID, then by visit ID

skyMaplsst.skyMap.SkyMap

SkyMap for deriving the patch/tract dimensions.

refVisitIdint

Chosen reference visit ID to match to.

Returns#

backgroundInfoListlist`[`TractBackground]

List of all difference image backgrounds used to match to reference visit warps, in nanojanskies.

matchedImageListlist`[`~lsst.afw.image.ExposureF]

List of all background-matched warps, in nanojanskies.

run(warps, skyMap)#

Match the backgrounds of a list of warped exposures to the same patches in a reference visit

A reference visit ID will be chosen automatically if none is supplied.

Parameters#

warpslist`[`~lsst.afw.image.Exposure]

List of warped science exposures to be background-matched.

skyMaplsst.skyMap.SkyMap

SkyMap for deriving the patch/tract dimensions.

Returns#

resultBackgroundList, Exposure

Differential background models and associated background-matched images.