|
def | runQuantum (self, butlerQC, inputRefs, outputRefs) |
|
def | run (self, inputPtc, camera, inputDims) |
|
def | irlsFit (self, initialParams, dataX, dataY, function, weightsY=None) |
|
def | debugFit (self, stepname, xVector, yVector, yModel, mask, ampName) |
|
Fit the linearity from the PTC dataset.
Definition at line 111 of file linearity.py.
◆ debugFit()
def lsst.cp.pipe.linearity.LinearitySolveTask.debugFit |
( |
|
self, |
|
|
|
stepname, |
|
|
|
xVector, |
|
|
|
yVector, |
|
|
|
yModel, |
|
|
|
mask, |
|
|
|
ampName |
|
) |
| |
Debug method for linearity fitting.
Parameters
----------
stepname : `str`
A label to use to check if we care to debug at a given
line of code.
xVector : `numpy.array`
The values to use as the independent variable in the
linearity fit.
yVector : `numpy.array`
The values to use as the dependent variable in the
linearity fit.
yModel : `numpy.array`
The values to use as the linearized result.
mask : `numpy.array` [ `bool` ], optional
A mask to indicate which entries of ``xVector`` and
``yVector`` to keep.
ampName : `str`
Amplifier name to lookup linearity correction values.
Definition at line 376 of file linearity.py.
◆ irlsFit()
def lsst.cp.pipe.linearity.LinearitySolveTask.irlsFit |
( |
|
self, |
|
|
|
initialParams, |
|
|
|
dataX, |
|
|
|
dataY, |
|
|
|
function, |
|
|
|
weightsY = None |
|
) |
| |
Iteratively reweighted least squares fit.
This uses the `lsst.cp.pipe.utils.fitLeastSq`, but applies
weights based on the Cauchy distribution to the fitter. See
e.g. Holland and Welsch, 1977, doi:10.1080/03610927708827533
Parameters
----------
initialParams : `list` [`float`]
Starting parameters.
dataX : `numpy.array` [`float`]
Abscissa data.
dataY : `numpy.array` [`float`]
Ordinate data.
function : callable
Function to fit.
weightsY : `numpy.array` [`float`]
Weights to apply to the data.
Returns
-------
polyFit : `list` [`float`]
Final best fit parameters.
polyFitErr : `list` [`float`]
Final errors on fit parameters.
chiSq : `float`
Reduced chi squared.
weightsY : `list` [`float`]
Final weights used for each point.
Definition at line 332 of file linearity.py.
◆ run()
def lsst.cp.pipe.linearity.LinearitySolveTask.run |
( |
|
self, |
|
|
|
inputPtc, |
|
|
|
camera, |
|
|
|
inputDims |
|
) |
| |
Fit non-linearity to PTC data, returning the correct Linearizer
object.
Parameters
----------
inputPtc : `lsst.cp.pipe.PtcDataset`
Pre-measured PTC dataset.
camera : `lsst.afw.cameraGeom.Camera`
Camera geometry.
inputDims : `lsst.daf.butler.DataCoordinate` or `dict`
DataIds to use to populate the output calibration.
Returns
-------
results : `lsst.pipe.base.Struct`
The results struct containing:
``outputLinearizer`` : `lsst.ip.isr.Linearizer`
Final linearizer calibration.
``outputProvenance`` : `lsst.ip.isr.IsrProvenance`
Provenance data for the new calibration.
Notes
-----
This task currently fits only polynomial-defined corrections,
where the correction coefficients are defined such that:
corrImage = uncorrImage + sum_i c_i uncorrImage^(2 + i)
These `c_i` are defined in terms of the direct polynomial fit:
meanVector ~ P(x=timeVector) = sum_j k_j x^j
such that c_(j-2) = -k_j/(k_1^j) in units of DN^(1-j) (c.f.,
Eq. 37 of 2003.05978). The `config.polynomialOrder` or
`config.splineKnots` define the maximum order of x^j to fit.
As k_0 and k_1 are degenerate with bias level and gain, they
are not included in the non-linearity correction.
Definition at line 137 of file linearity.py.
◆ runQuantum()
def lsst.cp.pipe.linearity.LinearitySolveTask.runQuantum |
( |
|
self, |
|
|
|
butlerQC, |
|
|
|
inputRefs, |
|
|
|
outputRefs |
|
) |
| |
Ensure that the input and output dimensions are passed along.
Parameters
----------
butlerQC : `lsst.daf.butler.butlerQuantumContext.ButlerQuantumContext`
Butler to operate on.
inputRefs : `lsst.pipe.base.connections.InputQuantizedConnection`
Input data refs to load.
ouptutRefs : `lsst.pipe.base.connections.OutputQuantizedConnection`
Output data refs to persist.
Definition at line 117 of file linearity.py.
◆ ConfigClass
The documentation for this class was generated from the following file: