IsrStatisticsTask#

class lsst.ip.isr.IsrStatisticsTask(statControl=None, **kwargs)#

Bases: Task

Task 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#

inputExplsst.afw.image.Exposure

The exposure being processed.

**kwargs :

Keyword arguments with calibrations.

Returns#

outputStatsdict [str, [dict [str, float]]]

Dictionary of measurements, keyed by amplifier name and statistics segment.

static makeKernel(kernelSize)#

Make a boxcar smoothing kernel.

Parameters#

kernelSizeint

Size of the kernel in pixels.

Returns#

kernelnp.array

Kernel for boxcar smoothing.

measureAmpCorrelations(inputExp, serialOverscanResults)#

Measure correlations between amplifier segments.

Parameters#

inputExplsst.afw.image.Exposure

Exposure to measure.

overscanslist [lsst.pipe.base.Struct]

List of overscan results. Expected fields are:

imageFit

Value or fit subtracted from the amplifier image data (scalar or lsst.afw.image.Image).

overscanFit

Value or fit subtracted from the overscan image data (scalar or lsst.afw.image.Image).

overscanImage

Image 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#

outputStatsdict [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

measureBanding(inputExp, overscans)#

Task to measure banding statistics.

Parameters#

inputExplsst.afw.image.Exposure

Exposure to measure.

overscanslist [lsst.pipe.base.Struct]

List of overscan results. Expected fields are:

imageFit

Value or fit subtracted from the amplifier image data (scalar or lsst.afw.image.Image).

overscanFit

Value or fit subtracted from the overscan image data (scalar or lsst.afw.image.Image).

overscanImage

Image 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#

outputStatsdict [str, [dict [str, float]]]

Dictionary of measurements, keyed by amplifier name and statistics segment.

measureBiasShifts(inputExp, serialOverscanResults)#

Measure number of bias shifts from overscan data.

Parameters#

inputExplsst.afw.image.Exposure

Exposure to measure.

overscanslist [lsst.pipe.base.Struct]

List of overscan results. Expected fields are:

imageFit

Value or fit subtracted from the amplifier image data (scalar or lsst.afw.image.Image).

overscanFit

Value or fit subtracted from the overscan image data (scalar or lsst.afw.image.Image).

overscanImage

Image 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#

outputStatsdict [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

measureCti(inputExp, untrimmedInputExp, gains)#

Task to measure CTI statistics.

Parameters#

inputExplsst.afw.image.Exposure

The exposure to measure.

untrimmedInputExplsst.afw.image.Exposure

Exposure to measure overscan from.

gainsdict [str float]

Dictionary of per-amplifier gains, indexed by amplifier name.

Returns#

outputStatsdict [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.

measureCtiLegacy(inputExp, serialOverscans, gains)#

Task to measure CTI statistics.

Parameters#

inputExplsst.afw.image.Exposure

Exposure to measure.

serialOverscanslist [lsst.pipe.base.Struct]

List of serial overscan results (expects base units of adu). Expected fields are:

imageFit

Value or fit subtracted from the amplifier image data (scalar or lsst.afw.image.Image).

overscanFit

Value or fit subtracted from the overscan image data (scalar or lsst.afw.image.Image).

overscanImage

Image of the overscan region with the overscan correction applied (lsst.afw.image.Image). This quantity is used to estimate the amplifier read noise empirically.

gainsdict [str float]

Dictionary of per-amplifier gains, indexed by amplifier name.

Returns#

outputStatsdict [str, [dict [str, float]]]

Dictionary of measurements, keyed by amplifier name and statistics segment. Everything in units based on electron.

measureDivisaderoStatistics(inputExp, **kwargs)#

Measure Max Divisadero Tearing effect per amp.

Parameters#

inputExplsst.afw.image.Exposure

Exposure to measure. Usually a flat.

**kwargs :

The flat will be selected from here.

Returns#

outputStatsdict [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).

measureProjectionStatistics(inputExp, overscans)#

Task to measure metrics from image slicing.

Parameters#

inputExplsst.afw.image.Exposure

Exposure to measure.

overscanslist [lsst.pipe.base.Struct]

List of overscan results. Expected fields are:

imageFit

Value or fit subtracted from the amplifier image data (scalar or lsst.afw.image.Image).

overscanFit

Value or fit subtracted from the overscan image data (scalar or lsst.afw.image.Image).

overscanImage

Image 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#

outputStatsdict [str, [dict [str, float]]]

Dictionary of measurements, keyed by amplifier name and statistics segment.

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#

inputExplsst.afw.image.Exposure

The exposure to measure.

untrimmedInputExp :

The exposure to measure overscan statistics from.

ptclsst.ip.isr.PtcDataset, optional

A PTC object containing gains to use.

serialOverscanResultslist [lsst.pipe.base.Struct], optional

List of serial overscan results. Expected fields are:

imageFit

Value or fit subtracted from the amplifier image data (scalar or lsst.afw.image.Image).

overscanFit

Value or fit subtracted from the overscan image data (scalar or lsst.afw.image.Image).

overscanImage

Image of the overscan region with the overscan correction applied (lsst.afw.image.Image). This quantity is used to estimate the amplifier read noise empirically.

parallelOverscanResultslist [lsst.pipe.base.Struct], optional

List of parallel overscan results. Expected fields are:

imageFit

Value or fit subtracted from the amplifier image data (scalar or lsst.afw.image.Image).

overscanFit

Value or fit subtracted from the overscan image data (scalar or lsst.afw.image.Image).

overscanImage

Image of the overscan region with the overscan correction applied (lsst.afw.image.Image). This quantity is used to estimate the amplifier read noise empirically.

doLegacyCtiStatisticsbool, 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#

resultStructlsst.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.