-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_test.py
174 lines (153 loc) · 7.61 KB
/
main_test.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
__author__ = 'mmateja'
__author__ = 'mmateja'
from Ploter.PlotLPC import PlotLPC
from Ploter.PlotCondition import PlotCondition
from PLOT.PLOT import PLOT, dateformat
from RetrieveData.RetrieveDataForPlot import RetrieveDataForPlot
from RetrieveData.Retriever import Retriever
import numpy as np
from datetime import datetime
basic_path = "/home/mmateja/PycharmProjects/OperationPlots/"
#nameFileEnd = "Mu"
startfillnumber = 3819
endfillnumber = 4000
##################################################TEMPLATE PLOTTING################################################
# xaxis = "fillnumber" #TIME_DATE, FILLNUMBER
# yaxis = "max_lumi"
# d=PlotLPC(xaxis, yaxis, basic_path, "lumi_LHCb", startfillnumber, endfillnumber)
# #d=PlotCondition("time_year","value", basic_path, nameFileEnd)
# for (key1, value1),(key2, value2) in zip(d.datax.iteritems(), d.datay.iteritems()): #-key2,0iteritems ze wzgledu na typy danych
# #value1 = [datetime.fromtimestamp(v1) for v1 in value1]
# if key1 != key2 and ("time_sec" and "lumi" in xaxis and yaxis):
# print "ERROR DIFFERENT KEYS!!!!!!!"
# if "time_date" in xaxis and yaxis:
# value1 = dateformat(value1)
# plot=PLOT(value1, value2)
# plot.setTitle(key1) #key1
# plot.setDate()
# plot.draw()
# else:
# plot=PLOT(value1, value2)
# plot.setTitle(key1) #key1
# plot.draw()
#
######################################################################################################################
d = Retriever( basic_path, "lumi_LHCb", startfillnumber, endfillnumber)
data = d.retrieve("LPC") #LPC, CONDITION
r = RetrieveDataForPlot(data)
datax,datay=r.retrieveData("fillnumber","max_lumi")
for (key1, value1),(key2, value2) in zip(datax.iteritems(), datay.iteritems()): #-key2,0iteritems ze wzgledu na typy danych
plot=PLOT(value1, value2)
plot.setTitle("LHCb Peak Instantaneous Lumi at p-p 6.5 TeV in 2015") #key1
plot.setxlabel("LHC Fillnumber")
plot.setylabel("Peak Inst Luminosity (10^24/cm^2*s^1)")
plot.draw()
datax,datay=r.retrieveData("fillnumber","average_lumi")
for (key1, value1),(key2, value2) in zip(datax.iteritems(), datay.iteritems()): #-key2,0iteritems ze wzgledu na typy danych
plot=PLOT(value1, value2)
plot.setTitle("LHCb Peak Instantaneous Lumi at p-p 6.5 TeV in 2015") #key1
plot.setxlabel("LHC Fillnumber")
plot.setylabel("Peak Inst Luminosity (10^24/cm^2*s^1)")
plot.draw()
xaxis = "time_date" #TIME_DATE, FILLNUMBER
yaxis = "average_lumi"
d=PlotLPC(xaxis, yaxis, basic_path, "lumi_LHCb", startfillnumber, endfillnumber)
for (key1, value1),(key2, value2) in zip(d.datax.iteritems(), d.datay.iteritems()): #-key2,0iteritems ze wzgledu na typy danych
value1 = dateformat(value1)
plot=PLOT(value1, value2)
plot.setDate()
plot.setTitle("LHCb Peak Instantaneous Lumi at p-p 6.5 TeV in 2015") #key1
plot.setxlabel("Date")
plot.setylabel("Average Inst Luminosity (10^24/cm^2*s^1)")
plot.draw()
plot.savefig("OUTPUTPLOTS/2015AvgLumiTime.png")
xaxis = "fillnumber" #TIME_DATE, FILLNUMBER
yaxis = "max_condition"
d=PlotCondition(xaxis, yaxis, basic_path, "Mu", startfillnumber, endfillnumber)
for (key1, value1),(key2, value2) in zip(d.datax.iteritems(), d.datay.iteritems()): #-key2,0iteritems ze wzgledu na typy danych
plot = PLOT(value1, value2)
plot.setTitle("LHCb Peak Mu at p-p 6.5 TeV in 2015") #key1
plot.setxlabel("LHC Fillnumber")
plot.setylabel("Peak Mu")
plot.draw()
plot.savefig("OUTPUTPLOTS/2015PeakMuFill.png")
xaxis = "time_date" #TIME_DATE, FILLNUMBER
yaxis = "max_condition"
d=PlotCondition(xaxis, yaxis, basic_path, "Mu", startfillnumber, endfillnumber)
for (key1, value1),(key2, value2) in zip(d.datax.iteritems(), d.datay.iteritems()): #-key2,0iteritems ze wzgledu na typy danych
value1 = dateformat(value1)
plot = PLOT(value1, value2)
plot.setDate()
plot.setTitle("LHCb Peak Mu at p-p 6.5 TeV in 2015") #key1
plot.setxlabel("Date")
plot.setylabel("Peak Mu")
plot.draw()
plot.savefig("OUTPUTPLOTS/2015PeakMuTime.png")
xaxis = "fillnumber" #TIME_DATE, FILLNUMBER
yaxis = "average_condition"
d=PlotCondition(xaxis, yaxis, basic_path, "Mu", startfillnumber, endfillnumber)
for (key1, value1),(key2, value2) in zip(d.datax.iteritems(), d.datay.iteritems()): #-key2,0iteritems ze wzgledu na typy danych
plot = PLOT(value1, value2)
plot.setTitle("LHCb Average Mu at p-p 6.5 TeV in 2015") #key1
plot.setxlabel("LHC Fillnumber")
plot.setylabel("Average Mu")
plot.draw()
plot.savefig("OUTPUTPLOTS/2015AverageMuFill.png")
xaxis = "time_date" #TIME_DATE, FILLNUMBER
yaxis = "average_condition"
d=PlotCondition(xaxis, yaxis, basic_path, "Mu", startfillnumber, endfillnumber)
for (key1, value1),(key2, value2) in zip(d.datax.iteritems(), d.datay.iteritems()): #-key2,0iteritems ze wzgledu na typy danych
value1 = dateformat(value1)
plot = PLOT(value1, value2)
plot.setDate()
plot.setTitle("LHCb Average Mu at p-p 6.5 TeV in 2015") #key1
plot.setxlabel("Date")
plot.setylabel("Average Mu")
plot.draw()
plot.savefig("OUTPUTPLOTS/2015AverageMuTime.png")
xaxis = "fillnumber" #TIME_DATE, FILLNUMBER
yaxis = "max_condition"
d=PlotCondition(xaxis, yaxis, basic_path, "Pileup", startfillnumber, endfillnumber)
for (key1, value1),(key2, value2) in zip(d.datax.iteritems(), d.datay.iteritems()): #-key2,0iteritems ze wzgledu na typy danych
plot = PLOT(value1, value2)
plot.setTitle("LHCb Peak Pileup at p-p 6.5 TeV in 2015") #key1
plot.setxlabel("LHC Fillnumber")
plot.setylabel("Peak Pileup")
plot.draw()
plot.savefig("OUTPUTPLOTS/2015PeakPileupFill.png")
xaxis = "time_date" #TIME_DATE, FILLNUMBER
yaxis = "max_condition"
d=PlotCondition(xaxis, yaxis, basic_path, "Pileup", startfillnumber, endfillnumber)
for (key1, value1),(key2, value2) in zip(d.datax.iteritems(), d.datay.iteritems()): #-key2,0iteritems ze wzgledu na typy danych
value1 = dateformat(value1)
plot = PLOT(value1, value2)
plot.setDate()
plot.setTitle("LHCb Peak Pileup at p-p 6.5 TeV in 2015") #key1
plot.setxlabel("Date")
plot.setylabel("Peak Pileup")
plot.draw()
plot.savefig("OUTPUTPLOTS/2015PeakPileupTime.png")
xaxis = "fillnumber" #TIME_DATE, FILLNUMBER
yaxis = "average_condition"
d=PlotCondition(xaxis, yaxis, basic_path, "Pileup", startfillnumber, endfillnumber)
for (key1, value1),(key2, value2) in zip(d.datax.iteritems(), d.datay.iteritems()): #-key2,0iteritems ze wzgledu na typy danych
plot = PLOT(value1, value2)
plot.setTitle("LHCb Average Pileup at p-p 6.5 TeV in 2015") #key1
plot.setxlabel("LHC Fillnumber")
plot.setylabel("Average Pileup")
plot.draw()
plot.savefig("OUTPUTPLOTS/2015AveragePileupFill.png")
xaxis = "time_date" #TIME_DATE, FILLNUMBER
yaxis = "average_condition"
d=PlotCondition(xaxis, yaxis, basic_path, "Pileup", startfillnumber, endfillnumber)
for (key1, value1),(key2, value2) in zip(d.datax.iteritems(), d.datay.iteritems()): #-key2,0iteritems ze wzgledu na typy danych
value1 = dateformat(value1)
plot = PLOT(value1, value2)
plot.setDate()
plot.setTitle("LHCb Average Pileup at p-p 6.5 TeV in 2015") #key1
plot.setxlabel("Date")
plot.setylabel("Average Pileup")
plot.draw()
plot.savefig("OUTPUTPLOTS/2015AveragePileupTime.png")
#plot.show()
#raw_input("Press enter to continue")