SkyCorrectionTask#

class lsst.pipe.tasks.skyCorrection.SkyCorrectionTask(*args, **kwargs)#

Bases: PipelineTask

Perform a full focal plane sky correction.

Methods Summary

run(calExps, calBkgs, skyFrames, camera[, ...])

Perform sky correction on a visit.

runQuantum(butlerQC, inputRefs, outputRefs)

Do butler IO and transform to provide in memory objects for tasks run method.

Methods Documentation

run(calExps, calBkgs, skyFrames, camera, backgroundToPhotometricRatioHandles=[])#

Perform sky correction on a visit.

The original visit-level background is first restored to the calibrated exposure and the existing background model is inverted in-place. If doMaskObjects is True, the mask map associated with this exposure will be iteratively updated (over nIter loops) by re-estimating the background each iteration and redetecting footprints.

An initial full focal plane sky subtraction (bgModel1) will take place prior to scaling and subtracting the sky frame.

If doSky is True, the sky frame will be scaled to the flux in the input visit.

If doBgModel2 is True, a final full focal plane sky subtraction will take place after the sky frame has been subtracted.

The first N elements of the returned skyCorr will consist of inverted elements of the calexpBackground model (i.e., subtractive). All subsequent elements appended to skyCorr thereafter will be additive such that, when skyCorr is subtracted from a calexp, the net result will be to undo the initial per-detector background solution and then apply the skyCorr model thereafter. Adding skyCorr to a calexpBackground will effectively negate the calexpBackground, returning only the additive background components of the skyCorr background model.

Parameters#

calExpslist [lsst.afw.image.ExposureF]

Detector calibrated exposure images for the visit.

calBkgslist [lsst.afw.math.BackgroundList]

Detector background lists matching the calibrated exposures.

skyFrameslist [lsst.afw.image.ExposureF]

Sky frame calibration data for the input detectors.

cameralsst.afw.cameraGeom.Camera

Camera matching the input data to process.

backgroundToPhotometricRatioHandles :

Deferred dataset handles pointing to the Background to photometric ratio images for the input detectors.

Returns#

resultsStruct containing:
skyFrameScalefloat

Scale factor applied to the sky frame.

skyCorrlist [lsst.afw.math.BackgroundList]

Detector-level sky correction background lists.

calExpMosaiclsst.afw.image.ExposureF

Visit-level mosaic of the sky corrected data, binned. Analogous to calexp - skyCorr.

calBkgMosaiclsst.afw.image.ExposureF

Visit-level mosaic of the sky correction background, binned. Analogous to calexpBackground + skyCorr.

runQuantum(butlerQC, inputRefs, outputRefs)#

Do butler IO and transform to provide in memory objects for tasks run method.

Parameters#

butlerQCQuantumContext

A butler which is specialized to operate in the context of a lsst.daf.butler.Quantum.

inputRefsInputQuantizedConnection

Datastructure whose attribute names are the names that identify connections defined in corresponding PipelineTaskConnections class. The values of these attributes are the lsst.daf.butler.DatasetRef objects associated with the defined input/prerequisite connections.

outputRefsOutputQuantizedConnection

Datastructure whose attribute names are the names that identify connections defined in corresponding PipelineTaskConnections class. The values of these attributes are the lsst.daf.butler.DatasetRef objects associated with the defined output connections.