PlotPhotonTransferCurveTask#

class lsst.cp.pipe.PlotPhotonTransferCurveTask(*, config: PipelineTaskConfig | None = None, log: logging.Logger | LsstLogAdapter | None = None, initInputs: dict[str, Any] | None = None, **kwargs: Any)#

Bases: PipelineTask

A class to plot the dataset from MeasurePhotonTransferCurveTask.

Parameters#

outDirstr, optional

Path to the output directory where the final PDF will be placed.

signalElectronsRelativeAfloat, optional

Signal value for relative systematic bias between different methods of estimating a_ij (Fig. 15 of Astier+19).

plotNormalizedCovariancesNumberOfBinsfloat, optional

Number of bins in plotNormalizedCovariancesNumber function (Fig. 8, 10., of Astier+19).

Notes#

See DM-36388 for usage exammple.

Methods Summary

ab_vs_dist(aDict, bDict[, bRange])

Fig.

binData(x, y, binIndex[, wy])

Bin data (usually for display purposes).

indexForBins(x, nBins)

Builds an index with regular binning.

plotAcoeffsSum(aDict, bDict)

Fig.

plotCovariances(mu, covs, covsModel, ...)

Plot covariances and models: Cov00, Cov10, Cov01.

plotNormalizedCovariances(i, j, inputMu, ...)

Plot C_ij/mu vs mu.

plotRelativeBiasACoeffs(aDict, aDictNoB, ...)

Fig.

plot_a_b(aDict, bDict[, bRange])

Fig.

run(inputPtcDataset[, camera])

Make the plots for the PTC task.

runQuantum(butlerQC, inputRefs, outputRefs)

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

Methods Documentation

static ab_vs_dist(aDict, bDict, bRange=4)#

Fig. 13 of Astier+19.

Values of a and b arrays fits, averaged over amplifiers, as a function of distance.

Parameters#

aDictdict [numpy.array]

Dictionary keyed by amp names containing the fitted ‘a’ coefficients from the model in Eq. 20 of Astier+19 (if ptcFitType is FULLCOVARIANCE).

bDictdict [numpy.array]

Dictionary keyed by amp names containing the fitted ‘b’ coefficients from the model in Eq. 20 of Astier+19 (if ptcFitType is FULLCOVARIANCE).

bRangeint

Maximum lag for b arrays.

static binData(x, y, binIndex, wy=None)#

Bin data (usually for display purposes).

Parameters#

xnumpy.array

Data to bin.

ynumpy.array

Data to bin.

binIdexlist

Bin number of each datum.

wynumpy.array

Inverse rms of each datum to use when averaging (the actual weight is wy**2).

Returns#

xbinnumpy.array

Binned data in x.

ybinnumpy.array

Binned data in y.

wybinnumpy.array

Binned weights in y, computed from wy’s in each bin.

sybinnumpy.array

Uncertainty on the bin average, considering actual scatter, and ignoring weights.

static indexForBins(x, nBins)#

Builds an index with regular binning. The result can be fed into binData.

Parameters#

xnumpy.array

Data to bin.

nBinsint

Number of bin.

Returns#

np.digitize(x, bins): numpy.array

Bin indices.

static plotAcoeffsSum(aDict, bDict)#

Fig. 14. of Astier+19

Cumulative sum of a_ij as a function of maximum separation. This plot displays the average over channels.

Parameters#

aDictdict [numpy.array]

Dictionary keyed by amp names containing the fitted ‘a’ coefficients from the model in Eq. 20 of Astier+19 (if ptcFitType is FULLCOVARIANCE).

bDictdict [numpy.array]

Dictionary keyed by amp names containing the fitted ‘b’ coefficients from the model in Eq. 20 of Astier+19 (if ptcFitType is FULLCOVARIANCE).

static plotCovariances(mu, covs, covsModel, covsWeights, covsNoB, covsModelNoB, covsWeightsNoB, gainDict, noiseDict, aDict, bDict)#

Plot covariances and models: Cov00, Cov10, Cov01.

Figs. 6 and 7 of Astier+19

Parameters#

mudict [str, list]

Dictionary keyed by amp name with mean signal values.

covsdict [str, list]

Dictionary keyed by amp names containing a list of measued covariances per mean flux.

covsModeldict [str, list]

Dictionary keyed by amp names containinging covariances model (Eq. 20 of Astier+19) per mean flux.

covsWeightsdict [str, list]

Dictionary keyed by amp names containinging sqrt. of covariances weights.

covsNoBdict [str, list]

