-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path010_cell_types.py
55 lines (39 loc) · 1.35 KB
/
010_cell_types.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
from __future__ import print_function, division
import operator
import argparse
import matplotlib.pyplot as plt
import numpy as np
import LHCMeasurementTools.mystyle as ms
import LHCMeasurementTools.savefig as sf
from LHC_Heat_load_dict import mask_dict, main_dict
import dict_utils as du
from info_on_half_cells import type_occurence_dict, type_list
try:
from RcParams import init_pyplot
init_pyplot()
except ImportError:
ms.mystyle()
plt.close('all')
moment = 'stop_squeeze'
mask = np.logical_and(main_dict[moment]['n_bunches']['b1'] > 800, main_dict[moment]['n_bunches']['b2'] > 800)
main_dict = du.mask_dict(main_dict,mask)
hl_dict = main_dict[moment]['heat_load']['all_cells']
types = []
filln = main_dict['filln']
for ctr, type_ in enumerate(type_list):
cells = type_occurence_dict[type_]['cells']
sp_ctr = ctr % 4 + 1
if sp_ctr == 1:
fig = ms.figure('Cell type heat loads')
sp = plt.subplot(4,1, sp_ctr)
if sp_ctr == 4:
sp.set_xlabel('Fill number')
sp.set_ylabel('Heat loads')
sp.set_title('Type %s with %i cells' % (type_, len(cells)))
for arc, cell, cell_ctr in cells:
arc = arc.replace('S', 'Arc_')
key = du.arc_cells_dict[arc][cell_ctr]
print((arc, key, cell, cell_ctr))
sp.plot(main_dict['filln'], hl_dict[key], '.', markersize=12)
sp.set_ylim(0,None)
plt.show()