-
Notifications
You must be signed in to change notification settings - Fork 0
/
DeltaBetaVsBeta.py
76 lines (60 loc) · 2.1 KB
/
DeltaBetaVsBeta.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import numpy as np
import matplotlib.pyplot as plt
plt.switch_backend('Agg')
import glob
files = glob.glob('DiagFiles/*Beta*SameK100Sims.txt')
TrueBetas = []
DeltaBetas = []
SigmaBetas = []
files = sorted(files)
for f in files:
if 'MCBeta' in f:
continue
BetaFile = np.genfromtxt(f, names=True, dtype = None, skip_header = 10)
print BetaFile.shape
try:
TrueBetas.append(BetaFile['DataBeta'][-1])
DeltaBetas.append(BetaFile['delta_Beta'][-1])
SigmaBetas.append(BetaFile['sigma_Beta'][-1])
except:
TrueBetas.append(float(BetaFile['DataBeta']))
DeltaBetas.append(float(BetaFile['delta_Beta']))
SigmaBetas.append(float(BetaFile['sigma_Beta']))
print TrueBetas
print DeltaBetas
plt.xlabel("True Data Beta")
plt.ylabel("Delta Beta")
plt.scatter(TrueBetas, np.array(DeltaBetas) + 2.11 - np.array(TrueBetas), marker = 'o')
plt.errorbar(TrueBetas, np.array(DeltaBetas) + 2.11 - np.array(TrueBetas), yerr = SigmaBetas, fmt = 'none', marker = 'o')
#plt.plot(TrueBetas, np.array(TrueBetas) - 2.11)
plt.plot(TrueBetas, np.zeros(len(TrueBetas)) )
plt.savefig('DeltaBetaVsBeta_NoCheat.png')
plt.clf()
files = glob.glob('DiagFiles/*Beta*SameK100Sims.txt')
TrueBetas = []
DeltaBetas = []
SigmaBetas = []
files = sorted(files)
for f in files:
if not ('MCBeta15' in f):
continue
print f
BetaFile = np.genfromtxt(f, names=True, dtype = None, skip_header = 10)
print BetaFile.shape
try:
TrueBetas.append(BetaFile['DataBeta'][-1])
DeltaBetas.append(BetaFile['delta_Beta'][-1])
SigmaBetas.append(BetaFile['sigma_Beta'][-1])
except:
TrueBetas.append(float(BetaFile['DataBeta']))
DeltaBetas.append(float(BetaFile['delta_Beta']))
SigmaBetas.append(float(BetaFile['sigma_Beta']))
print TrueBetas
print DeltaBetas
plt.xlabel("True Data Beta")
plt.ylabel("Delta Beta")
plt.scatter(TrueBetas, np.array(DeltaBetas) + 1.51 - np.array(TrueBetas), marker = 'o')
plt.errorbar(TrueBetas, np.array(DeltaBetas) + 1.51 - np.array(TrueBetas), yerr = SigmaBetas, fmt = 'none', marker = 'o')
#plt.plot(TrueBetas, np.array(TrueBetas) - 1.51)
plt.plot(TrueBetas, np.zeros(len(TrueBetas)) )
plt.savefig('DeltaBetaVsBeta_MCBeta15_NoCheat.png')