CpCtiSolveTask

class lsst.cp.pipe.CpCtiSolveTask(**kwargs)

Bases: PipelineTask

Combine CTI measurements to a final calibration.

This task uses the extended pixel edge response (EPER) method as described by Snyder et al. 2021, Journal of Astronimcal Telescopes, Instruments, and Systems, 7, 048002. doi:10.1117/1.JATIS.7.4.048002

Attributes Summary

canMultiprocess

Methods Summary

calcCtiTurnoff(signalVec, dataVec, ctiRange, amp)

Solve for turnoff value in a sequenced dataset.

calcEper(mode, inputMeasurements, amp)

Solve for serial or parallel global CTI using the extended pixel edge response (EPER) method.

debugView(ampName, signal, test)

Debug method for global CTI test value.

emptyMetadata()

Empty (clear) the metadata for this Task and all sub-Tasks.

findTraps(inputMeasurements, calib, detector)

Solve for serial trap parameters.

getFullMetadata()

Get metadata for all tasks.

getFullName()

Get the task name as a hierarchical name including parent task names.

getName()

Get the name of the task.

getTaskDict()

Get a dictionary of all tasks as a shallow copy.

makeField(doc)

Make a lsst.pex.config.ConfigurableField for this task.

makeSubtask(name, **keyArgs)

Create a subtask as a new instance as the name attribute of this task.

run(inputMeasurements, camera, inputDims)

Solve for charge transfer inefficiency from overscan measurements.

runQuantum(butlerQC, inputRefs, outputRefs)

Do butler IO and transform to provide in memory objects for tasks run method.

solveEper(inputMeasurements, calib, detector)

Solve for serial and parallel extended pixel edge response (EPER), which is an esimator of CTI defined in Snyder et al. 2021.

solveGlobalCti(inputMeasurements, calib, ...)

Solve for global CTI constant.

solveLocalOffsets(inputMeasurements, calib, ...)

Solve for local (pixel-to-pixel) electronic offsets.

timer(name[, logLevel])

Context manager to log performance data for an arbitrary block of code.

Attributes Documentation

canMultiprocess: ClassVar[bool] = True

Methods Documentation

calcCtiTurnoff(signalVec, dataVec, ctiRange, amp)

Solve for turnoff value in a sequenced dataset.

Parameters:
signalVecnp.ndarray

Signal values for the dataset. Must be sorted in ascending order.

dataVecnp.ndarray

Data values for the dataset. Must be sorted in ascending order.

ctiRangelist [float]

Range of CTI within which to search for the turnoff point.

Returns:
turnofffloat

The turnoff point in the same units as the input signals

turnoffSamplingErrorfloat

The sampling error of the turnoff point, equals turnoff when not enough data points.

Notes

If the data is sparse and does not cover the turnoff region, it will likely just return the highest signal in the dataset.

However, it will issue a warning if the turnoff point is at the edge of the search range.

calcEper(mode, inputMeasurements, amp)

Solve for serial or parallel global CTI using the extended pixel edge response (EPER) method.

Parameters:
modestr

The orientation of the calculation to perform. Can be either “SERIAL” or “PARALLEL”.

inputMeasurementslist [dict]

List of overscan measurements from each input exposure. Each dictionary is nested within a top level “CTI” key, with measurements organized by amplifier name, containing keys:

"FIRST_COLUMN_MEAN"

Mean value of first image column (float).

"LAST_COLUMN_MEAN"

Mean value of last image column (float).

"IMAGE_MEAN"

Mean value of the entire image region (float).

"SERIAL_OVERSCAN_COLUMNS"

List of serial overscan column indicies (list [int]).

"SERIAL_OVERSCAN_VALUES"

List of serial overscan column means (list [float]).

"PARALLEL_OVERSCAN_ROWS"

List of parallel overscan row indicies (list [int]).

"PARALLEL_OVERSCAN_VALUES"

