Coverage for python/lsst/obs/sdss/convertOpECalib.py : 27%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
self._ECalib = Yanny(os.path.join(opDir, opECalib))["ECALIB"] self._CcdConfig = Yanny(os.path.join(opDir, opConfig))["CCDCONFIG"]
filter, camCol = list(ccdName)
return filter, int(camCol)
return SdssCameraState._filters[filter]
"""Return the index for the given ccd (e.g. g1) into the arrays returned by a Yanny object""" filter, camCol = self._splitCcd(ccdName) camRow = self._getCamRow(filter)
me = np.where(np.logical_and(np.equal(ECALIB["camCol"], camCol), np.equal(ECALIB["camRow"], camRow))) if len(me) != 1: raise RuntimeError("Unable to lookup index for ccd %s" % ccdName)
return me[0]
"""Return a pair of ampId dict of electronic params for both amps of a named CCD (e.g. z4)""" ECALIB = self._ECalib me = self.getCcdIndex(ECALIB, ccdName)
eparams = [] for i in range(4): if int(self._CcdConfig["amp%d" % i][me]): gain = ECALIB["gain%d" % i][me] readNoise = ECALIB["readNoiseDN%d" % i][me] fullWell = ECALIB["fullWellDN%d" % i][me]
eparams.append((i, {'gain': gain, 'readNoise': readNoise, 'fullWell': fullWell}))
if len(eparams) == 1: eparams.append((1, eparams[0][1]))
return eparams
sc = SdssCameraState(os.path.join(lsst.utils.getPackageDir("obs_sdss"), "etc"), "opConfig-50000.par", "opECalib-50000.par") print([(i, ep['gain'], ep['readNoise'], ep['fullWell']) for i, ep in sc.getEParams("g2")]) |