LinearitySolveTask

LinearitySolveTask constructs a linearity correction model (a Linearizer) based on the results stored in the input photon transfer curve (PTC) dataset.

Processing summary

LinearitySolveTask runs these operations:

  1. Convert the input exposure time/photodiode flux measurement to a proxy flux by fitting the low-flux end with a linear fit.

  2. Perform fit against using the observed flux and this linear proxy flux (using either a spline or a polynomial).

  3. Store the correction, such that the corrected flux is equal to the uncorrected flux + the linearity correction as a function of the uncorrected flux.

Python API summary

from lsst.cp.pipe.cpLinearitySolve import LinearitySolveTask
classLinearitySolveTask(*, config=None, log=None, initInputs=None, **kwargs)

Fit the linearity from the PTC dataset...

attributeconfig

Access configuration fields and retargetable subtasks.

methodrun(inputPtc, dummy, camera, inputDims, inputPhotodiodeCorrection=None)

Fit non-linearity to PTC data, returning the correct Linearizer object...

See also

See the LinearitySolveTask API reference for complete details.

Retargetable subtasks

No subtasks.

Configuration fields

applyPhotodiodeCorrection

Default
False
Field type

bool Field

Calculate and apply a correction to the photodiode readings?

connections

Data type

lsst.pipe.base.config.LinearitySolveConfigConnections

Field type

ConfigField

Configurations describing the connections of the PipelineTask to datatypes

doSplineFitOffset

Default
True
Field type

bool Field

Fit a scattered light offset in the spline fit.

doSplineFitTemperature

Default
False
Field type

bool Field

Fit temperature coefficient in spline fit?

doSplineFitWeights

Default
False
Field type

bool Field

Fit linearity weight parameters in the spline fit.

ignorePtcMask

Default
False
Field type

bool Field

Ignore the expIdMask set by the PTC solver?

linearityType

Default
'Squared'
Field type

str ChoiceField (optional)

Choices
'LookupTable'

Create a lookup table solution.

'Polynomial'

Create an arbitrary polynomial solution.

'Squared'

Create a single order squared solution.

'Spline'

Create a spline based solution.

'None'

Create a dummy solution.

None

Field is optional

Type of linearizer to construct.

maxLinearAdu

Default
20000.0
Field type

float Field

Maximum DN value to use to estimate linear term.

maxLookupTableAdu

Default
262144
Field type

int Field

Maximum DN value for a LookupTable linearizer.

minLinearAdu

Default
30.0
Field type

float Field

Minimum DN value to use to estimate linear term.

minPhotodiodeCurrent

Default
0.0
Field type

float Field

Minimum value to trust photodiode signals.

nSigmaClipLinear

Default
5.0
Field type

float Field

Maximum deviation from linear solution for Poissonian noise.

polynomialOrder

Default
3
Field type

int RangeField

Range

[2,inf)

Degree of polynomial to fit. Must be at least 2.

saveLogOutput

Default
True
Field type

bool Field

Flag to enable/disable saving of log output for a task, enabled by default.

splineFitMaxIter

Default
20
Field type

int Field

Maximum number of iterations for spline fit.

splineFitMaxRejectionPerIteration

Default
5
Field type

int Field

Maximum number of rejections per iteration for spline fit.

splineFitMinIter

Default
3
Field type

int Field

Minimum number of iterations for spline fit.

splineFitTemperatureColumn

Default
None
Field type

str Field (optional)

Name of the temperature column to use when fitting temperature coefficients in spline fit; this must not be None if doSplineFitTemperature is True.

splineFitWeightParsStart

Default
[1.0, 0.0]
Field type

float ListField

Required length

2

Starting parameters for weight fit, if doSplineFitWeights=True. Parameters are such that sigma = sqrt(par[0]**2. + par[1]**2./mu).If doSplineFitWeights=False then these are used as-is; otherwise they are used as the initial values for fitting these parameters.

splineGroupingColumn

Default
None
Field type

str Field (optional)

Column to use for grouping together points for Spline mode, to allow for different proportionality constants. If not set, no grouping will be done.

splineGroupingMinPoints

Default
100
Field type

int Field

Minimum number of linearity points to allow grouping together points for Spline mode with splineGroupingColumn. This configuration is here to prevent misuse of the Spline code to avoid over-fitting.

splineKnots

Default
10
Field type

int Field

Number of spline knots to use in fit.

trimmedState

Default
True
Field type

bool Field

Will this linearizer be used on trimmed data?

usePhotodiode

Default
False
Field type

bool Field

Use the photodiode info instead of the raw expTimes?

Debugging

linearFit

Display the linearity solution after the initial linear fit (bool)?

polyFit

Display the linearity solution after generating the polynomial fit (bool)?

splineFit

Display the linearity solution after generating the spline fit (bool)?

solution

Display the final linearity solution (bool)?