LSST Applications
21.0.0-131-g8cabc107+528f53ee53,22.0.0+00495a2688,22.0.0+0ef2527977,22.0.0+11a2aa21cd,22.0.0+269b7e55e3,22.0.0+2c6b6677a3,22.0.0+64c1bc5aa5,22.0.0+7b3a3f865e,22.0.0+e1b6d2281c,22.0.0+ff3c34362c,22.0.1-1-g1b65d06+c95cbdf3df,22.0.1-1-g7058be7+1cf78af69b,22.0.1-1-g7dab645+2a65e40b06,22.0.1-1-g8760c09+64c1bc5aa5,22.0.1-1-g949febb+64c1bc5aa5,22.0.1-1-ga324b9c+269b7e55e3,22.0.1-1-gf9d8b05+ff3c34362c,22.0.1-10-g781e53d+9b51d1cd24,22.0.1-10-gba590ab+b9624b875d,22.0.1-13-g76f9b8d+2c6b6677a3,22.0.1-14-g22236948+57af756299,22.0.1-18-g3db9cf4b+9b7092c56c,22.0.1-18-gb17765a+2264247a6b,22.0.1-2-g8ef0a89+2c6b6677a3,22.0.1-2-gcb770ba+c99495d3c6,22.0.1-24-g2e899d296+4206820b0d,22.0.1-3-g7aa11f2+2c6b6677a3,22.0.1-3-g8c1d971+f253ffa91f,22.0.1-3-g997b569+ff3b2f8649,22.0.1-4-g1930a60+6871d0c7f6,22.0.1-4-g5b7b756+6b209d634c,22.0.1-6-ga02864e+6871d0c7f6,22.0.1-7-g3402376+a1a2182ac4,22.0.1-7-g65f59fa+54b92689ce,master-gcc5351303a+e1b6d2281c,w.2021.32
LSST Data Management Base Package
|
Public Member Functions | |
def | __init__ (self, meanSignals, covariances, covsSqrtWeights, maxRangeFromTuple=8, meanSignalsMask=[]) |
def | copy (self) |
def | initFit (self) |
def | getParamValues (self) |
def | setParamValues (self, p) |
def | evalCovModel (self, mu=None) |
def | getA (self) |
def | getB (self) |
def | getC (self) |
def | getACov (self) |
def | getASig (self) |
def | getBCov (self) |
def | getCCov (self) |
def | getGainErr (self) |
def | getNoiseCov (self) |
def | getNoiseSig (self) |
def | getGain (self) |
def | getRon (self) |
def | getRonErr (self) |
def | getNoise (self) |
def | getMaskCov (self, i, j) |
def | setAandB (self, a, b) |
def | chi2 (self) |
def | weightedRes (self, params=None) |
def | fitFullModel (self, pInit=None) |
def | getFitData (self, i, j, divideByMu=False, unitsElectrons=False, returnMasked=False) |
Public Attributes | |
mu | |
cov | |
sqrtW | |
r | |
logger | |
params | |
covParams | |
A class to fit the models in Astier+19 to flat covariances. This code implements the model(and the fit thereof) described in Astier+19: https://arxiv.org/pdf/1905.08677.pdf Parameters ---------- meanSignals : `list`[`float`] List with means of the difference image of two flats, for a particular amplifier in the detector. covariances : `list`[`numpy.array`] List with 2D covariance arrays at a given mean signal. covsSqrtWeights : `list`[`numpy.array`] List with 2D arrays with weights from `vcov as defined in `makeCovArray`: weight = 1/sqrt(vcov). maxRangeFromTuple: `int`, optional Maximum range to select from tuple. meanSignalMask: `list`[`bool`], optional Mask of mean signal 1D array. Use all entries if empty.
Definition at line 149 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.__init__ | ( | self, | |
meanSignals, | |||
covariances, | |||
covsSqrtWeights, | |||
maxRangeFromTuple = 8 , |
|||
meanSignalsMask = [] |
|||
) |
Definition at line 175 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.chi2 | ( | self | ) |
Calculate weighted chi2 of full-model fit.
Definition at line 421 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.copy | ( | self | ) |
Make a copy of params
Definition at line 187 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.evalCovModel | ( | self, | |
mu = None |
|||
) |
Computes full covariances model (Eq. 20 of Astier+19). Parameters ---------- mu: `numpy.array`, optional List of mean signals. Returns ------- covModel: `numpy.array` Covariances model. Notes ----- By default, computes the covModel for the mu's stored(self.mu). Returns cov[Nmu, self.r, self.r]. The variance for the PTC is cov[:, 0, 0]. mu and cov are in ADUs and ADUs squared. To use electrons for both, the gain should be set to 1. This routine implements the model in Astier+19 (1905.08677). The parameters of the full model for C_ij(mu) ("C_ij" and "mu" in ADU^2 and ADU, respectively) in Astier+19 (Eq. 20) are: "a" coefficients (r by r matrix), units: 1/e "b" coefficients (r by r matrix), units: 1/e noise matrix (r by r matrix), units: e^2 gain, units: e/ADU "b" appears in Eq. 20 only through the "ab" combination, which is defined in this code as "c=ab".
Definition at line 245 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.fitFullModel | ( | self, | |
pInit = None |
|||
) |
Fit measured covariances to full model in Astier+19 (Eq. 20) Parameters ---------- pInit : `list` Initial parameters of the fit. len(pInit) = #entries(a) + #entries(c) + #entries(noise) + 1 len(pInit) = r^2 + r^2 + r^2 + 1, where "r" is the maximum lag considered for the covariances calculation, and the extra "1" is the gain. If "b" is 0, then "c" is 0, and len(pInit) will have r^2 fewer entries. Returns ------- params : `np.array` Fit parameters (see "Notes" below). Notes ----- The parameters of the full model for C_ij(mu) ("C_ij" and "mu" in ADU^2 and ADU, respectively) in Astier+19 (Eq. 20) are: "a" coefficients (r by r matrix), units: 1/e "b" coefficients (r by r matrix), units: 1/e noise matrix (r by r matrix), units: e^2 gain, units: e/ADU "b" appears in Eq. 20 only through the "ab" combination, which is defined in this code as "c=ab".
Definition at line 442 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.getA | ( | self | ) |
'a' matrix from Astier+19(e.g., Eq. 20)
Definition at line 311 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.getACov | ( | self | ) |
Get covariance matrix of "a" coefficients from fit
Definition at line 334 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.getASig | ( | self | ) |
Square root of diagonal of the parameter covariance of the fitted "a" matrix
Definition at line 342 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.getB | ( | self | ) |
'b' matrix from Astier+19(e.g., Eq. 20)
Definition at line 315 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.getBCov | ( | self | ) |
Get covariance matrix of "a" coefficients from fit b = c /a
Definition at line 350 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.getC | ( | self | ) |
'c'='ab' matrix from Astier+19(e.g., Eq. 20)
Definition at line 319 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.getCCov | ( | self | ) |
Get covariance matrix of "c" coefficients from fit
Definition at line 360 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.getFitData | ( | self, | |
i, | |||
j, | |||
divideByMu = False , |
|||
unitsElectrons = False , |
|||
returnMasked = False |
|||
) |
Get measured signal and covariance, cov model, weigths, and mask at covariance lag (i, j). Parameters --------- i: `int` Lag for covariance matrix. j: `int` Lag for covariance matrix. divideByMu: `bool`, optional Divide covariance, model, and weights by signal mu? unitsElectrons : `bool`, optional mu, covariance, and model are in ADU (or powers of ADU) If tthis parameter is true, these are multiplied by the adequte factors of the gain to return quantities in electrons (or powers of electrons). returnMasked : `bool`, optional Use mask (based on weights) in returned arrays (mu, covariance, and model)? Returns ------- mu: `numpy.array` list of signal values (mu). covariance: `numpy.array` Covariance arrays, indexed by mean signal mu (self.cov[:, i, j]). covarianceModel: `numpy.array` Covariance model (model). weights: `numpy.array` Weights (self.sqrtW) mask : `numpy.array`, optional Boolean mask of the covariance at (i,j). Notes ----- Using a CovFit object, selects from (i, j) and returns mu*gain, self.cov[:, i, j]*gain**2 model*gain**2, and self.sqrtW/gain**2 in electrons or ADU if unitsElectrons=False.
Definition at line 479 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.getGain | ( | self | ) |
Get gain (e/ADU)
Definition at line 387 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.getGainErr | ( | self | ) |
Get error on fitted gain parameter
Definition at line 365 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.getMaskCov | ( | self, | |
i, | |||
j | |||
) |
Get mask of Cov[i,j]
Definition at line 409 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.getNoise | ( | self | ) |
Get noise matrix
Definition at line 405 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.getNoiseCov | ( | self | ) |
Get covariances of noise matrix from fit
Definition at line 373 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.getNoiseSig | ( | self | ) |
Square root of diagonal of the parameter covariance of the fitted "noise" matrix
Definition at line 378 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.getParamValues | ( | self | ) |
Return an array of free parameter values (it is a copy).
Definition at line 236 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.getRon | ( | self | ) |
Get readout noise (e^2)
Definition at line 391 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.getRonErr | ( | self | ) |
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.initFit | ( | self | ) |
Performs a crude parabolic fit of the data in order to start the full fit close to the solution.
Definition at line 195 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.setAandB | ( | self, | |
a, | |||
b | |||
) |
Set "a" and "b" coeffcients forfull Astier+19 model (Eq. 20). "c=a*b".
Definition at line 415 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.setParamValues | ( | self, | |
p | |||
) |
Set parameter values.
Definition at line 240 of file astierCovPtcFit.py.
def lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.weightedRes | ( | self, | |
params = None |
|||
) |
Weighted residuals. Notes ----- To be used via: c = CovFit(meanSignals, covariances, covsSqrtWeights) c.initFit() coeffs, cov, _, mesg, ierr = leastsq(c.weightedRes, c.getParamValues(), full_output=True)
Definition at line 425 of file astierCovPtcFit.py.
lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.cov |
Definition at line 181 of file astierCovPtcFit.py.
lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.covParams |
Definition at line 475 of file astierCovPtcFit.py.
lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.logger |
Definition at line 185 of file astierCovPtcFit.py.
lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.mu |
Definition at line 180 of file astierCovPtcFit.py.
lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.params |
Definition at line 202 of file astierCovPtcFit.py.
lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.r |
Definition at line 184 of file astierCovPtcFit.py.
lsst.cp.pipe.ptc.astierCovPtcFit.CovFit.sqrtW |
Definition at line 183 of file astierCovPtcFit.py.