List of parallel overscan row means (list [float]).

caliblsst.ip.isr.DeferredChargeCalib

Calibration to populate with values.

amplsst.afw.cameraGeom.Amplifier

Amplifier object containing the geometry information for the amplifier.

Returns:
caliblsst.ip.isr.DeferredChargeCalib

Populated calibration.

Raises:
RuntimeErrorRaised if no data remains after flux filtering or if

the mode string is not one of “SERIAL” or “PARALLEL”.

debugView(ampName, signal, test)

Debug method for global CTI test value.

Parameters:
ampNamestr

Name of the amp for plot title.

signallist [float]

Image means for the input exposures.

testlist [float]

CTI test value to plot.

emptyMetadata() None

Empty (clear) the metadata for this Task and all sub-Tasks.

findTraps(inputMeasurements, calib, detector)

Solve for serial trap parameters.

Parameters:
inputMeasurementslist [dict]

List of overscan measurements from each input exposure. Each dictionary is nested within a top level “CTI” key, with measurements organized by amplifier name, containing keys:

"FIRST_COLUMN_MEAN"

Mean value of first image column (float).

"LAST_COLUMN_MEAN"

Mean value of last image column (float).

"IMAGE_MEAN"

Mean value of the entire image region (float).

"SERIAL_OVERSCAN_COLUMNS"

List of overscan column indicies (list [int]).

"SERIAL_OVERSCAN_VALUES"

List of overscan column means (list [float]).

caliblsst.ip.isr.DeferredChargeCalib

Calibration to populate with values.

detectorlsst.afw.cameraGeom.Detector

Detector object containing the geometry information for the amplifiers.

Returns:
caliblsst.ip.isr.DeferredChargeCalib

Populated calibration.

Raises:
RuntimeError

Raised if no data remains after flux filtering.

Notes

The original CTISIM code uses a data model in which the “overscan” consists of the standard serial overscan bbox with the values for the last imaging data column prepended to that list. This version of the code keeps the overscan and imaging sections separate, and so a -1 offset is needed to ensure that the same columns are used for fitting between this code and CTISIM. This offset removes that last imaging data column from the count.

getFullMetadata() TaskMetadata

Get metadata for all tasks.

Returns:
metadataTaskMetadata

The keys are the full task name. Values are metadata for the top-level task and all subtasks, sub-subtasks, etc.

Notes

The returned metadata includes timing information (if @timer.timeMethod is used) and any metadata set by the task. The name of each item consists of the full task name with . replaced by :, followed by . and the name of the item, e.g.:

topLevelTaskName:subtaskName:subsubtaskName.itemName

using : in the full task name disambiguates the rare situation that a task has a subtask and a metadata item with the same name.

getFullName() str

Get the task name as a hierarchical name including parent task names.

Returns:
fullNamestr

The full name consists of the name of the parent task and each subtask separated by periods. For example:

  • The full name of top-level task “top” is simply “top”.

  • The full name of subtask “sub” of top-level task “top” is “top.sub”.

  • The full name of subtask “sub2” of subtask “sub” of top-level task “top” is “top.sub.sub2”.

getName() str

Get the name of the task.

Returns:
taskNamestr

Name of the task.

See also

getFullName

Get the full name of the task.

getTaskDict() dict[str, weakref.ReferenceType[lsst.pipe.base.task.Task]]

Get a dictionary of all tasks as a shallow copy.

Returns:
taskDictdict

Dictionary containing full task name: task object for the top-level task and all subtasks, sub-subtasks, etc.

classmethod makeField(doc: str) ConfigurableField

Make a lsst.pex.config.ConfigurableField for this task.

Parameters:
docstr

Help text for the field.

Returns:
configurableFieldlsst.pex.config.ConfigurableField

A ConfigurableField for this task.

Examples

Provides a convenient way to specify this task is a subtask of another task.

Here is an example of use:

