lsst.pipe.tasks g97fd7b43eb+28530f823e
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Attributes | List of all members
lsst.pipe.tasks.skyCorrection.SkyCorrectionTask Class Reference
Inheritance diagram for lsst.pipe.tasks.skyCorrection.SkyCorrectionTask:

Public Member Functions

 __init__ (self, *args, **kwargs)
 
 runQuantum (self, butlerQC, inputRefs, outputRefs)
 
 run (self, calExps, calBkgs, skyFrames, camera)
 

Static Public Attributes

 ConfigClass = SkyCorrectionConfig
 

Protected Member Functions

 _restoreBackgroundRefineMask (self, calExps, calBkgs)
 
 _subtractVisitBackground (self, calExps, calBkgs, camera, config)
 
 _subtractDetectorBackground (self, calExp, bgModel)
 
 _subtractSkyFrame (self, calExps, skyFrames, calBkgs)
 
 _binAndMosaic (self, exposures, camera, binning, ids=None, refExps=None)
 

Static Protected Attributes

str _DefaultName = "skyCorr"
 

Detailed Description

Perform a full focal plane sky correction.

Definition at line 233 of file skyCorrection.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.pipe.tasks.skyCorrection.SkyCorrectionTask.__init__ (   self,
args,
**  kwargs 
)

Definition at line 239 of file skyCorrection.py.

Member Function Documentation

◆ _binAndMosaic()

lsst.pipe.tasks.skyCorrection.SkyCorrectionTask._binAndMosaic (   self,
  exposures,
  camera,
  binning,
  ids = None,
  refExps = None 
)
protected
Bin input exposures and mosaic across the entire focal plane.

Input exposures are binned and then mosaicked at the position of
the detector in the focal plane of the camera.

Parameters
----------
exposures : `list`
    Detector level list of either calexp `ExposureF` types or
    calexpBackground `BackgroundList` types.
camera : `lsst.afw.cameraGeom.Camera`
    Camera matching the input data to process.
binning : `int`
    Binning size to be applied to input images.
ids : `list` [`int`], optional
    List of detector ids to iterate over.
refExps : `list` [`lsst.afw.image.exposure.ExposureF`], optional
    If supplied, mask planes from these reference images will be used.
Returns
-------
mosaicImage : `lsst.afw.image.exposure.ExposureF`
    Mosaicked full focal plane image.

Definition at line 551 of file skyCorrection.py.

◆ _restoreBackgroundRefineMask()

lsst.pipe.tasks.skyCorrection.SkyCorrectionTask._restoreBackgroundRefineMask (   self,
  calExps,
  calBkgs 
)
protected
Restore original background to each calexp and invert the related
background model; optionally refine the mask plane.

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

The background model modified in-place in this method will comprise the
first N elements of the skyCorr dataset type, i.e., these N elements
are the inverse of the calexpBackground model. All subsequent elements
appended to skyCorr 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 : `lsst.afw.image.exposure.ExposureF`
    Detector level calexp images to process.
calBkgs : `lsst.afw.math._backgroundList.BackgroundList`
    Detector level background lists associated with the calexps.

Returns
-------
calExps : `lsst.afw.image.exposure.ExposureF`
    The calexps with the initially subtracted background restored.
skyCorrBases : `lsst.afw.math._backgroundList.BackgroundList`
    The inverted initial background models; the genesis for skyCorrs.

Definition at line 347 of file skyCorrection.py.

◆ _subtractDetectorBackground()

lsst.pipe.tasks.skyCorrection.SkyCorrectionTask._subtractDetectorBackground (   self,
  calExp,
  bgModel 
)
protected
Generate CCD background model and subtract from image.

Translate the full focal plane background into CCD coordinates and
subtract from the original science exposure image.

Parameters
----------
calExp : `lsst.afw.image.exposure.ExposureF`
    Exposure to subtract the background model from.
bgModel : `lsst.pipe.tasks.background.FocalPlaneBackground`
    Full focal plane camera-level background model.

Returns
-------
calExp : `lsst.afw.image.exposure.ExposureF`
    Background subtracted input exposure.
calBkgElement : `lsst.afw.math._backgroundList.BackgroundList`
    Detector level realization of the full focal plane bg model.

