PhotonTransferCurveSolveTask

PhotonTransferCurveSolveTask combines the partial photon transfer curve (PTC) datasets from pairs of flats, and produces the complete curve, fitting the gains, read noises, and measuring the covariances.

Processing summary

PhotonTransferCurveSolveTask runs these operations:

  1. Collates the multiple single-pair input PTC datasets.

  2. Fits either a full-covariance model, or one of two simpler approximations (polynomial and Astier+19 exponential approximation).

  3. Persists the final complete dataset to disk.

Python API summary

from lsst.cp.pipe.ptc.cpPtcSolve import PhotonTransferCurveSolveTask
classPhotonTransferCurveSolveTask(*, config=None, log=None, initInputs=None, **kwargs)

Task to fit the PTC from flat covariances...

attributeconfig

Access configuration fields and retargetable subtasks.

methodrun(inputCovariances, camera=None, detId=0)

Fit measured covariances to different models...

See also

See the PhotonTransferCurveSolveTask API reference for complete details.

Retargetable subtasks

No subtasks.

Configuration fields

binSize

Default
1
Field type

int Field

Bin the image by this factor in both dimensions.

connections

Data type

lsst.pipe.base.config.PhotonTransferCurveSolveConfigConnections

Field type

ConfigField

Configurations describing the connections of the PipelineTask to datatypes

consecutivePointsVarDecreases

Default
2
Field type

int RangeField

Range

[2,inf)

Required number of consecutive points/fluxes in the PTC where the variance decreases in order to find a first estimate of the PTC turn-off. Only used if doLegacyTurnoffSelection is True.

doFitBootstrap

Default
False
Field type

bool Field

Use bootstrap for the PTC fit parameters and errors?.

doLegacyTurnoffSelection

Default
False
Field type

bool Field

Use ‘legacy’ computation for PTC turnoff selection. If set to False, then the KS test p-value selection will be used instead.

doSubtractLongRangeCovariances

Default
False
Field type

bool Field

Subtract long-range covariances before FULLCOVARIANCE fit, beyond startLongRangeCovariances?

ksTestMinPvalue

Default
0.01
Field type

float Field

Minimum value of the Gaussian histogram KS test p-value to be used in PTC fit. Only used if doLegacyTurnoffSelection is False.

maxDeltaInitialPtcOutlierFit

Default
9000.0
Field type

float Field

If there are any outliers in the initial fit that have mean greater than maxSignalInitialPtcOutlierFit, then no points that have this delta mean from the previous good point are allowed. If scaleMaxSignalInitialPtcOutlierFit=True then the units are electrons; otherwise adu.

maxIterFullFitCovariancesAstier

Default
3
Field type

int Field

Maximum number of iterations in full model fit for FULLCOVARIANCE ptcFitType

maxIterationsPtcOutliers

Default
2
Field type

int RangeField

Range

[0,inf)

Maximum number of iterations for outlier rejection in PTC.

maxMeanSignal

Default
{'ALL_AMPS': 1000000.0}
Field type

DictField

Key type

str

Value type

float

Maximum values (inclusive) of mean signal (in adu) below which to consider, per amp. The same cut is applied to all amps if this dictionary is of the form {‘ALL_AMPS’: value}

maxSignalInitialPtcOutlierFit

Default
50000.0
Field type

float Field

Maximum signal considered for intial outlier fit. This should be below the PTC turnoff to ensure accurate outlier rejection. If scaleMaxSignalInitialPtcOutlierFit=True then the units are electrons; otherwise adu.

maximumRangeCovariancesAstier

Default
8
Field type

int Field

Maximum range of measured covariances as in Astier+19

maximumRangeCovariancesAstierFullCovFit

Default
8
Field type

int Field

Maximum range up to where to fit covariances as in Astier+19, for the FULLCOVARIANCE model.This is different from maximumRangeCovariancesAstier.It should be less or equal than maximumRangeCovariancesAstier.The number of parameters for this model is 3*maximumRangeCovariancesAstierFullCovFit^2 + 1, so increase with care so that the fit is not too slow.

minMeanSignal

Default
{'ALL_AMPS': 0.0}
Field type

DictField

Key type

str

Value type

float

Minimum values (inclusive) of mean signal (in adu) per amp to use. The same cut is applied to all amps if this parameter [dict] is passed as {‘ALL_AMPS’: value}

minVarPivotSearch

Default
10000
Field type

float Field

The code looks for a pivot signal point after which the variance starts decreasing at high-flux to exclude then from the PTC model fit. However, sometimes at low fluxes, the variance decreases slightly. Set this variable for the variance value, in adu^2, after which the pivot should be sought. Only used if doLegacyTurnoffSelection is True.

polyDegLongRangeCovariances

Default
1
Field type

int Field

If doSubtractLongRangeCovariances is True, polynomial degree to fit data beyond startLongRangeCovariances.

polynomialFitDegree

Default
3
Field type

int Field

Degree of polynomial to fit the PTC, when ‘ptcFitType’=POLYNOMIAL.

ptcFitType

Default
'POLYNOMIAL'
Field type

str ChoiceField (optional)

Choices
'POLYNOMIAL'

n-degree polynomial (use ‘polynomialFitDegree’ to set ‘n’).

'EXPAPPROXIMATION'

Approximation in Astier+19 (Eq. 16).

'FULLCOVARIANCE'

Full covariances model in Astier+19 (Eq. 20)

None

Field is optional

Fit PTC to Eq. 16, Eq. 20 in Astier+19, or to a polynomial.

saveLogOutput

Default
True
Field type

bool Field

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

scaleMaxSignalInitialPtcOutlierFit

Default
True
Field type

bool Field

Scale maxSignalInitialPtcOutlierFit and maxDeltaInitialPtcOutlierFit by approximate gain? If yes then maxSignalInitialPtcOutlierFit and maxDeltaInitialPtcOutlierFit are assumed to have units of electrons, otherwise adu.

sigmaClipFullFitCovariancesAstier

Default
5.0
Field type

float Field

sigma clip for full model fit for FULLCOVARIANCE ptcFitType

sigmaCutPtcOutliers

Default
5.0
Field type

float Field

Sigma cut for outlier rejection in PTC.

startLongRangeCovariances

Default
4
Field type

int Field

If doSubtractLongRangeCovariances is True, subtract covariances beyond this range. It should be less than maximumRangeCovariancesAstier.