class OtherTaskConfig(lsst.pex.config.Config):
    aSubtask = ATaskClass.makeField("brief description of task")
makeSubtask(name: str, **keyArgs: Any) None

Create a subtask as a new instance as the name attribute of this task.

Parameters:
namestr

Brief name of the subtask.

**keyArgs

Extra keyword arguments used to construct the task. The following arguments are automatically provided and cannot be overridden:

  • config.

  • parentTask.

Notes

The subtask must be defined by Task.config.name, an instance of ConfigurableField or RegistryField.

run(inputMeasurements, camera, inputDims)

Solve for charge transfer inefficiency from overscan measurements.

Parameters:
inputMeasurementslist [dict]

List of overscan measurements from each input exposure. Each dictionary is nested within a top level “CTI” key, with measurements organized by amplifier name, containing keys:

"FIRST_COLUMN_MEAN"

Mean value of first image column (float).

"LAST_COLUMN_MEAN"

Mean value of last image column (float).

"IMAGE_MEAN"

Mean value of the entire image region (float).

"SERIAL_OVERSCAN_COLUMNS"

List of overscan column indicies (list [int]).

"SERIAL_OVERSCAN_VALUES"

List of overscan column means (list [float]).

"PARALLEL_OVERSCAN_ROWS"

List of overscan row indicies (list [int]).

"PARALLEL_OVERSCAN_VALUES"