Dictionary keyed by amp names containing a list of measued covariances per mean flux (‘b’=0 in Astier+19).

covsModelNoBdict [str, list]

Dictionary keyed by amp names containing covariances model (with ‘b’=0 in Eq. 20 of Astier+19) per mean flux.

covsWeightsNoBdict [str, list]

Dictionary keyed by amp names containing sqrt. of covariances weights (‘b’ = 0 in Eq. 20 of Astier+19).

gainDictdict [str, float]

Dictionary keyed by amp names containing the gains in e-/ADU.

noiseDictdict [str, float]

Dictionary keyed by amp names containing the rms redout noise in e-.

aDictdict [str, numpy.array]

Dictionary keyed by amp names containing ‘a’ coefficients (Eq. 20 of Astier+19).

bDictdict [str, numpy.array]

Dictionary keyed by amp names containing ‘b’ coefficients (Eq. 20 of Astier+19).

plotNormalizedCovariances(i, j, inputMu, covs, covsModel, covsWeights, covsNoB, covsModelNoB, covsWeightsNoB, offset=0.004, numberOfBins=10, plotData=True, topPlot=False)#

Plot C_ij/mu vs mu.

Figs. 8, 10, and 11 of Astier+19

Parameters#

iint

Covariance lag.

jint

Covariance lag.

inputMudict [str, list]

Dictionary keyed by amp name with mean signal values.

covsdict [str, list]

Dictionary keyed by amp names containing a list of measued covariances per mean flux.

covsModeldict [str, list]

Dictionary keyed by amp names containinging covariances model (Eq. 20 of Astier+19) per mean flux.

covsWeightsdict [str, list]

Dictionary keyed by amp names containinging sqrt. of covariances weights.

covsNoBdict [str, list]

Dictionary keyed by amp names containing a list of measued covariances per mean flux (‘b’=0 in Astier+19).

covsModelNoBdict [str, list]

Dictionary keyed by amp names containing covariances model (with ‘b’=0 in Eq. 20 of Astier+19) per mean flux.

covsWeightsNoBdict [str, list]

Dictionary keyed by amp names containing sqrt. of covariances weights (‘b’ = 0 in Eq. 20 of Astier+19).

expIdMaskdict [str, list]

Dictionary keyed by amp names containing the masked exposure pairs.

offsetfloat, optional

Constant offset factor to plot covariances in same panel (so they don’t overlap).

numberOfBinsint, optional

Number of bins for top and bottom plot.

plotDatabool, optional

Plot the data points?

topPlotbool, optional

Plot the top plot with the covariances, and the bottom plot with the model residuals?

static plotRelativeBiasACoeffs(aDict, aDictNoB, fullCovsModel, fullCovsModelNoB, signalElectrons, gainDict, maxr=None)#

Fig. 15 in Astier+19.

Illustrates systematic bias from estimating ‘a’ coefficients from the slope of correlations as opposed to the full model in Astier+19.

Parameters#

aDictdict

Dictionary of ‘a’ matrices (Eq. 20, Astier+19), with amp names as keys.

aDictNoBdict

Dictionary of ‘a’ matrices (‘b’= 0 in Eq. 20, Astier+19), with amp names as keys.

fullCovsModeldict [str, list]

Dictionary keyed by amp names containing covariances model per mean flux.

fullCovsModelNoBdict [str, list]

Dictionary keyed by amp names containing covariances model (with ‘b’=0 in Eq. 20 of Astier+19) per mean flux.

signalElectronsfloat

Signal at which to evaluate the a_ij coefficients.

gainDictdict [str, float]

Dicgionary keyed by amp names with the gains in e-/ADU.

maxrint, optional

Maximum lag.

static plot_a_b(aDict, bDict, bRange=3)#

Fig. 12 of Astier+19

Color display of a and b arrays fits, averaged over channels.

Parameters#

aDictdict [numpy.array]

Dictionary keyed by amp names containing the fitted ‘a’ coefficients from the model in Eq. 20 of Astier+19 (if ptcFitType is FULLCOVARIANCE).

bDictdict [numpy.array]

Dictionary keyed by amp names containing the fitted ‘b’ coefficients from the model in Eq. 20 of Astier+19 (if ptcFitType is FULLCOVARIANCE).

bRangeint

Maximum lag for b arrays.

run(inputPtcDataset, camera=None)#

Make the plots for the PTC task.

Parameters#

inputPtcDatasetlsst.ip.isr.PhotonTransferCurveDataset

Output dataset from Photon Transfer Curve task.

cameralsst.afw.cameraGeom.Camera

Camera to use for camera geometry information.

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.