|
def | __init__ (self, args, kwargs) |
|
def | runDataRef (self, dataRef, visitPairs) |
|
def | measureMeanVarPair (self, exposure1, exposure2, region=None) |
|
def | funcPolynomial (self, pars, x) |
|
def | funcAstier (self, pars, x) |
|
def | calculateLinearityResidualAndLinearizers (self, exposureTimeVector, meanSignalVector) |
|
def | fitPtcAndNonLinearity (self, dataset, tableArray, ptcFitType) |
|
def | plot (self, dataRef, dataset, ptcFitType) |
|
A class to calculate, fit, and plot a PTC from a set of flat pairs.
The Photon Transfer Curve (var(signal) vs mean(signal)) is a standard tool
used in astronomical detectors characterization (e.g., Janesick 2001,
Janesick 2007). This task calculates the PTC from a series of pairs of
flat-field images; each pair taken at identical exposure times. The
difference image of each pair is formed to eliminate fixed pattern noise,
and then the variance of the difference image and the mean of the average image
are used to produce the PTC. An n-degree polynomial or the approximation in Equation
16 of Astier+19 ("The Shape of the Photon Transfer Curve of CCD sensors",
arXiv:1905.08677) can be fitted to the PTC curve. These models include
parameters such as the gain (e/ADU) and readout noise.
Parameters
----------
*args: `list`
Positional arguments passed to the Task constructor. None used at this
time.
**kwargs: `dict`
Keyword arguments passed on to the Task constructor. None used at this
time.
Definition at line 244 of file ptc.py.
def lsst.cp.pipe.ptc.MeasurePhotonTransferCurveTask.calculateLinearityResidualAndLinearizers |
( |
|
self, |
|
|
|
exposureTimeVector, |
|
|
|
meanSignalVector |
|
) |
| |
Calculate linearity residual and fit an n-order polynomial to the mean vs time curve
to produce corrections (deviation from linear part of polynomial) for a particular amplifier
to populate LinearizeLookupTable. Use quadratic and linear parts of this polynomial to approximate
c0 for LinearizeSquared."
Parameters
---------
exposureTimeVector: `list` of `np.float`
List of exposure times for each flat pair
meanSignalVector: `list` of `np.float`
List of mean signal from diference image of flat pairs
Returns
-------
c0: `np.float`
Coefficient for LinearizeSquared, where corrImage = uncorrImage + c0*uncorrImage^2.
c0 ~ -k2/(k1^2), where k1 and k2 are fit from
meanSignalVector = k0 + k1*exposureTimeVector + k2*exposureTimeVector^2 +...
+ kn*exposureTimeVector^n, with n = "polynomialFitDegreeNonLinearity".
linearizerTableRow: list of `np.float`
One dimensional array with deviation from linear part of n-order polynomial fit
to mean vs time curve. This array will be one row (for the particular amplifier at hand)
of the table array for LinearizeLookupTable.
linResidual: list of `np.float`
Linearity residual from the mean vs time curve, defined as
100*(1 - meanSignalReference/expTimeReference/(meanSignal/expTime).
parsFit: list of `np.float`
Parameters from n-order polynomial fit to mean vs time curve.
parsFitErr: list of `np.float`
Parameters from n-order polynomial fit to mean vs time curve.
Definition at line 607 of file ptc.py.
def lsst.cp.pipe.ptc.MeasurePhotonTransferCurveTask.fitPtcAndNonLinearity |
( |
|
self, |
|
|
|
dataset, |
|
|
|
tableArray, |
|
|
|
ptcFitType |
|
) |
| |
Fit the photon transfer curve and calculate linearity and residuals.
Fit the photon transfer curve with either a polynomial of the order
specified in the task config, or using the Astier approximation.
Sigma clipping is performed iteratively for the fit, as well as an
initial clipping of data points that are more than
config.initialNonLinearityExclusionThreshold away from lying on a
straight line. This other step is necessary because the photon transfer
curve turns over catastrophically at very high flux (because saturation
drops the variance to ~0) and these far outliers cause the initial fit
to fail, meaning the sigma cannot be calculated to perform the
sigma-clipping.
Parameters
----------
dataset : `lsst.cp.pipe.ptc.PhotonTransferCurveDataset`
The dataset containing the means, variances and exposure times
ptcFitType : `str`
Fit a 'POLYNOMIAL' (degree: 'polynomialFitDegree') or
'ASTIERAPPROXIMATION' to the PTC
tableArray : `np.array`
Look-up table array with size rows=nAmps and columns=ADU values
Definition at line 684 of file ptc.py.
def lsst.cp.pipe.ptc.MeasurePhotonTransferCurveTask.measureMeanVarPair |
( |
|
self, |
|
|
|
exposure1, |
|
|
|
exposure2, |
|
|
|
region = None |
|
) |
| |
Calculate the mean signal of two exposures and the variance of their difference.
Parameters
----------
exposure1 : `lsst.afw.image.exposure.exposure.ExposureF`
First exposure of flat field pair.
exposure2 : `lsst.afw.image.exposure.exposure.ExposureF`
Second exposure of flat field pair.
region : `lsst.geom.Box2I`
Region of each exposure where to perform the calculations (e.g, an amplifier).
Return
------
mu : `np.float`
0.5*(mu1 + mu2), where mu1, and mu2 are the clipped means of the regions in
both exposures.
varDiff : `np.float`
Half of the clipped variance of the difference of the regions inthe two input
exposures.
Definition at line 370 of file ptc.py.