-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path004_load_recalculated_and_plot.py
More file actions
83 lines (63 loc) · 3 KB
/
004_load_recalculated_and_plot.py
File metadata and controls
83 lines (63 loc) · 3 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
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
import numpy as np
import LHCMeasurementTools.TimberManager as tm
from GasFlowHLCalculator.calibration_config import calibration_config
from GasFlowHLCalculator.calibration import Calibration, CalibrationManager
from GasFlowHLCalculator.h5_storage import H5_storage
# from GasFlowHLCalculator import heatload_recalc as hlr
import GasFlowHLCalculator.qbs_fill as qf
cal_manager = CalibrationManager(calibration_config=calibration_config)
with_P_drop = True
compute_instrumented = True
filln = 6737
filln = 8151
#filln = 6967
circuit = 'QRLAB_23L2_QBS947.POSST' # Missing P4 (same result as logginh)
#circuit = 'QRLAB_15L2_QBS943.POSST' # Missing T1 (same result as logging)
#circuit = 'QRLAB_27L4_QBS943.POSST' # Missing P1 (result different from logging)
circuit = 'QRLAA_13L5_QBS943.POSST' # Instrumented cell
circuit = 'QRLAA_33L5_QBS947.POSST' # Instrumented cell
circuit = 'QRLAA_13R4_QBS947.POSST' # Instrumented cell
circuit = 'QRLAB_31L2_QBS943.POSST' # Instrumented cell
circuit = 'QRLAB_15R2_QBS943.POSST' # Instrumented cell
circuit = 'QRLAA_17L6_QBS943.POSST' # Instrumented cell
circuit = 'QRLAB_27L8_QBS947.POSST' # Instrumented cell
circuit = 'QRLAD_33R2_QBS947.POSST' # Instrumented cell
h5_storage = H5_storage(h5_dir='/eos/user/l/lhcecld/heatload_data_storage/')
# Some plots
import matplotlib.pyplot as plt
plt.close('all')
fill_dict = qf.get_fill_dict(filln, h5_storage=h5_storage, use_dP=with_P_drop)
t_unix = fill_dict[circuit].t_stamps
t_h = (t_unix - t_unix[0])/3600.
figtot = plt.figure(100)
axtot = figtot.add_subplot(111)
axtot.plot(t_h, fill_dict[circuit].values, color = 'black', label="Total")
axlist = [axtot]
if compute_instrumented:
for i_mag, name_mag in enumerate('Q1 D2 D3 D4'.split()):
fig = plt.figure(i_mag+1)
# ax = fig.add_subplot(111, sharex=axtot, sharey=axtot)
ax = fig.add_subplot(111)
nn = circuit.replace('.POSST', '_%s.POSST'%name_mag)
nnb1 = circuit.replace('.POSST', '_%sB1.POSST'%name_mag)
nnb2 = circuit.replace('.POSST', '_%sB2.POSST'%name_mag)
nnc = circuit.replace('.POSST', '_%s_COR.POSST'%name_mag)
nnb1c = circuit.replace('.POSST', '_%sB1_COR.POSST'%name_mag)
nnb2c = circuit.replace('.POSST', '_%sB2_COR.POSST'%name_mag)
# ax.plot(t_h, fill_dict[nn].values, color='k', label='Total')
ax.plot(t_h, fill_dict[nnb1].values, color='b', label='B1')
ax.plot(t_h, fill_dict[nnb2].values, color='r', label='B2')
ax.plot(t_h, fill_dict[nnb1c].values, color='b', label='B1 COR', ls='--')
ax.plot(t_h, fill_dict[nnb2c].values, color='r', label='B2 COR', ls='--')
fig.suptitle(circuit + ' - ' + name_mag)
axtot.plot(t_h, fill_dict[nn].values, label=name_mag)
axtot.plot(t_h, fill_dict[nnc].values, label=name_mag+" COR")
axlist.append(ax)
print((t_h[1]-t_h[0])*3600)
for aa in axlist:
aa.legend(loc='best')
aa.set_xlabel('t [h]')
aa.set_ylabel('Heat load [W]')
aa.grid(True, linestyle='--', alpha=.5)
figtot.suptitle(circuit)
plt.show()