Observables.py
1.62 KB
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
from numpy import sort, log10
from matplotlib.pyplot import figure, show
from mpl_toolkits.mplot3d import Axes3D
from Modules.Read import ReadEnergy, ReadTime, ReadExtraFile
from Modules.Constants import degre
def drawObservablesSpace(fileId):
fig = figure()
ax = fig.add_subplot(232,projection='3d')
ax1 = fig.add_subplot(233)
ax2 = fig.add_subplot(231)
ax3 = fig.add_subplot(235)
energy = ReadEnergy(fileId)
delay = ReadTime(fileId)
generation, theta = ReadExtraFile(fileId,[3,4])
theta*=degre
colors=['b','g','r','m','c','y']
i=0
for gen in sort(list(set(generation))):
cond = (generation==gen) & (delay>0) & (theta>0)
ax.scatter(log10(energy[cond]),log10(theta[cond]),log10(delay[cond]),color=colors[i],label="gen = %.0f"%gen)
ax1.scatter(energy[cond],delay[cond],color=colors[i])
ax2.scatter(theta[cond],delay[cond],color=colors[i])
ax3.scatter(theta[cond],energy[cond],color=colors[i])
i+=1
ax.legend(loc="best")
#ax.set_xscale('log')
#ax.set_yscale('log')
#ax.set_zscale('log')
ax.set_xlabel("energy [GeV]")
ax.set_ylabel("$\\theta$ [deg]")
ax.set_zlabel("Time delay [s]")
ax1.grid(b=True,which='major')
ax1.set_xscale('log')
ax1.set_yscale('log')
ax1.set_xlabel("energy [GeV]")
ax1.set_ylabel("Time delay [s]")
ax2.grid(b=True,which='major')
ax2.set_xscale('log')
ax2.set_yscale('log')
ax2.set_xlabel("$\\theta$ [deg]")
ax2.set_ylabel("Time delay [s]")
ax3.grid(b=True,which='major')
ax3.set_xscale('log')
ax3.set_yscale('log')
ax3.set_xlabel("$\\theta$ [deg]")
ax3.set_ylabel("energy [GeV]")
show()