|
lsst.ip.isr gd2a69bfd97+615bb6ce9e
|
Public Member Functions | |
| __init__ (self, ampNames=[], ptcFitType=None, covMatrixSide=1, covMatrixSideFullCovFit=None, **kwargs) | |
| setAmpValuesPartialDataset (self, ampName, inputExpIdPair=(-1, -1), inputExpPairMjdStart=np.nan, rawExpTime=np.nan, rawMean=np.nan, rawVar=np.nan, rawDelta=np.nan, rowMeanVariance=np.nan, photoCharge=np.nan, photoChargeDelta=np.nan, ampOffset=np.nan, expIdMask=False, expIdRolloffMask=False, nPixelCovariance=-1, covariance=None, covSqrtWeights=None, gain=np.nan, noise=np.nan, overscanMedianLevel=np.nan, histVar=np.nan, histChi2Dof=np.nan, kspValue=0.0) | |
| setAuxValuesPartialDataset (self, auxDict) | |
| updateMetadata (self, **kwargs) | |
| fromDict (cls, dictionary) | |
| toDict (self) | |
| fromTable (cls, tableList) | |
| toTable (self) | |
| fromDetector (self, detector) | |
| appendPartialPtc (self, partialPtc) | |
| sort (self, sortIndex) | |
| getExpIdsUsed (self, ampName) | |
| getGoodAmps (self) | |
| getGoodPoints (self, ampName) | |
| validateGainNoiseTurnoffValues (self, ampName, doWarn=False) | |
| evalPtcModel (self, mu) | |
| requiredAttributes (self) | |
| requiredAttributes (self, value) | |
| __str__ (self) | |
| __eq__ (self, other) | |
| metadata (self) | |
| getMetadata (self) | |
| setMetadata (self, metadata) | |
| updateMetadataFromExposures (self, exposures) | |
| calibInfoFromDict (self, dictionary) | |
| determineCalibClass (cls, metadata, message) | |
| readText (cls, filename, **kwargs) | |
| writeText (self, filename, format="auto") | |
| readFits (cls, filename, **kwargs) | |
| writeFits (self, filename) | |
| validate (self, other=None) | |
| apply (self, target) | |
Public Attributes | |
| str | ptcFitType = ptcFitType |
| ampNames = ampNames | |
| covMatrixSide = covMatrixSide | |
| covMatrixSideFullCovFit = covMatrixSide | |
| list | badAmps = [] |
| dict | inputExpIdPairs = {ampName: [] for ampName in ampNames} |
| dict | inputExpPairMjdStartList = {ampName: np.array([]) for ampName in ampNames} |
| dict | expIdMask = {ampName: np.array([], dtype=bool) for ampName in ampNames} |
| dict | expIdRolloffMask = {ampName: np.array([], dtype=bool) for ampName in ampNames} |
| dict | rawExpTimes = {ampName: np.array([]) for ampName in ampNames} |
| dict | rawMeans = {ampName: np.array([]) for ampName in ampNames} |
| dict | rawVars = {ampName: np.array([]) for ampName in ampNames} |
| dict | rawDeltas = {ampName: np.array([]) for ampName in ampNames} |
| dict | rowMeanVariance = {ampName: np.array([]) for ampName in ampNames} |
| dict | photoCharges = {ampName: np.array([]) for ampName in ampNames} |
| dict | photoChargeDeltas = {ampName: np.array([]) for ampName in ampNames} |
| dict | ampOffsets = {ampName: np.array([]) for ampName in ampNames} |
| dict | gain = {ampName: np.nan for ampName in ampNames} |
| dict | gainUnadjusted = {ampName: np.nan for ampName in ampNames} |
| dict | gainErr = {ampName: np.nan for ampName in ampNames} |
| dict | gainList = {ampName: np.array([]) for ampName in ampNames} |
| dict | overscanMedianLevelList = {ampName: np.array([]) for ampName in ampNames} |
| dict | overscanMedian = {ampName: np.nan for ampName in ampNames} |
| dict | overscanMedianSigma = {ampName: np.nan for ampName in ampNames} |
| dict | noiseList = {ampName: np.array([]) for ampName in ampNames} |
| dict | noise = {ampName: np.nan for ampName in ampNames} |
| dict | noiseErr = {ampName: np.nan for ampName in ampNames} |
| dict | histVars = {ampName: np.array([]) for ampName in ampNames} |
| dict | histChi2Dofs = {ampName: np.array([]) for ampName in ampNames} |
| dict | kspValues = {ampName: np.array([]) for ampName in ampNames} |
| dict | ptcFitPars = {ampName: np.array([]) for ampName in ampNames} |
| dict | ptcFitParsError = {ampName: np.array([]) for ampName in ampNames} |
| dict | ptcFitChiSq = {ampName: np.nan for ampName in ampNames} |
| dict | ptcTurnoff = {ampName: np.nan for ampName in ampNames} |
| dict | ptcTurnoffSamplingError = {ampName: np.nan for ampName in ampNames} |
| dict | ptcRolloff = {ampName: np.nan for ampName in ampNames} |
| dict | ptcRolloffError = {ampName: np.nan for ampName in ampNames} |
| dict | ptcRolloffTau = {ampName: np.nan for ampName in ampNames} |
| dict | ptcRolloffTauError = {ampName: np.nan for ampName in ampNames} |
| dict | nPixelCovariances = {ampName: -1 for ampName in ampNames} |
| dict | covariances = {ampName: np.array([]) for ampName in ampNames} |
| dict | covariancesModel = {ampName: np.array([]) for ampName in ampNames} |
| dict | covariancesSqrtWeights = {ampName: np.array([]) for ampName in ampNames} |
| dict | aMatrix = {ampName: np.array([]) for ampName in ampNames} |
| dict | bMatrix = {ampName: np.array([]) for ampName in ampNames} |
| dict | noiseMatrix = {ampName: np.array([]) for ampName in ampNames} |
| dict | finalVars = {ampName: np.array([]) for ampName in ampNames} |
| dict | finalModelVars = {ampName: np.array([]) for ampName in ampNames} |
| dict | finalMeans = {ampName: np.array([]) for ampName in ampNames} |
| dict | auxValues = {} |
| requiredAttributes = set(["_OBSTYPE", "_SCHEMA", "_VERSION"]) | |
| log = log if log else logging.getLogger(__name__) | |
Protected Member Functions | |
| _validateCovarianceMatrixSizes (self) | |
Protected Attributes | |
| _instrument = None | |
| _raftName = None | |
| _slotName = None | |
| _detectorName = None | |
| _detectorSerial = None | |
| _detectorId = None | |
| _filter = None | |
| str | _calibId = None |
| _seqfile = None | |
| _seqname = None | |
| _seqcksum = None | |
| _metadata = PropertyList() | |
| _requiredAttributes | |
Static Protected Attributes | |
| str | _OBSTYPE = "generic" |
| str | _SCHEMA = "NO SCHEMA" |
| int | _VERSION = 0 |
A simple class to hold the output data from the PTC task.
The dataset is made up of a dictionary for each item, keyed by the
amplifiers' names, which much be supplied at construction time.
New items cannot be added to the class to save accidentally saving to the
wrong property, and the class can be frozen if desired.
inputExpIdPairs records the exposures used to produce the data.
When fitPtc() or fitCovariancesAstier() is run, a mask is built up, which
is by definition always the same length as inputExpIdPairs, rawExpTimes,
rawMeans and rawVars, and is a list of bools, which are incrementally set
to False as points are discarded from the fits.
Parameters
----------
ampNames : `list`
List with the names of the amplifiers of the detector at hand.
ptcFitType : `str`, optional
Type of model fitted to the PTC: "EXPAPPROXIMATION",
or "FULLCOVARIANCE" or "FULLCOVARIANCE_NO_B".
covMatrixSide : `int`, optional
Maximum lag of measured covariances (size of square covariance
matrices).
covMatrixSideFullCovFit : `int`, optional
Maximum covariances lag for FULLCOVARIANCE fit. It should be less or
equal than covMatrixSide.
kwargs : `dict`, optional
Other keyword arguments to pass to the parent init.
Notes
-----
The stored attributes are:
badAmps : `list` [`str`]
List with bad amplifiers names.
inputExpIdPairs : `dict`, [`str`, `list`]
Dictionary keyed by amp names containing the input exposures IDs.
inputExpPairMjdStartList : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the start mjd from
the first exposure in each flat pair.
expIdMask : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the mask produced after
outlier rejection. The mask produced by the "FULLCOVARIANCE"
option may differ from the one produced in the other two PTC
fit types.
expIdRolloffMask : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the mask produced after
outlier rejection and extended to fit the PTC rolloff.
rawExpTimes : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the unmasked exposure times.
rawMeans : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the unmasked average of the
means of the exposures in each flat pair (units: adu).
rawVars : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the variance of the
difference image of the exposures in each flat pair (units: adu^2).
rawDeltas : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the scaled unmasked delta of
the means of the exposures in each flat pair (mean2 - mean1)
(units: adu).
rowMeanVariance : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the variance of the
means of the rows of the difference image of the exposures
in each flat pair (units: adu^2).
histVars : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the variance of the
difference image of the exposures in each flat pair estimated
by fitting a Gaussian model.
histChi2Dofs : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the chi-squared per degree
of freedom fitting the difference image to a Gaussian model.
kspValues : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the KS test p-value from
fitting the difference image to a Gaussian model.
gain : `dict`, [`str`, `float`]
Dictionary keyed by amp names containing the fitted gains. May be
adjusted by amp-offset gain ratios if configured in PTC solver.
gainUnadjusted : `dict`, [`str`, `float`]
Dictionary keyed by amp names containing unadjusted (raw) fit gain
values. May be the same as gain values if amp-offset adjustment
is not turned on.
gainErr : `dict`, [`str`, `float`]
Dictionary keyed by amp names containing the errors on the
fitted gains.
gainList : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the gain estimated from
each flat pair.
overscanMedianLevelList : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the median overscan
level from each input flat pair (units: adu).
overscanMedian : `dict `, [`str`, `float`]
Dictionary keyed by amp names containing the median of
overscanMedianLevelList[expIdMask] (units: adu).
overscanMedianSigma : `dict `, [`str`, `float`]
Dictionary keyed by amp names containing the median absolute
deviation of overscanMedianLevelList[expIdMask] (units: adu).
noiseList : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the mean overscan
standard deviation from each flat pair (units: adu).
noise : `dict`, [`str`, `float`]
Dictionary keyed by amp names containing the fitted noise
(units: electron).
noiseErr : `dict`, [`str`, `float`]
Dictionary keyed by amp names containing the errors on the fitted
noise (units: electron).
ampOffsets : `dict`, [`str`, `float`]
Dictionary keyed by amp names containing amp-to-amp offsets
(units: adu).
ptcFitPars : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the raveled array fitted
parameters of the PTC model.
ptcFitParsError : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the raveled array errors
on the fitted parameters of the PTC model for ptcFitType.
ptcFitChiSq : `dict`, [`str`, `float`]
Dictionary keyed by amp names containing the reduced chi squared
of the fit.
ptcTurnoff : `dict` [`str, `float`]
Flux value (in adu) where the variance of the PTC curve starts
decreasing consistently.
ptcTurnoffSamplingError : `dict` [`str`, `float`]
``Sampling`` error on the ptcTurnoff, based on the flux sampling
of the input PTC (units: adu).
ptcRolloff : `dict` [`str, `float`]
Flux value (in adu) where the variance of the PTC curve begins starts
to move away from the PTC model by some threshold.
ptcRolloffError : `dict` [`str`, `float`]
Covariance error from the fit to the PTC rolloff (units: adu).
ptcRolloff : `dict` [`str, `float`]
Curvature parameter of the PTC rolloff.
ptcRolloffError : `dict` [`str`, `float`]
Fitting error of the curvature parameter of the PTC rolloff.
nPixelCovariances : `dict`, [`str`, `int`]
Dictionary keyed by amp names containing the number of pixels
that were used to measure the covariances.
covariances : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing a list of measured
covariances per mean flux (units: adu^2).
covariancesModel : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containinging covariances model
(Eq. 20 of Astier+19) per mean flux (units: adu^2).
covariancesSqrtWeights : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containinging sqrt. of covariances
weights (units: 1/adu).
aMatrix : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the "a" parameters from
the model in Eq. 20 of Astier+19 (units: 1/electron).
bMatrix : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the "b" parameters from
the model in Eq. 20 of Astier+19 (units: 1/electron).
noiseMatrix : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the "noise" parameters from
the model in Eq. 20 of Astier+19 (units: electron^2).
covariancesModelNoB : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing covariances model
(with 'b'=0 in Eq. 20 of Astier+19) per mean flux (units:
adu^2). Will be removed after v29.
aMatrixNoB : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the "a" parameters from the
model in Eq. 20 of Astier+19 (and 'b' = 0) (units: 1/electron).
Will be removed after v29.
noiseMatrixNoB : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the "noise" parameters from
the model in Eq. 20 of Astier+19, with 'b' = 0 (units: electron^2).
Will be removed after v29.
finalVars : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the masked variance of the
difference image of each flat
pair. If needed, each array will be right-padded with
np.nan to match the length of rawExpTimes.
finalModelVars : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the masked modeled
variance of the difference image of each flat pair. If needed, each
array will be right-padded with np.nan to match the length of
rawExpTimes.
finalMeans : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the masked average of the
means of the exposures in each flat pair. If needed, each array
will be right-padded with np.nan to match the length of
rawExpTimes.
photoCharges : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the integrated photocharge
for linearity calibration.
photoChargeDeltas : `dict`, [`str`, `np.ndarray`]
Dictionary keyed by amp names containing the delta for the integrated
photocharge (photocharge2 - photocharge1).
auxValues : `dict`, [`str`, `np.ndarray`]
Dictionary of per-detector auxiliary header values that can be used
for PTC, linearity computation.
Version 1.1 adds the `ptcTurnoff` attribute.
Version 1.2 adds the `histVars`, `histChi2Dofs`, and `kspValues`
attributes.
Version 1.3 adds the `noiseMatrix` and `noiseMatrixNoB` attributes.
Version 1.4 adds the `auxValues` attribute.
Version 1.5 adds the `covMatrixSideFullCovFit` attribute.
Version 1.6 adds the `rowMeanVariance` attribute.
Version 1.7 adds the `noiseList` attribute.
Version 1.8 adds the `ptcTurnoffSamplingError` attribute.
Version 1.9 standardizes PTC noise units to electron.
Version 2.0 adds the `ampOffsets`, `gainUnadjusted`, and
`gainList` attributes.
Version 2.1 deprecates the `covariancesModelNoB`, `aMatrixNoB`, and
`noiseMatrixNoB` attributes.
Version 2.2 adds the `overscanMedianLevelList` and
`inputExpPairMjdStartList` attributes.
Version 2.3 adds the `overscanMedian` and
`overscanMedianSigma` attrbutes.
Version 2.4 adds the `nPixelCovariances` attribute.
Version 2.5 adds the `rawDeltas` and `photoChargeDeltas` attributes.
Version 2.6 adds the `expIdRolloffMask`, `ptcRolloff`, `ptcRolloffError`,
`ptcRolloffTau`, and `ptcRolloffTauError` attributes. Also
deprecates the POLYNOMIAL fit type.
Definition at line 66 of file ptcDataset.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.__init__ | ( | self, | |
| ampNames = [], | |||
| ptcFitType = None, | |||
| covMatrixSide = 1, | |||
| covMatrixSideFullCovFit = None, | |||
| ** | kwargs ) |
Definition at line 299 of file ptcDataset.py.
|
inherited |
Calibration equivalence. Running ``calib.log.setLevel(0)`` enables debug statements to identify problematic fields.
Definition at line 105 of file calibType.py.
|
inherited |
Definition at line 102 of file calibType.py.
|
protected |
Ensure covMatrixSideFullCovFit <= covMatrixSide.
Definition at line 1486 of file ptcDataset.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.appendPartialPtc | ( | self, | |
| partialPtc ) |
Append a partial PTC dataset to this dataset.
Parameters
----------
partialPtc : `lsst.ip.isr.PhotonTransferCurveDataset`
Partial PTC to append. Should only have one element.
Definition at line 1109 of file ptcDataset.py.
|
inherited |
Method to apply the calibration to the target object.
Parameters
----------
target : `object`
Thing to validate against.
Returns
-------
valid : `bool`
Returns true if the calibration was applied correctly.
Raises
------
NotImplementedError
Raised if not implemented.
Definition at line 706 of file calibType.py.
|
inherited |
Handle common keywords.
This isn't an ideal solution, but until all calibrations
expect to find everything in the metadata, they still need to
search through dictionaries.
Parameters
----------
dictionary : `dict` or `lsst.daf.base.PropertyList`
Source for the common keywords.
Raises
------
RuntimeError
Raised if the dictionary does not match the expected OBSTYPE.
Definition at line 325 of file calibType.py.
|
inherited |
Attempt to find calibration class in metadata.
Parameters
----------
metadata : `dict` or `lsst.daf.base.PropertyList`
Metadata possibly containing a calibration class entry.
message : `str`
Message to include in any errors.
Returns
-------
calibClass : `object`
The class to use to read the file contents. Should be an
`lsst.ip.isr.IsrCalib` subclass.
Raises
------
ValueError
Raised if the resulting calibClass is the base
`lsst.ip.isr.IsrClass` (which does not implement the
content methods).
Definition at line 391 of file calibType.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.evalPtcModel | ( | self, | |
| mu ) |
Computes the covariance model at specific signal levels.
Parameters
----------
mu : `numpy.array`, (N,)
List of mean signals in ADU.
Raises
------
RuntimeError
Raised if ptcFitType is invalid.
Returns
-------
covModel : `numpy.array`, (N, M, M)
Covariances model at mu (in ADU^2).
Notes
-----
Computes the covModel for all mu, and it returns
cov[N, M, M], where the variance model is cov[:,0,0].
Both mu and cov are in ADUs and ADUs squared. This
routine evaluates the approximation in Eq. 16 of
Astier+19 (1905.08677)
if self.ptcFitType == EXPAPPROXIMATION, and Eq. 20 of
Astier+19 if self.ptcFitType == FULLCOVARIANCE(_NO_B).
The EXPAPPROXIMATION model (Eq. 16 of Astier+19) is
only an approximation for the variance (cov[0,0]),
so the function returns covModel of shape (N,),
representing an array of [C_{00}]
if self.ptcFitType == EXPAPPROXIMATION.
Definition at line 1377 of file ptcDataset.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.fromDetector | ( | self, | |
| detector ) |
Read metadata parameters from a detector.
Parameters
----------
detector : `lsst.afw.cameraGeom.detector`
Input detector with parameters to use.
Returns
-------
calib : `lsst.ip.isr.PhotonTransferCurveDataset`
The calibration constructed from the detector.
Reimplemented from lsst.ip.isr.calibType.IsrCalib.
Definition at line 1093 of file ptcDataset.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.fromDict | ( | cls, | |
| dictionary ) |
Construct a calibration from a dictionary of properties.
Must be implemented by the specific calibration subclasses.
Parameters
----------
dictionary : `dict`
Dictionary of properties.
Returns
-------
calib : `lsst.ip.isr.PhotonTransferCurveDataset`
Constructed calibration.
Raises
------
RuntimeError
Raised if the supplied dictionary is for a different
calibration.
Reimplemented from lsst.ip.isr.calibType.IsrCalib.
Definition at line 547 of file ptcDataset.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.fromTable | ( | cls, | |
| tableList ) |
Construct calibration from a list of tables.
This method uses the `fromDict` method to create the
calibration, after constructing an appropriate dictionary from
the input tables.
Parameters
----------
tableList : `list` [`lsst.afw.table.Table`]
List of tables to use to construct the datasetPtc.
Returns
-------
calib : `lsst.ip.isr.PhotonTransferCurveDataset`
The calibration defined in the tables.
Reimplemented from lsst.ip.isr.calibType.IsrCalib.
Definition at line 755 of file ptcDataset.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.getExpIdsUsed | ( | self, | |
| ampName ) |
Get the exposures used, i.e. not discarded, for a given amp.
If no mask has been created yet, all exposures are returned.
Parameters
----------
ampName : `str`
Returns
-------
expIdsUsed : `list` [`tuple`]
List of pairs of exposure ids used in PTC.
Definition at line 1285 of file ptcDataset.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.getGoodAmps | ( | self | ) |
Get the good amps from this PTC.
Definition at line 1319 of file ptcDataset.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.getGoodPoints | ( | self, | |
| ampName ) |
Get the good points used for a given amp in the PTC.
Parameters
----------
ampName : `str`
Amplifier's name.
Returns
-------
goodPoints : `np.ndarray`
Boolean array of good points used in PTC.
Definition at line 1323 of file ptcDataset.py.
|
inherited |
Retrieve metadata associated with this calibration.
Returns
-------
meta : `lsst.daf.base.PropertyList`
Metadata. The returned `~lsst.daf.base.PropertyList` can be
modified by the caller and the changes will be written to
external files.
Definition at line 174 of file calibType.py.
|
inherited |
Definition at line 171 of file calibType.py.
|
inherited |
Read calibration data from a FITS file.
Parameters
----------
filename : `str`
Filename to read data from.
kwargs : `dict` or collections.abc.Mapping`, optional
Set of key=value pairs to pass to the ``fromTable``
method.
Returns
-------
calib : `lsst.ip.isr.IsrCalib`
Calibration contained within the file.
Definition at line 517 of file calibType.py.
|
inherited |
Read calibration representation from a yaml/ecsv file.
Parameters
----------
filename : `str`
Name of the file containing the calibration definition.
kwargs : `dict` or collections.abc.Mapping`, optional
Set of key=value pairs to pass to the ``fromDict`` or
``fromTable`` methods.
Returns
-------
calib : `~lsst.ip.isr.IsrCalibType`
Calibration class.
Raises
------
RuntimeError
Raised if the filename does not end in ".ecsv" or ".yaml".
Definition at line 425 of file calibType.py.
|
inherited |
Definition at line 162 of file calibType.py.
|
inherited |
Definition at line 166 of file calibType.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.setAmpValuesPartialDataset | ( | self, | |
| ampName, | |||
| inputExpIdPair = (-1, -1), | |||
| inputExpPairMjdStart = np.nan, | |||
| rawExpTime = np.nan, | |||
| rawMean = np.nan, | |||
| rawVar = np.nan, | |||
| rawDelta = np.nan, | |||
| rowMeanVariance = np.nan, | |||
| photoCharge = np.nan, | |||
| photoChargeDelta = np.nan, | |||
| ampOffset = np.nan, | |||
| expIdMask = False, | |||
| expIdRolloffMask = False, | |||
| nPixelCovariance = -1, | |||
| covariance = None, | |||
| covSqrtWeights = None, | |||
| gain = np.nan, | |||
| noise = np.nan, | |||
| overscanMedianLevel = np.nan, | |||
| histVar = np.nan, | |||
| histChi2Dof = np.nan, | |||
| kspValue = 0.0 ) |
Set the amp values for a partial PTC Dataset (from cpExtractPtcTask).
Parameters
----------
ampName : `str`
Name of the amp to set the values.
inputExpIdPair : `tuple` [`int`]
Exposure IDs of input pair.
inputExpPairMjdStart : `float`, optional
The start MJD of first exposure in the flat pair.
rawExpTime : `float`, optional
Exposure time for this exposure pair (units: sec).
rawMean : `float`, optional
Average of the means of the exposures in this pair
(units: adu).
rawVar : `float`, optional
Variance of the difference of the exposures in this pair
(units: adu^2).
rawDelta : `float`, optional
Delta of the means of the exposure in this pair
(units: adu).
rowMeanVariance : `float`, optional
Variance of the means of the rows in the difference image
of the exposures in this pair (units: adu^2).
photoCharge : `float`, optional
Integrated photocharge for flat pair for linearity calibration
(arbitrary units).
photoChargeDelta : `float`, optional
Delta between integrated photocharge for the flat pair
(arbitrary units).
ampOffset : `float`, optional
Amp offset for this amplifier.
expIdMask : `bool`, optional
Flag setting if this exposure pair should be used (True)
or not used (False).
expIdRolloffMask : `bool`, optional
Flag setting if this exposure pair should be used (True)
or not used for rolloff search (False).
nPixelCovariance : `int`, optional
Number of pixels that went into the covariance measurement.
covariance : `np.ndarray` or None, optional
Measured covariance for this exposure pair (units: adu^2).
covSqrtWeights : `np.ndarray` or None, optional
Measured sqrt of covariance weights in this exposure pair
(units: 1/adu).
gain : `float`, optional
Estimated gain for this exposure pair (units: electron/adu).
noise : `float`, optional
Estimated read noise for this exposure pair (units: electron).
overscanMedianLevel : `float`, optional
Average of the median overscan levels for this exposure pair.
(units: adu)
histVar : `float`, optional
Variance estimated from fitting a histogram with a Gaussian model
(units: adu).
histChi2Dof : `float`, optional
Chi-squared per degree of freedom from Gaussian histogram fit.
kspValue : `float`, optional
KS test p-value from the Gaussian histogram fit.
Definition at line 382 of file ptcDataset.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.setAuxValuesPartialDataset | ( | self, | |
| auxDict ) |
Set a dictionary of auxiliary values for a partial dataset.
Parameters
----------
auxDict : `dict` [`str`, `float`]
Dictionary of float values.
Definition at line 514 of file ptcDataset.py.
|
inherited |
Store a copy of the supplied metadata with this calibration.
Parameters
----------
metadata : `lsst.daf.base.PropertyList`
Metadata to associate with the calibration. Will be copied and
overwrite existing metadata.
Reimplemented in lsst.ip.isr.transmissionCurve.IntermediateTransmissionCurve.
Definition at line 186 of file calibType.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.sort | ( | self, | |
| sortIndex ) |
Sort the components of the PTC by a given sort index.
The PTC is sorted in-place.
Parameters
----------
sortIndex : `list` or `np.ndarray`
The sorting index, which must be the same length as
the number of elements of the PTC.
Definition at line 1222 of file ptcDataset.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.toDict | ( | self | ) |
Return a dictionary containing the calibration properties.
The dictionary should be able to be round-tripped through
`fromDict`.
Returns
-------
dictionary : `dict`
Dictionary of properties.
Reimplemented from lsst.ip.isr.calibType.IsrCalib.
Definition at line 678 of file ptcDataset.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.toTable | ( | self | ) |
Construct a list of tables containing the information in this
calibration.
The list of tables should create an identical calibration
after being passed to this class's fromTable method.
Returns
-------
tableList : `list` [`astropy.table.Table`]
List of tables containing the linearity calibration
information.
Reimplemented from lsst.ip.isr.calibType.IsrCalib.
Definition at line 1005 of file ptcDataset.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.updateMetadata | ( | self, | |
| ** | kwargs ) |
Update calibration metadata.
This calls the base class's method after ensuring the required
calibration keywords will be saved.
Parameters
----------
setDate : `bool`, optional
Update the CALIBDATE fields in the metadata to the current
time. Defaults to False.
kwargs :
Other keyword parameters to set in the metadata.
Reimplemented from lsst.ip.isr.calibType.IsrCalib.
Definition at line 531 of file ptcDataset.py.
|
inherited |
Extract and unify metadata information.
Parameters
----------
exposures : `list`
Exposures or other calibrations to scan.
Definition at line 294 of file calibType.py.
|
inherited |
Validate that this calibration is defined and can be used.
Parameters
----------
other : `object`, optional
Thing to validate against.
Returns
-------
valid : `bool`
Returns true if the calibration is valid and appropriate.
Reimplemented in lsst.ip.isr.linearize.Linearizer, and lsst.ip.isr.photodiodeCorrection.PhotodiodeCorrection.
Definition at line 691 of file calibType.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.validateGainNoiseTurnoffValues | ( | self, | |
| ampName, | |||
| doWarn = False ) |
Ensure the gain, read noise, and PTC turnoff have
sensible values.
Parameters
----------
ampName : `str`
Amplifier's name.
Definition at line 1338 of file ptcDataset.py.
|
inherited |
Write calibration data to a FITS file.
Parameters
----------
filename : `str`
Filename to write data to.
Returns
-------
used : `str`
The name of the file used to write the data.
Reimplemented in lsst.ip.isr.transmissionCurve.IntermediateTransmissionCurve.
Definition at line 565 of file calibType.py.
|
inherited |
Write the calibration data to a text file.
Parameters
----------
filename : `str`
Name of the file to write.
format : `str`
Format to write the file as. Supported values are:
``"auto"`` : Determine filetype from filename.
``"yaml"`` : Write as yaml.
``"ecsv"`` : Write as ecsv.
Returns
-------
used : `str`
The name of the file used to write the data. This may
differ from the input if the format is explicitly chosen.
Raises
------
RuntimeError
Raised if filename does not end in a known extension, or
if all information cannot be written.
Notes
-----
The file is written to YAML/ECSV format and will include any
associated metadata.
Definition at line 463 of file calibType.py.
|
protectedinherited |
Definition at line 76 of file calibType.py.
|
protectedinherited |
Definition at line 74 of file calibType.py.
|
protectedinherited |
Definition at line 72 of file calibType.py.
|
protectedinherited |
Definition at line 73 of file calibType.py.
|
protectedinherited |
Definition at line 75 of file calibType.py.
|
protectedinherited |
Definition at line 69 of file calibType.py.
|
protectedinherited |
Definition at line 80 of file calibType.py.
|
staticprotectedinherited |
Definition at line 64 of file calibType.py.
|
protectedinherited |
Definition at line 70 of file calibType.py.
|
protectedinherited |
Definition at line 115 of file calibType.py.
|
staticprotectedinherited |
Definition at line 65 of file calibType.py.
|
protectedinherited |
Definition at line 79 of file calibType.py.
|
protectedinherited |
Definition at line 77 of file calibType.py.
|
protectedinherited |
Definition at line 78 of file calibType.py.
|
protectedinherited |
Definition at line 71 of file calibType.py.
|
staticprotectedinherited |
Definition at line 66 of file calibType.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.aMatrix = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 353 of file ptcDataset.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.ampNames = ampNames |
Definition at line 302 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.ampOffsets = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 322 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.auxValues = {} |
Definition at line 362 of file ptcDataset.py.
| list lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.badAmps = [] |
Definition at line 309 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.bMatrix = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 354 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.covariances = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 350 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.covariancesModel = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 351 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.covariancesSqrtWeights = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 352 of file ptcDataset.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.covMatrixSide = covMatrixSide |
Definition at line 303 of file ptcDataset.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.covMatrixSideFullCovFit = covMatrixSide |
Definition at line 305 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.expIdMask = {ampName: np.array([], dtype=bool) for ampName in ampNames} |
Definition at line 313 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.expIdRolloffMask = {ampName: np.array([], dtype=bool) for ampName in ampNames} |
Definition at line 314 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.finalMeans = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 359 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.finalModelVars = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 358 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.finalVars = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 357 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.gain = {ampName: np.nan for ampName in ampNames} |
Definition at line 324 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.gainErr = {ampName: np.nan for ampName in ampNames} |
Definition at line 326 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.gainList = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 327 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.gainUnadjusted = {ampName: np.nan for ampName in ampNames} |
Definition at line 325 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.histChi2Dofs = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 336 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.histVars = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 335 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.inputExpIdPairs = {ampName: [] for ampName in ampNames} |
Definition at line 311 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.inputExpPairMjdStartList = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 312 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.kspValues = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 337 of file ptcDataset.py.
|
inherited |
Definition at line 96 of file calibType.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.noise = {ampName: np.nan for ampName in ampNames} |
Definition at line 332 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.noiseErr = {ampName: np.nan for ampName in ampNames} |
Definition at line 333 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.noiseList = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 331 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.noiseMatrix = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 355 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.nPixelCovariances = {ampName: -1 for ampName in ampNames} |
Definition at line 349 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.overscanMedian = {ampName: np.nan for ampName in ampNames} |
Definition at line 329 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.overscanMedianLevelList = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 328 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.overscanMedianSigma = {ampName: np.nan for ampName in ampNames} |
Definition at line 330 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.photoChargeDeltas = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 321 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.photoCharges = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 320 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.ptcFitChiSq = {ampName: np.nan for ampName in ampNames} |
Definition at line 341 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.ptcFitPars = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 339 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.ptcFitParsError = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 340 of file ptcDataset.py.
| lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.ptcFitType = ptcFitType |
Definition at line 301 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.ptcRolloff = {ampName: np.nan for ampName in ampNames} |
Definition at line 344 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.ptcRolloffError = {ampName: np.nan for ampName in ampNames} |
Definition at line 345 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.ptcRolloffTau = {ampName: np.nan for ampName in ampNames} |
Definition at line 346 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.ptcRolloffTauError = {ampName: np.nan for ampName in ampNames} |
Definition at line 347 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.ptcTurnoff = {ampName: np.nan for ampName in ampNames} |
Definition at line 342 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.ptcTurnoffSamplingError = {ampName: np.nan for ampName in ampNames} |
Definition at line 343 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.rawDeltas = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 318 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.rawExpTimes = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 315 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.rawMeans = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 316 of file ptcDataset.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.rawVars = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 317 of file ptcDataset.py.
|
inherited |
Definition at line 90 of file calibType.py.
| dict lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.rowMeanVariance = {ampName: np.array([]) for ampName in ampNames} |
Definition at line 319 of file ptcDataset.py.