Exemplo n.º 1
0
def getShotNoise(myeff, effbins, samples, samplesize):
    effs = numpy.zeros(effbins)
    for _ in range(samples):
        rnds = numpy.random.random(samplesize)
        accs = (rnds < myeff).sum()
        eff = efficiencyDeltaFix((accs / samplesize,))
        ndx = genEffIndex(eff[0], effbins)
        effs[ndx] += 1 / samples
    return effs
Exemplo n.º 2
0
 def populateMatrixColumnWithBurst(self, rbinindex, reff, burst, weight):
     effval = genRandomBurstEffs(reff, burst)
     effval = efficiencyDeltaFix((effval, ))
     effndx = genEffIndex(effval, self.EffBins)
     self.tm[rbinindex, effndx] += weight
Exemplo n.º 3
0
 def populateMatrixColumnWithBurst(self, rbinindex, reff, burst, weight):
     effval = genRandomBurstEffs(reff, burst)
     effval = efficiencyDeltaFix((effval,))
     effndx = genEffIndex(effval, self.EffBins)
     self.tm[rbinindex, effndx] += weight
Exemplo n.º 4
0
 def test_deltaFix(self):
     arr = numpy.random.rand(1000)
     aavg = arr.mean()
     self.assertAlmostEqual(aavg,
                            efficiencyDeltaFix(arr).mean(),
                            delta=0.01)
Exemplo n.º 5
0
 def test_deltaFix(self):
     arr = numpy.random.rand(1000)
     aavg = arr.mean()
     self.assertAlmostEqual(aavg, efficiencyDeltaFix(arr).mean(), delta = 0.01)