Definition at line 489 of file skyCorrection.py.

◆ _subtractSkyFrame()

lsst.pipe.tasks.skyCorrection.SkyCorrectionTask._subtractSkyFrame (   self,
  calExps,
  skyFrames,
  calBkgs 
)
protected
Determine the full focal plane sky frame scale factor relative to
an input list of calibrated exposures and subtract.

This method measures the sky frame scale on all inputs, resulting in
values equal to the background method solveScales(). The sky frame is
then subtracted as in subtractSkyFrame() using the appropriate scale.

Input calExps and calBkgs are updated in-place, returning sky frame
subtracted calExps and sky frame updated calBkgs, respectively.

Parameters
----------
calExps : `list` [`lsst.afw.image.exposure.ExposureF`]
    Calibrated exposures to be background subtracted.
skyFrames : `list` [`lsst.afw.image.exposure.ExposureF`]
    Sky frame calibration data for the input detectors.
calBkgs : `list` [`lsst.afw.math._backgroundList.BackgroundList`]
    Background lists associated with the input calibrated exposures.

Definition at line 516 of file skyCorrection.py.

◆ _subtractVisitBackground()

lsst.pipe.tasks.skyCorrection.SkyCorrectionTask._subtractVisitBackground (   self,
  calExps,
  calBkgs,
  camera,
  config 
)
protected
Perform a full focal-plane background subtraction for a visit.

Generate a full focal plane background model, binning all masked
detectors into bins of [bgModelN.xSize, bgModelN.ySize]. After,
subtract the resultant background model (translated back into CCD
coordinates) from the original detector exposure.

Return a list of background subtracted images and a list of full focal
plane background parameters.

Parameters
----------
calExps : `list` [`lsst.afw.image.exposure.ExposureF`]
    Calibrated exposures to be background subtracted.
calBkgs : `list` [`lsst.afw.math._backgroundList.BackgroundList`]
    Background lists associated with the input calibrated exposures.
camera : `lsst.afw.cameraGeom.Camera`
    Camera description.
config : `lsst.pipe.tasks.background.FocalPlaneBackgroundConfig`
    Configuration to use for background subtraction.

Returns
-------
calExps : `list` [`lsst.afw.image.maskedImage.MaskedImageF`]
    Background subtracted exposures for creating a focal plane image.
calBkgs : `list` [`lsst.afw.math._backgroundList.BackgroundList`]
    Updated background lists with a visit-level model appended.

Definition at line 406 of file skyCorrection.py.

◆ run()

lsst.pipe.tasks.skyCorrection.SkyCorrectionTask.run (   self,
  calExps,
  calBkgs,
  skyFrames,
  camera 
)
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.

If doBgModel1 is True, an initial full focal plane sky subtraction 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.exposure.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.exposure.ExposureF`]
    Sky frame calibration data for the input detectors.
camera : `lsst.afw.cameraGeom.Camera`
    Camera matching the input data to process.

Returns
-------
results : `Struct` containing:
    skyCorr : `list` [`lsst.afw.math.BackgroundList`]
        Detector-level sky correction background lists.
    calExpMosaic : `lsst.afw.image.exposure.ExposureF`
        Visit-level mosaic of the sky corrected data, binned.
        Analogous to `calexp - skyCorr`.
    calBkgMosaic : `lsst.afw.image.exposure.ExposureF`
        Visit-level mosaic of the sky correction background, binned.
        Analogous to `calexpBackground + skyCorr`.

Definition at line 266 of file skyCorrection.py.

◆ runQuantum()

lsst.pipe.tasks.skyCorrection.SkyCorrectionTask.runQuantum (   self,
  butlerQC,
  inputRefs,
  outputRefs 
)

Definition at line 244 of file skyCorrection.py.

Member Data Documentation

◆ _DefaultName

str lsst.pipe.tasks.skyCorrection.SkyCorrectionTask._DefaultName = "skyCorr"
staticprotected

Definition at line 237 of file skyCorrection.py.

◆ ConfigClass

lsst.pipe.tasks.skyCorrection.SkyCorrectionTask.ConfigClass = SkyCorrectionConfig
static

Definition at line 236 of file skyCorrection.py.


The documentation for this class was generated from the following file: