IsrStatisticsTask#
- class lsst.ip.isr.IsrStatisticsTask(statControl=None, **kwargs)#
Bases:
TaskTask to measure arbitrary statistics on ISR processed exposures.
The goal is to wrap a number of optional measurements that are useful for calibration production and detector stability.
Methods Summary
copyCalibDistributionStatistics(inputExp, ...)Copy calibration statistics for this exposure.
makeKernel(kernelSize)Make a boxcar smoothing kernel.
measureAmpCorrelations(inputExp, ...)Measure correlations between amplifier segments.
measureBanding(inputExp, overscans)Task to measure banding statistics.
measureBiasShifts(inputExp, ...)Measure number of bias shifts from overscan data.
measureCti(inputExp, untrimmedInputExp, gains)Task to measure CTI statistics.
measureCtiLegacy(inputExp, serialOverscans, ...)Task to measure CTI statistics.
measureDivisaderoStatistics(inputExp, **kwargs)Measure Max Divisadero Tearing effect per amp.
measureProjectionStatistics(inputExp, overscans)Task to measure metrics from image slicing.
run(inputExp[, untrimmedInputExposure, ptc, ...])Task to run arbitrary statistics.
Methods Documentation
- copyCalibDistributionStatistics(inputExp, **kwargs)#
Copy calibration statistics for this exposure.
Parameters#
- inputExp
lsst.afw.image.Exposure The exposure being processed.
- **kwargs :
Keyword arguments with calibrations.
Returns#
- outputStats
dict[str, [dict[str,float]]] Dictionary of measurements, keyed by amplifier name and statistics segment.
- inputExp
- static makeKernel(kernelSize)#
Make a boxcar smoothing kernel.
Parameters#
- kernelSize
int Size of the kernel in pixels.
Returns#
- kernel
np.array Kernel for boxcar smoothing.
- kernelSize
- measureAmpCorrelations(inputExp, serialOverscanResults)#
Measure correlations between amplifier segments.
Parameters#
- inputExp
lsst.afw.image.Exposure Exposure to measure.
- overscans
list[lsst.pipe.base.Struct] List of overscan results. Expected fields are:
imageFitValue or fit subtracted from the amplifier image data (scalar or
lsst.afw.image.Image).overscanFitValue or fit subtracted from the overscan image data (scalar or
lsst.afw.image.Image).overscanImageImage of the overscan region with the overscan correction applied (
lsst.afw.image.Image). This quantity is used to estimate the amplifier read noise empirically.
Returns#
- outputStats
dict[str, [dict[str,float]]] Dictionary of measurements, keyed by amplifier name and statistics segment.
Notes#
Based on eo_pipe implementation: lsst-camera-dh/eo_pipe # noqa: E501 W505
- inputExp
- measureBanding(inputExp, overscans)#
Task to measure banding statistics.
Parameters#
- inputExp
lsst.afw.image.Exposure Exposure to measure.
- overscans
list[lsst.pipe.base.Struct] List of overscan results. Expected fields are:
imageFitValue or fit subtracted from the amplifier image data (scalar or
lsst.afw.image.Image).overscanFitValue or fit subtracted from the overscan image data (scalar or
lsst.afw.image.Image).overscanImageImage of the overscan region with the overscan correction applied (
lsst.afw.image.Image). This quantity is used to estimate the amplifier read noise empirically.
Returns#
- outputStats
dict[str, [dict[str,float]]] Dictionary of measurements, keyed by amplifier name and statistics segment.
- inputExp
- measureBiasShifts(inputExp, serialOverscanResults)#
Measure number of bias shifts from overscan data.
Parameters#
- inputExp
lsst.afw.image.Exposure Exposure to measure.
- overscans
list[lsst.pipe.base.Struct] List of overscan results. Expected fields are:
imageFitValue or fit subtracted from the amplifier image data (scalar or
lsst.afw.image.Image).overscanFitValue or fit subtracted from the overscan image data (scalar or
lsst.afw.image.Image).overscanImageImage of the overscan region with the overscan correction applied (
lsst.afw.image.Image). This quantity is used to estimate the amplifier read noise empirically.
Returns#
- outputStats
dict[str, [dict[str,float]]] Dictionary of measurements, keyed by amplifier name and statistics segment.
Notes#
Based on eo_pipe implementation: lsst-camera-dh/eo_pipe # noqa: E501 W505
- inputExp
- measureCti(inputExp, untrimmedInputExp, gains)#
Task to measure CTI statistics.
Parameters#
- inputExp
lsst.afw.image.Exposure The exposure to measure.
- untrimmedInputExp
lsst.afw.image.Exposure Exposure to measure overscan from.
- gains
dict[strfloat] Dictionary of per-amplifier gains, indexed by amplifier name.
Returns#
- outputStats
dict[str, [dict[str,float]]] Dictionary of measurements, keyed by amplifier name and statistics segment. Everything in units based on electron.
Notes#
The input exposure is needed because it contains the last imaging pixel, with defects applied. And the untrimmed input exposure is needed because it contains the overscan regions. It needs to be this way because the defect masking code requires that the image be trimmed, but we need the image with defects masked to measure the CTI from the last imaging pixel.
- inputExp
- measureCtiLegacy(inputExp, serialOverscans, gains)#
Task to measure CTI statistics.
Parameters#
- inputExp
lsst.afw.image.Exposure Exposure to measure.
- serialOverscans
list[lsst.pipe.base.Struct] List of serial overscan results (expects base units of adu). Expected fields are:
imageFitValue or fit subtracted from the amplifier image data (scalar or
lsst.afw.image.Image).overscanFitValue or fit subtracted from the overscan image data (scalar or
lsst.afw.image.Image).overscanImageImage of the overscan region with the overscan correction applied (
lsst.afw.image.Image). This quantity is used to estimate the amplifier read noise empirically.
- gains
dict[strfloat] Dictionary of per-amplifier gains, indexed by amplifier name.
Returns#
- outputStats
dict[str, [dict[str,float]]] Dictionary of measurements, keyed by amplifier name and statistics segment. Everything in units based on electron.
- inputExp
- measureDivisaderoStatistics(inputExp, **kwargs)#
Measure Max Divisadero Tearing effect per amp.
Parameters#
- inputExp
lsst.afw.image.Exposure Exposure to measure. Usually a flat.
- **kwargs :
The flat will be selected from here.
Returns#
- outputStats
dict[str, [dict[str,float]]] Dictionary of measurements, keyed by amplifier name and statistics segment. Measurements include
DIVISADERO_PROFILE: Robust mean of rows between divisaderoProjection<Maximum|Minumum> on readout edge of ccd normalized by a linear fit to the same rows.
DIVISADERO_MAX_PAIR: Tuple of maximum of the absolute values of the DIVISADERO_PROFILE, for number of pixels (specified by divisaderoNumImpactPixels on left and right side of amp.
DIVISADERO_MAX: Maximum of the absolute values of the the DIVISADERO_PROFILE, for the divisaderoNumImpactPixels on boundaries of neighboring amps (including the pixels in those neighborboring amps).
- inputExp
- measureProjectionStatistics(inputExp, overscans)#
Task to measure metrics from image slicing.
Parameters#
- inputExp
lsst.afw.image.Exposure Exposure to measure.
- overscans
list[lsst.pipe.base.Struct] List of overscan results. Expected fields are:
imageFitValue or fit subtracted from the amplifier image data (scalar or
lsst.afw.image.Image).overscanFitValue or fit subtracted from the overscan image data (scalar or
lsst.afw.image.Image).overscanImageImage of the overscan region with the overscan correction applied (
lsst.afw.image.Image). This quantity is used to estimate the amplifier read noise empirically.
Returns#
- outputStats
dict[str, [dict[str,float]]] Dictionary of measurements, keyed by amplifier name and statistics segment.
- inputExp
- run(inputExp, untrimmedInputExposure=None, ptc=None, serialOverscanResults=None, parallelOverscanResults=None, doLegacyCtiStatistics=False, **kwargs)#
Task to run arbitrary statistics.
The statistics should be measured by individual methods, and add to the dictionary in the return struct.
Parameters#
- inputExp
lsst.afw.image.Exposure The exposure to measure.
- untrimmedInputExp :
The exposure to measure overscan statistics from.
- ptc
lsst.ip.isr.PtcDataset, optional A PTC object containing gains to use.
- serialOverscanResults
list[lsst.pipe.base.Struct], optional List of serial overscan results. Expected fields are:
imageFitValue or fit subtracted from the amplifier image data (scalar or
lsst.afw.image.Image).overscanFitValue or fit subtracted from the overscan image data (scalar or
lsst.afw.image.Image).overscanImageImage of the overscan region with the overscan correction applied (
lsst.afw.image.Image). This quantity is used to estimate the amplifier read noise empirically.
- parallelOverscanResults
list[lsst.pipe.base.Struct], optional List of parallel overscan results. Expected fields are:
imageFitValue or fit subtracted from the amplifier image data (scalar or
lsst.afw.image.Image).overscanFitValue or fit subtracted from the overscan image data (scalar or
lsst.afw.image.Image).overscanImageImage of the overscan region with the overscan correction applied (
lsst.afw.image.Image). This quantity is used to estimate the amplifier read noise empirically.
- doLegacyCtiStatistics
bool, optional Use the older version of measureCti (not recommended). This should be True if and only if this task is called from IsrTask. TODO: Deprecate legacy CTI + CTI correction from IsrTask (DM-48757).
- **kwargs :
Keyword arguments. Calibrations being passed in should have an entry here.
Returns#
- resultStruct
lsst.pipe.base.Struct Contains the measured statistics as a dict stored in a field named
results.
Raises#
- RuntimeError
Raised if the amplifier gains could not be found.
- inputExp