lsst.ip.isr g16a4483606+4693bb9fa3
|
Public Member Functions | |
def | __init__ (self, ampNames=[], ptcFitType=None, covMatrixSide=1, **kwargs) |
def | setAmpValues (self, ampName, inputExpIdPair=[(np.nan, np.nan)], expIdMask=[np.nan], rawExpTime=[np.nan], rawMean=[np.nan], rawVar=[np.nan], photoCharge=[np.nan], gain=np.nan, gainErr=np.nan, noise=np.nan, noiseErr=np.nan, ptcFitPars=[np.nan], ptcFitParsError=[np.nan], ptcFitChiSq=np.nan, ptcTurnoff=np.nan, covArray=[], covArrayModel=[], covSqrtWeights=[], aMatrix=[], bMatrix=[], covArrayModelNoB=[], aMatrixNoB=[], finalVar=[np.nan], finalModelVar=[np.nan], finalMean=[np.nan]) |
def | updateMetadata (self, **kwargs) |
def | fromDict (cls, dictionary) |
def | toDict (self) |
def | fromTable (cls, tableList) |
def | toTable (self) |
def | fromDetector (self, detector) |
def | getExpIdsUsed (self, ampName) |
def | getGoodAmps (self) |
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. PTC fit parameters for polynomials are stored in a list in ascending order of polynomial term, i.e. par[0]*x^0 + par[1]*x + par[2]*x^2 etc with the length of the list corresponding to the order of the polynomial plus one. Parameters ---------- ampNames : `list` List with the names of the amplifiers of the detector at hand. ptcFitType : `str` Type of model fitted to the PTC: "POLYNOMIAL", "EXPAPPROXIMATION", or "FULLCOVARIANCE". covMatrixSide : `int` Maximum lag of covariances (size of square covariance matrices). kwargs : `dict`, optional Other keyword arguments to pass to the parent init. Notes ----- The stored attributes are: badAmps : `list` List with bad amplifiers names. inputExpIdPairs : `dict`, [`str`, `list`] Dictionary keyed by amp names containing the input exposures IDs. expIdMask : `dict`, [`str`, `list`] 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. rawExpTimes : `dict`, [`str`, `list`] Dictionary keyed by amp names containing the unmasked exposure times. rawMeans : `dict`, [`str`, `list`] Dictionary keyed by amp namescontaining the unmasked average of the means of the exposures in each flat pair. rawVars : `dict`, [`str`, `list`] Dictionary keyed by amp names containing the variance of the difference image of the exposures in each flat pair. gain : `dict`, [`str`, `list`] Dictionary keyed by amp names containing the fitted gains. gainErr : `dict`, [`str`, `list`] Dictionary keyed by amp names containing the errors on the fitted gains. noise : `dict`, [`str`, `list`] Dictionary keyed by amp names containing the fitted noise. noiseErr : `dict`, [`str`, `list`] Dictionary keyed by amp names containing the errors on the fitted noise. ptcFitPars : `dict`, [`str`, `list`] Dictionary keyed by amp names containing the fitted parameters of the PTC model for ptcFitTye in ["POLYNOMIAL", "EXPAPPROXIMATION"]. ptcFitParsError : `dict`, [`str`, `list`] Dictionary keyed by amp names containing the errors on the fitted parameters of the PTC model for ptcFitTye in ["POLYNOMIAL", "EXPAPPROXIMATION"]. ptcFitChiSq : `dict`, [`str`, `list`] Dictionary keyed by amp names containing the reduced chi squared of the fit for ptcFitTye in ["POLYNOMIAL", "EXPAPPROXIMATION"]. ptcTurnoff : `float` Flux value (in ADU) where the variance of the PTC curve starts decreasing consistently. covariances : `dict`, [`str`, `list`] Dictionary keyed by amp names containing a list of measured covariances per mean flux. covariancesModel : `dict`, [`str`, `list`] Dictionary keyed by amp names containinging covariances model (Eq. 20 of Astier+19) per mean flux. covariancesSqrtWeights : `dict`, [`str`, `list`] Dictionary keyed by amp names containinging sqrt. of covariances weights. aMatrix : `dict`, [`str`, `list`] Dictionary keyed by amp names containing the "a" parameters from the model in Eq. 20 of Astier+19. bMatrix : `dict`, [`str`, `list`] Dictionary keyed by amp names containing the "b" parameters from the model in Eq. 20 of Astier+19. covariancesModelNoB : `dict`, [`str`, `list`] Dictionary keyed by amp names containing covariances model (with 'b'=0 in Eq. 20 of Astier+19) per mean flux. aMatrixNoB : `dict`, [`str`, `list`] Dictionary keyed by amp names containing the "a" parameters from the model in Eq. 20 of Astier+19 (and 'b' = 0). finalVars : `dict`, [`str`, `list`] 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`, `list`] 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`, `list`] 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. photoCharge : `dict`, [`str`, `list`] Dictionary keyed by amp names containing the integrated photocharge for linearity calibration. Version 1.1 adds the `ptcTurnoff` attribute.
Definition at line 34 of file ptcDataset.py.
def lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.__init__ | ( | self, | |
ampNames = [] , |
|||
ptcFitType = None , |
|||
covMatrixSide = 1 , |
|||
** | kwargs | ||
) |
Reimplemented from lsst.ip.isr.calibType.IsrCalib.
Definition at line 156 of file ptcDataset.py.
def 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 591 of file ptcDataset.py.
def 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 275 of file ptcDataset.py.
def 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 411 of file ptcDataset.py.
def 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.
Definition at line 607 of file ptcDataset.py.
def lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.getGoodAmps | ( | self | ) |
Definition at line 622 of file ptcDataset.py.
def lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.setAmpValues | ( | self, | |
ampName, | |||
inputExpIdPair = [(np.nan, np.nan)] , |
|||
expIdMask = [np.nan] , |
|||
rawExpTime = [np.nan] , |
|||
rawMean = [np.nan] , |
|||
rawVar = [np.nan] , |
|||
photoCharge = [np.nan] , |
|||
gain = np.nan , |
|||
gainErr = np.nan , |
|||
noise = np.nan , |
|||
noiseErr = np.nan , |
|||
ptcFitPars = [np.nan] , |
|||
ptcFitParsError = [np.nan] , |
|||
ptcFitChiSq = np.nan , |
|||
ptcTurnoff = np.nan , |
|||
covArray = [] , |
|||
covArrayModel = [] , |
|||
covSqrtWeights = [] , |
|||
aMatrix = [] , |
|||
bMatrix = [] , |
|||
covArrayModelNoB = [] , |
|||
aMatrixNoB = [] , |
|||
finalVar = [np.nan] , |
|||
finalModelVar = [np.nan] , |
|||
finalMean = [np.nan] |
|||
) |
Function to initialize an amp of a PhotonTransferCurveDataset. Notes ----- The parameters are all documented in `init`.
Definition at line 203 of file ptcDataset.py.
def 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 363 of file ptcDataset.py.
def 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 506 of file ptcDataset.py.
def 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 259 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.aMatrix |
Definition at line 183 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.aMatrixNoB |
Definition at line 186 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.ampNames |
Definition at line 158 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.badAmps |
Definition at line 161 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.bMatrix |
Definition at line 184 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.covariances |
Definition at line 180 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.covariancesModel |
Definition at line 181 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.covariancesModelNoB |
Definition at line 185 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.covariancesSqrtWeights |
Definition at line 182 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.covMatrixSide |
Definition at line 159 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.expIdMask |
Definition at line 164 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.finalMeans |
Definition at line 190 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.finalModelVars |
Definition at line 189 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.finalVars |
Definition at line 188 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.gain |
Definition at line 170 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.gainErr |
Definition at line 171 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.inputExpIdPairs |
Definition at line 163 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.noise |
Definition at line 172 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.noiseErr |
Definition at line 173 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.photoCharge |
Definition at line 168 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.ptcFitChiSq |
Definition at line 177 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.ptcFitPars |
Definition at line 175 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.ptcFitParsError |
Definition at line 176 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.ptcFitType |
Definition at line 157 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.ptcTurnoff |
Definition at line 178 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.rawExpTimes |
Definition at line 165 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.rawMeans |
Definition at line 166 of file ptcDataset.py.
lsst.ip.isr.ptcDataset.PhotonTransferCurveDataset.rawVars |
Definition at line 167 of file ptcDataset.py.