List of overscan row means (list [float).

cameralsst.afw.cameraGeom.Camera

Camera geometry to use to find detectors.

inputDimslist [dict]

List of input dimensions from each input exposure.

Returns:
resultslsst.pipe.base.Struct

Result struct containing:

outputCalib

Final CTI calibration data (lsst.ip.isr.DeferredChargeCalib).

Raises:
RuntimeError

Raised if data from multiple detectors are passed in.

runQuantum(butlerQC, inputRefs, outputRefs)

Do butler IO and transform to provide in memory objects for tasks run method.

Parameters:
butlerQCQuantumContext

A butler which is specialized to operate in the context of a lsst.daf.butler.Quantum.

inputRefsInputQuantizedConnection

Datastructure whose attribute names are the names that identify connections defined in corresponding PipelineTaskConnections class. The values of these attributes are the lsst.daf.butler.DatasetRef objects associated with the defined input/prerequisite connections.

outputRefsOutputQuantizedConnection

Datastructure whose attribute names are the names that identify connections defined in corresponding PipelineTaskConnections class. The values of these attributes are the lsst.daf.butler.DatasetRef objects associated with the defined output connections.

solveEper(inputMeasurements, calib, detector)

Solve for serial and parallel extended pixel edge response (EPER), which is an esimator of CTI defined in Snyder et al. 2021.

Parameters:
inputMeasurementslist [dict]

List of overscan measurements from each input exposure. Each dictionary is nested within a top level “CTI” key, with measurements organized by amplifier name, containing keys:

"FIRST_COLUMN_MEAN"

Mean value of first image column (float).

"LAST_COLUMN_MEAN"

Mean value of last image column (float).

"IMAGE_MEAN"

Mean value of the entire image region (float).

"SERIAL_OVERSCAN_COLUMNS"

List of overscan column indicies (list [int]).

"SERIAL_OVERSCAN_VALUES"

List of overscan column means (list [float]).

"PARALLEL_OVERSCAN_ROWS"

List of overscan row indicies (list [int]).

"PARALLEL_OVERSCAN_VALUES"

List of overscan row means (list [float).

caliblsst.ip.isr.DeferredChargeCalib

Calibration to populate with values.

detectorlsst.afw.cameraGeom.Detector

Detector object containing the geometry information for the amplifiers.

Returns:
caliblsst.ip.isr.DeferredChargeCalib

Populated calibration.

Notes

The original CTISIM code uses a data model in which the “overscan” consists of the standard serial overscan bbox with the values for the last imaging data column prepended to that list. This version of the code keeps the overscan and imaging sections separate, and so a -1 offset is needed to ensure that the same columns are used for fitting between this code and CTISIM. This offset removes that last imaging data column from the count.

solveGlobalCti(inputMeasurements, calib, detector)

Solve for global CTI constant.

This method solves for the mean global CTI, b.

Parameters:
inputMeasurementslist [dict]

List of overscan measurements from each input exposure. Each dictionary is nested within a top level “CTI” key, with measurements organized by amplifier name, containing keys:

"FIRST_COLUMN_MEAN"

Mean value of first image column (float).

"LAST_COLUMN_MEAN"

Mean value of last image column (float).

"IMAGE_MEAN"

Mean value of the entire image region (float).

"SERIAL_OVERSCAN_COLUMNS"

List of overscan column indicies (list [int]).

"SERIAL_OVERSCAN_VALUES"

List of overscan column means (list [float]).

"PARALLEL_OVERSCAN_ROWS"

List of overscan row indicies (list [int]).

"PARALLEL_OVERSCAN_VALUES"

List of overscan row means (list [float).

caliblsst.ip.isr.DeferredChargeCalib

Calibration to populate with values.

detectorlsst.afw.cameraGeom.Detector

Detector object containing the geometry information for the amplifiers.

Returns:
caliblsst.ip.isr.DeferredChargeCalib

Populated calibration.

Raises:
RuntimeError

Raised if no data remains after flux filtering.

Notes

The original CTISIM code uses a data model in which the “overscan” consists of the standard serial overscan bbox with the values for the last imaging data column prepended to that list. This version of the code keeps the overscan and imaging sections separate, and so a -1 offset is needed to ensure that the same columns are used for fitting between this code and CTISIM. This offset removes that last imaging data column from the count.

solveLocalOffsets(inputMeasurements, calib, detector)

Solve for local (pixel-to-pixel) electronic offsets.

This method fits for au_L, the local electronic offset decay time constant, and A_L, the local electronic offset constant of proportionality.

Parameters:
inputMeasurementslist [dict]

List of overscan measurements from each input exposure. Each dictionary is nested within a top level “CTI” key, with measurements organized by amplifier name, containing keys:

"FIRST_COLUMN_MEAN"

Mean value of first image column (float).

"LAST_COLUMN_MEAN"

Mean value of last image column (float).

"IMAGE_MEAN"

Mean value of the entire image region (float).

"SERIAL_OVERSCAN_COLUMNS"

List of overscan column indicies (list [int]).

"SERIAL_OVERSCAN_VALUES"

List of overscan column means (list [float]).

"PARALLEL_OVERSCAN_ROWS"

List of overscan row indicies (list [int]).

"PARALLEL_OVERSCAN_VALUES"

List of overscan row means (list [float).

caliblsst.ip.isr.DeferredChargeCalib

Calibration to populate with values.

detectorlsst.afw.cameraGeom.Detector

Detector object containing the geometry information for the amplifiers.

Returns:
caliblsst.ip.isr.DeferredChargeCalib

Populated calibration.

Raises:
RuntimeError

Raised if no data remains after flux filtering.

Notes

The original CTISIM code (https://github.com/Snyder005/ctisim) uses a data model in which the “overscan” consists of the standard serial overscan bbox with the values for the last imaging data column prepended to that list. This version of the code keeps the overscan and imaging sections separate, and so a -1 offset is needed to ensure that the same columns are used for fitting between this code and CTISIM. This offset removes that last imaging data column from the count.

timer(name: str, logLevel: int = 10) Iterator[None]

Context manager to log performance data for an arbitrary block of code.

Parameters:
namestr

Name of code being timed; data will be logged using item name: Start and End.

logLevelint

A logging level constant.

See also

lsst.utils.timer.logInfo

Implementation function.

Examples

Creating a timer context:

with self.timer("someCodeToTime"):
    pass  # code to time