SkyCorrectionTask#
- class lsst.pipe.tasks.skyCorrection.SkyCorrectionTask(*args, **kwargs)#
Bases:
PipelineTaskPerform 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
runmethod.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#
- calExps
list[lsst.afw.image.ExposureF] Detector calibrated exposure images for the visit.
- calBkgs
list[lsst.afw.math.BackgroundList] Detector background lists matching the calibrated exposures.
- skyFrames
list[lsst.afw.image.ExposureF] Sky frame calibration data for the input detectors.
- camera
lsst.afw.cameraGeom.Camera Camera matching the input data to process.
- backgroundToPhotometricRatioHandles :
list[lsst.daf.butler.DeferredDatasetHandle], optionalDeferred dataset handles pointing to the Background to photometric ratio images for the input detectors.
Returns#
- results
Structcontaining: - skyFrameScale
float Scale factor applied to the sky frame.
- skyCorr
list[lsst.afw.math.BackgroundList] Detector-level sky correction background lists.
- calExpMosaic
lsst.afw.image.ExposureF Visit-level mosaic of the sky corrected data, binned. Analogous to
calexp - skyCorr.- calBkgMosaic
lsst.afw.image.ExposureF Visit-level mosaic of the sky correction background, binned. Analogous to
calexpBackground + skyCorr.
- skyFrameScale
- calExps
- runQuantum(butlerQC, inputRefs, outputRefs)#
Do butler IO and transform to provide in memory objects for tasks
runmethod.Parameters#
- butlerQC
QuantumContext A butler which is specialized to operate in the context of a
lsst.daf.butler.Quantum.- inputRefs
InputQuantizedConnection Datastructure whose attribute names are the names that identify connections defined in corresponding
PipelineTaskConnectionsclass. The values of these attributes are thelsst.daf.butler.DatasetRefobjects associated with the defined input/prerequisite connections.- outputRefs
OutputQuantizedConnection Datastructure whose attribute names are the names that identify connections defined in corresponding
PipelineTaskConnectionsclass. The values of these attributes are thelsst.daf.butler.DatasetRefobjects associated with the defined output connections.
- butlerQC