CalibCombineTask#
- class lsst.cp.pipe.CalibCombineTask(**kwargs)#
Bases:
PipelineTaskTask to combine calib exposures.
Methods Summary
applyScale(exposure[, bbox, scale])Apply scale to input exposure.
calibStats(exp, calibrationType)Measure bulk statistics for the calibration.
combine(target, expHandleList, expScaleList, ...)Combine multiple images.
combineHeaders(expHandleList[, calib, ...])Combine input headers to determine the set of common headers, supplemented by calibration inputs.
getDimensions(expHandleList)Get dimensions of the inputs.
getSize(dimList)Determine a consistent size, given a list of image sizes.
interpolateNans(exp[, maskPlane])Interpolate over NANs in the combined image.
run(inputExpHandles[, inputScales, inputDims])Combine calib exposures for a single detector.
runQuantum(butlerQC, inputRefs, outputRefs)Do butler IO and transform to provide in memory objects for tasks
runmethod.setFilter(exp, filterLabel)Dummy function that will not assign a filter.
setFlatSource(exp)Set the flat source metadata.
Methods Documentation
- applyScale(exposure, bbox=None, scale=None)#
Apply scale to input exposure.
This implementation applies a flux scaling: the input exposure is divided by the provided scale.
Parameters#
- exposure
lsst.afw.image.Exposure Exposure to scale.
- bbox
lsst.geom.Box2I BBox matching the segment of the exposure passed in.
- scale
floatorlist[float], optional Constant scale to divide the exposure by.
- exposure
- calibStats(exp, calibrationType)#
Measure bulk statistics for the calibration.
Parameters#
- exp
lsst.afw.image.Exposure Exposure to calculate statistics for.
- calibrationType
str Type of calibration to record in header.
- exp
- combine(target, expHandleList, expScaleList, stats)#
Combine multiple images.
Parameters#
- target
lsst.afw.image.Exposure Output exposure to construct.
- expHandleList
list[lsst.daf.butler.DeferredDatasetHandle] Input exposure handles to combine.
- expScaleList
list[float] List of scales to apply to each input image.
- stats
lsst.afw.math.StatisticsControl Control explaining how to combine the input images.
- target
- combineHeaders(expHandleList, calib=None, calibType='CALIB', scales=None, metadata=None)#
Combine input headers to determine the set of common headers, supplemented by calibration inputs. The calibration header is set in-place.
Parameters#
- expHandleList
list[lsst.daf.butler.DeferredDatasetHandle] Input list of exposure handles to combine.
- calib
lsst.afw.image.Exposure, optional Output calibration to construct headers for.
- calibType
str, optional OBSTYPE the output should claim.
- scales
list[float], optional Scale values applied to each input to record.
- metadata
lsst.daf.base.PropertyList, optional Output metadata to add headers to.
Returns#
- header
lsst.daf.base.PropertyList Constructed header.
Raises#
- RuntimeError
Raised if neither a calib nor a metadata was supplied.
- expHandleList
- getDimensions(expHandleList)#
Get dimensions of the inputs.
Parameters#
- expHandleList
list[lsst.daf.butler.DeferredDatasetHandle] Exposure handles to check the sizes of.
Returns#
- width, height
int Unique set of input dimensions.
- expHandleList
- getSize(dimList)#
Determine a consistent size, given a list of image sizes.
Parameters#
- dimList
list[tuple[int,int]] List of dimensions.
Raises#
- RuntimeError
If input dimensions are inconsistent.
Returns#
- width, height
int Common dimensions.
- dimList
- interpolateNans(exp, maskPlane='BAD')#
Interpolate over NANs in the combined image.
NANs can result from masked areas on the CCD. We don’t want them getting into our science images, so we replace them with the median of the data.
Parameters#
- exp
lsst.afw.image.Exposure Exp to check for NaNs.
- maskPlane
str, optional Mask plane to set where we have replaced a NAN.
- exp
- run(inputExpHandles, inputScales=None, inputDims=None)#
Combine calib exposures for a single detector.
Parameters#
- inputExpHandles
list[lsst.daf.butler.DeferredDatasetHandle] Input list of exposure handles to combine.
- inputScales
dict[dict[dict[float]]], optional Dictionary of scales, indexed by detector (
int), amplifier (int), and exposure (int). Used for ‘inputExps’ scaling.- inputDims
list[dict] List of dictionaries of input data dimensions/values. Each list entry should contain:
"exposure"exposure id value (
int)"detector"detector id value (
int)
Returns#
- results
lsst.pipe.base.Struct The results struct containing:
outputDataFinal combined exposure generated from the inputs (
lsst.afw.image.Exposure).
Raises#
- RuntimeError
Raised if no input data is found. Also raised if config.exposureScaling == InputList, and a necessary scale was not found.
- inputExpHandles
- 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