Belle II Software  release-08-01-10
plotPhase2VXDAlignment.py
1 #!/usr/bin/env python3
2 # *****************************************************************************
3 
4 
11 
12 # title : plotVXDALignmentPayloadPhase2.py
13 # description : Produce png file loaded from localdb for phase 2
14 
15 import sys
16 import numpy as np
17 import pandas as pd
18 import matplotlib.pyplot as plt
19 import matplotlib.patches as patches
20 import ROOT
21 from ROOT import Belle2
22 
23 if len(sys.argv) < 2:
24  sys.exit("No input .root file specified!")
25 
26 inputroot = sys.argv[1]
27 file = ROOT.TFile(inputroot, "OPEN")
28 vxd = file.Get("VXDAlignment")
29 
30 fileName = inputroot + '.txt'
31 
32 text_file = open(fileName, "w")
33 text_file.write("layer ladder sensor param value\n")
34 for entry in vxd.getMap():
35  element_parameter = entry.first
36  value = entry.second
37  element = element_parameter.first
38  param = element_parameter.second
39  vxdid = Belle2.VxdID(element)
40  layer = vxdid.getLayerNumber()
41  ladder = vxdid.getLadderNumber()
42  sensor = vxdid.getSensorNumber()
43  if sensor != 0:
44  text_file.write("{} {} {} {} {}\n".format(layer, ladder, sensor, param, value))
45  # print("{0} {1} {2} {3} {4}\n".format(layer, ladder, sensor, param, value))
46 
47 for parameter in range(1, 7):
48  text_file.write("{} {} {} {} {}\n".format(1, 0, 1, parameter, vxd.get(int(Belle2.VxdID(1, 0, 0, 1)), parameter)))
49  text_file.write("{} {} {} {} {}\n".format(1, 0, 2, parameter, vxd.get(int(Belle2.VxdID(1, 0, 0, 2)), parameter)))
50  text_file.write("{} {} {} {} {}\n".format(3, 0, 1, parameter, vxd.get(int(Belle2.VxdID(3, 0, 0, 1)), parameter)))
51  text_file.write("{} {} {} {} {}\n".format(3, 0, 2, parameter, vxd.get(int(Belle2.VxdID(3, 0, 0, 2)), parameter)))
52  for layer in range(1, 7):
53  text_file.write("{} {} {} {} {}\n".format(layer, 1, 0, parameter, vxd.get(int(Belle2.VxdID(layer, 1, 0)), parameter)))
54 
55 text_file.close()
56 
57 beast2_sensors = [
58  (1, 1, 1), (1, 1, 2),
59  (2, 1, 1), (2, 1, 2),
60  (3, 1, 1), (3, 1, 2),
61  (4, 1, 1), (4, 1, 2), (4, 1, 3),
62  (5, 1, 1), (5, 1, 2), (5, 1, 3), (5, 1, 4),
63  (6, 1, 1), (6, 1, 2), (6, 1, 3), (6, 1, 4), (6, 1, 5)
64 ]
65 
66 beast2_ladders = [
67  (1, 1, 0),
68  (2, 1, 0),
69  (3, 1, 0),
70  (4, 1, 0),
71  (5, 1, 0),
72  (6, 1, 0)
73 ]
74 
75 beast2_halfshells = [
76  (1, 0, 1),
77  (3, 0, 1)
78 ]
79 
80 # Read data into a pandas DataFrame
81 print('reading from file ' + fileName)
82 
83 dataframe = pd.read_table(
84  fileName,
85  sep=' ',
86  skipinitialspace=True,
87  skiprows=1,
88  names=[
89  'layer',
90  'ladder',
91  'sensor',
92  'parameter',
93  'value'])
94 
95 scale = np.where(dataframe.parameter < 4, 1.0e4, 1.0e3)
96 for colname in ['value']:
97  dataframe[colname] *= scale
98 
99 font = {'family': 'normal', 'weight': 'bold', 'size': 22}
100 
101 sensorCoordinates = (
102  [0.20, 0.00, 0.60, 0.10],
103  [0.60, 0.00, 0.99, 0.10],
104  [0.20, 0.12, 0.60, 0.22],
105  [0.60, 0.12, 0.99, 0.22],
106  [0.20, 0.25, 0.60, 0.35],
107  [0.60, 0.25, 0.99, 0.35],
108  [0.00, 0.38, 0.30, 0.52],
109  [0.30, 0.38, 0.60, 0.52],
110  [0.60, 0.38, 0.90, 0.52],
111  [0.00, 0.58, 0.25, 0.72],
112  [0.25, 0.58, 0.50, 0.72],
113  [0.50, 0.58, 0.75, 0.72],
114  [0.75, 0.58, 0.99, 0.72],
115  [0.00, 0.78, 0.20, 0.92],
116  [0.20, 0.78, 0.40, 0.92],
117  [0.40, 0.78, 0.60, 0.92],
118  [0.60, 0.78, 0.80, 0.92],
119  [0.80, 0.78, 0.99, 0.92])
120 
121 excludedSensor = [True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True]
122 excludedLadder = [True, True, True, True, True, True]
123 excludedHalfShell = [True, True]
124 
125 quantity = [r'NAN', r'$u$ = ', r'$v$ = ', r'$w$ = ', r'$\alpha$ = ', r'$\beta$ = ', r'$\gamma$ = ']
126 unit = [r'NAN', ' um', ' um', ' um', ' mrad', ' mrad', ' mrad']
127 line = ['NAN', r'$u$ = NAN', r'$v$ = NAN', r'$w$ = NAN', r'$\alpha$ = NAN', r'$\beta$ = NAN', r'$\gamma$ = NAN']
128 
129 fig = plt.figure(figsize=(8.27, 11.69))
130 ax = fig.add_subplot(111)
131 
132 ax.text(0.00, 0.97, 'Experiment: 1002(Phase II), Run: XXXX, Date: 6/10/2017', color='black', size='14.5', weight='bold')
133 
134 ax.text(0.05, 0.03, ' layer 1 \nladder 1', color='black', size='12', weight='bold')
135 ax.text(0.05, 0.15, ' layer 2 \nladder 1', color='black', size='12', weight='bold')
136 ax.text(0.05, 0.28, ' layer 3 \nladder 1', color='black', size='12', weight='bold')
137 ax.text(0.40, 0.53, ' layer 4 ladder 1', color='black', size='12', weight='bold')
138 ax.text(0.40, 0.73, ' layer 5 ladder 1', color='black', size='12', weight='bold')
139 ax.text(0.40, 0.93, ' layer 6 ladder 1', color='black', size='12', weight='bold')
140 
141 
142 number = 0.0
143 for i in range(0, 18):
144  layer_id, ladder_id, sensor_id = beast2_sensors[i]
145  print('Sensor: ', layer_id, '.', ladder_id, '.', sensor_id)
146  for j in [1, 2, 3, 4, 5, 6]:
147  number = float(dataframe['value'][dataframe['layer'] == layer_id][dataframe['ladder'] == ladder_id]
148  [dataframe['sensor'] == sensor_id][dataframe['parameter'] == j])
149  if (number != 0.0):
150  excludedSensor[i] = False
151  line[j] = quantity[j] + str(round(number, 5)) + unit[j]
152  print(line[j])
153  else:
154  print('Non calculated ladder!!')
155  print('')
156 
157  if excludedSensor[i]:
158  if (i == 6 or i == 9 or i == 13):
159  ax.add_patch(plt.Polygon([[sensorCoordinates[i][0],
160  sensorCoordinates[i][1] - 0.03],
161  [sensorCoordinates[i][2],
162  sensorCoordinates[i][1]],
163  [sensorCoordinates[i][2],
164  sensorCoordinates[i][3]],
165  [sensorCoordinates[i][0],
166  sensorCoordinates[i][3] + 0.03]],
167  facecolor='red',
168  alpha=0.3,
169  edgecolor='black'))
170  ax.add_patch(plt.Polygon([[sensorCoordinates[i][0],
171  sensorCoordinates[i][1] - 0.03],
172  [sensorCoordinates[i][2],
173  sensorCoordinates[i][1]],
174  [sensorCoordinates[i][2],
175  sensorCoordinates[i][3]],
176  [sensorCoordinates[i][0],
177  sensorCoordinates[i][3] + 0.03]],
178  fill=None))
179  else:
180  ax.add_patch(plt.Polygon([[sensorCoordinates[i][0], sensorCoordinates[i][1]],
181  [sensorCoordinates[i][2], sensorCoordinates[i][1]],
182  [sensorCoordinates[i][2], sensorCoordinates[i][3]],
183  [sensorCoordinates[i][0], sensorCoordinates[i][3]]],
184  facecolor='red', alpha=0.3, edgecolor='black'))
185  ax.add_patch(plt.Polygon([[sensorCoordinates[i][0], sensorCoordinates[i][1]],
186  [sensorCoordinates[i][2], sensorCoordinates[i][1]],
187  [sensorCoordinates[i][2], sensorCoordinates[i][3]],
188  [sensorCoordinates[i][0], sensorCoordinates[i][3]]], fill=None))
189 
190  else:
191  if (i == 6 or i == 9 or i == 13):
192  ax.add_patch(plt.Polygon([[sensorCoordinates[i][0],
193  sensorCoordinates[i][1] - 0.03],
194  [sensorCoordinates[i][2],
195  sensorCoordinates[i][1]],
196  [sensorCoordinates[i][2],
197  sensorCoordinates[i][3]],
198  [sensorCoordinates[i][0],
199  sensorCoordinates[i][3] + 0.03]],
200  facecolor='green',
201  alpha=0.1,
202  edgecolor='black'))
203  ax.add_patch(plt.Polygon([[sensorCoordinates[i][0],
204  sensorCoordinates[i][1] - 0.03],
205  [sensorCoordinates[i][2],
206  sensorCoordinates[i][1]],
207  [sensorCoordinates[i][2],
208  sensorCoordinates[i][3]],
209  [sensorCoordinates[i][0],
210  sensorCoordinates[i][3] + 0.03]],
211  fill=None))
212  else:
213  ax.add_patch(plt.Polygon([[sensorCoordinates[i][0],
214  sensorCoordinates[i][1]],
215  [sensorCoordinates[i][2],
216  sensorCoordinates[i][1]],
217  [sensorCoordinates[i][2],
218  sensorCoordinates[i][3]],
219  [sensorCoordinates[i][0],
220  sensorCoordinates[i][3]]],
221  facecolor='green',
222  alpha=0.1,
223  edgecolor='black'))
224  ax.add_patch(plt.Polygon([[sensorCoordinates[i][0], sensorCoordinates[i][1]],
225  [sensorCoordinates[i][2], sensorCoordinates[i][1]],
226  [sensorCoordinates[i][2], sensorCoordinates[i][3]],
227  [sensorCoordinates[i][0], sensorCoordinates[i][3]]], fill=None))
228 
229  if (i < 6):
230  ax.text(
231  sensorCoordinates[i][0] + 0.02,
232  sensorCoordinates[i][1] + 0.080,
233  line[1],
234  color='black',
235  size='8',
236  bbox=dict(
237  facecolor='white',
238  edgecolor='black',
239  boxstyle='round,pad=0.15'))
240  ax.text(
241  sensorCoordinates[i][0] + 0.02,
242  sensorCoordinates[i][1] + 0.045,
243  line[2],
244  color='black',
245  size='8',
246  bbox=dict(
247  facecolor='white',
248  edgecolor='black',
249  boxstyle='round,pad=0.15'))
250  ax.text(
251  sensorCoordinates[i][0] + 0.02,
252  sensorCoordinates[i][1] + 0.010,
253  line[3],
254  color='black',
255  size='8',
256  bbox=dict(
257  facecolor='white',
258  edgecolor='black',
259  boxstyle='round,pad=0.15'))
260  ax.text(
261  sensorCoordinates[i][0] + 0.20,
262  sensorCoordinates[i][1] + 0.078,
263  line[4],
264  color='black',
265  size='8',
266  bbox=dict(
267  facecolor='white',
268  edgecolor='black',
269  boxstyle='round,pad=0.15'))
270  ax.text(
271  sensorCoordinates[i][0] + 0.20,
272  sensorCoordinates[i][1] + 0.045,
273  line[5],
274  color='black',
275  size='8',
276  bbox=dict(
277  facecolor='white',
278  edgecolor='black',
279  boxstyle='round,pad=0.15'))
280  ax.text(
281  sensorCoordinates[i][0] + 0.20,
282  sensorCoordinates[i][1] + 0.012,
283  line[6],
284  color='black',
285  size='8',
286  bbox=dict(
287  facecolor='white',
288  edgecolor='black',
289  boxstyle='round,pad=0.15'))
290  else:
291  ax.text(sensorCoordinates[i][0] + (sensorCoordinates[i][2] - sensorCoordinates[i][0]) / 4 - 0.024,
292  sensorCoordinates[i][1] + 0.121,
293  line[1],
294  color='black',
295  size='8',
296  bbox=dict(facecolor='white',
297  edgecolor='black',
298  boxstyle='round,pad=0.15'))
299  ax.text(sensorCoordinates[i][0] + (sensorCoordinates[i][2] - sensorCoordinates[i][0]) / 4 - 0.024,
300  sensorCoordinates[i][1] + 0.099,
301  line[2],
302  color='black',
303  size='8',
304  bbox=dict(facecolor='white',
305  edgecolor='black',
306  boxstyle='round,pad=0.15'))
307  ax.text(sensorCoordinates[i][0] + (sensorCoordinates[i][2] - sensorCoordinates[i][0]) / 4 - 0.024,
308  sensorCoordinates[i][1] + 0.077,
309  line[3],
310  color='black',
311  size='8',
312  bbox=dict(facecolor='white',
313  edgecolor='black',
314  boxstyle='round,pad=0.15'))
315  ax.text(sensorCoordinates[i][0] + (sensorCoordinates[i][2] - sensorCoordinates[i][0]) / 4 - 0.030,
316  sensorCoordinates[i][1] + 0.055,
317  line[4],
318  color='black',
319  size='8',
320  bbox=dict(facecolor='white',
321  edgecolor='black',
322  boxstyle='round,pad=0.15'))
323  ax.text(sensorCoordinates[i][0] + (sensorCoordinates[i][2] - sensorCoordinates[i][0]) / 4 - 0.030,
324  sensorCoordinates[i][1] + 0.033,
325  line[5],
326  color='black',
327  size='8',
328  bbox=dict(facecolor='white',
329  edgecolor='black',
330  boxstyle='round,pad=0.15'))
331  ax.text(sensorCoordinates[i][0] + (sensorCoordinates[i][2] - sensorCoordinates[i][0]) / 4 - 0.030,
332  sensorCoordinates[i][1] + 0.011,
333  line[6],
334  color='black',
335  size='8',
336  bbox=dict(facecolor='white',
337  edgecolor='black',
338  boxstyle='round,pad=0.15'))
339 
340  line = ['NAN', r'$u$ = NAN', r'$v$ = NAN', r'$w$ = NAN', r'$\alpha$ = NAN', r'$\beta$ = NAN', r'$\gamma$ = NAN']
341 
342 ax.axis('off')
343 fig.savefig('outputSensors.png', dpi=300)
344 
345 """
346 fig = plt.figure(figsize=(8.27, 11.69))
347 ax = fig.add_subplot(111)
348 """
349 
350 ax.cla()
351 ax.text(0.00, 0.97, 'Experiment: 1002(Phase II), Run: XXXX, Date: 6/10/2017', color='black', size='14.5', weight='bold')
352 
353 ax.text(0.00, 0.325, ' layer 1 ladder 1', color='black', size='12', weight='bold')
354 ax.text(0.00, 0.405, ' layer 2 ladder 1', color='black', size='12', weight='bold')
355 ax.text(0.00, 0.485, ' layer 3 ladder 1', color='black', size='12', weight='bold')
356 ax.text(0.00, 0.59, ' layer 4 ladder 1', color='black', size='12', weight='bold')
357 ax.text(0.00, 0.73, ' layer 5 ladder 1', color='black', size='12', weight='bold')
358 ax.text(0.00, 0.88, ' layer 6 ladder 1', color='black', size='12', weight='bold')
359 
360 sensorCoordinates = (
361  [0.20, 0.30, 0.60, 0.36],
362  [0.60, 0.30, 0.99, 0.36],
363  [0.20, 0.38, 0.60, 0.44],
364  [0.60, 0.38, 0.99, 0.44],
365  [0.20, 0.46, 0.60, 0.52],
366  [0.60, 0.46, 0.99, 0.52],
367  [0.00, 0.56, 0.30, 0.63],
368  [0.30, 0.56, 0.60, 0.63],
369  [0.60, 0.56, 0.90, 0.63],
370  [0.00, 0.70, 0.25, 0.78],
371  [0.25, 0.70, 0.50, 0.78],
372  [0.50, 0.70, 0.75, 0.78],
373  [0.75, 0.70, 0.99, 0.78],
374  [0.00, 0.85, 0.20, 0.92],
375  [0.20, 0.85, 0.40, 0.92],
376  [0.40, 0.85, 0.60, 0.92],
377  [0.60, 0.85, 0.80, 0.92],
378  [0.80, 0.85, 0.99, 0.92])
379 
380 number = 0.0
381 for i in range(0, 6):
382  layer_id, ladder_id, sensor_id = beast2_ladders[i]
383  for j in [1, 2, 3, 4, 5, 6]:
384  number = float(dataframe['value'][dataframe['layer'] == layer_id][dataframe['ladder'] == ladder_id]
385  [dataframe['sensor'] == sensor_id][dataframe['parameter'] == j])
386  if (number != 0.0):
387  excludedLadder[i] = False
388 
389 for i in range(0, 18):
390  excludedSensor[i] = False
391  if i in range(0, 2):
392  if excludedLadder[0]:
393  excludedSensor[i] = True
394  if i in range(2, 4):
395  if excludedLadder[1]:
396  excludedSensor[i] = True
397  if i in range(4, 6):
398  if excludedLadder[2]:
399  excludedSensor[i] = True
400  if i in range(6, 9):
401  if excludedLadder[3]:
402  excludedSensor[i] = True
403  if i in range(9, 13):
404  if excludedLadder[4]:
405  excludedSensor[i] = True
406  if i in range(13, 18):
407  if excludedLadder[5]:
408  excludedSensor[i] = True
409 
410  if excludedSensor[i]:
411  if (i == 6 or i == 9 or i == 13):
412  ax.add_patch(plt.Polygon([[sensorCoordinates[i][0],
413  sensorCoordinates[i][1] - 0.03],
414  [sensorCoordinates[i][2],
415  sensorCoordinates[i][1]],
416  [sensorCoordinates[i][2],
417  sensorCoordinates[i][3]],
418  [sensorCoordinates[i][0],
419  sensorCoordinates[i][3] + 0.03]],
420  facecolor='red',
421  alpha=0.3,
422  edgecolor='black'))
423  ax.add_patch(plt.Polygon([[sensorCoordinates[i][0],
424  sensorCoordinates[i][1] - 0.03],
425  [sensorCoordinates[i][2],
426  sensorCoordinates[i][1]],
427  [sensorCoordinates[i][2],
428  sensorCoordinates[i][3]],
429  [sensorCoordinates[i][0],
430  sensorCoordinates[i][3] + 0.03]],
431  fill=None))
432  else:
433  ax.add_patch(plt.Polygon([[sensorCoordinates[i][0], sensorCoordinates[i][1]],
434  [sensorCoordinates[i][2], sensorCoordinates[i][1]],
435  [sensorCoordinates[i][2], sensorCoordinates[i][3]],
436  [sensorCoordinates[i][0], sensorCoordinates[i][3]]],
437  facecolor='red', alpha=0.3, edgecolor='black'))
438  ax.add_patch(plt.Polygon([[sensorCoordinates[i][0], sensorCoordinates[i][1]],
439  [sensorCoordinates[i][2], sensorCoordinates[i][1]],
440  [sensorCoordinates[i][2], sensorCoordinates[i][3]],
441  [sensorCoordinates[i][0], sensorCoordinates[i][3]]], fill=None))
442 
443  else:
444  if (i == 6 or i == 9 or i == 13):
445  ax.add_patch(plt.Polygon([[sensorCoordinates[i][0],
446  sensorCoordinates[i][1] - 0.03],
447  [sensorCoordinates[i][2],
448  sensorCoordinates[i][1]],
449  [sensorCoordinates[i][2],
450  sensorCoordinates[i][3]],
451  [sensorCoordinates[i][0],
452  sensorCoordinates[i][3] + 0.03]],
453  facecolor='green',
454  alpha=0.1,
455  edgecolor='green'))
456 
457  else:
458 
459  ax.add_patch(plt.Polygon([[sensorCoordinates[i][0],
460  sensorCoordinates[i][1]],
461  [sensorCoordinates[i][2],
462  sensorCoordinates[i][1]],
463  [sensorCoordinates[i][2],
464  sensorCoordinates[i][3]],
465  [sensorCoordinates[i][0],
466  sensorCoordinates[i][3]]],
467  facecolor='green',
468  alpha=0.1,
469  edgecolor='green'))
470 
471 ladderCoordinates = (
472  [0.30, 0.325],
473  [0.30, 0.405],
474  [0.30, 0.485],
475  [0.30, 0.59],
476  [0.30, 0.74],
477  [0.30, 0.88]
478 )
479 
480 number = 0.0
481 for i in range(0, 6):
482  layer_id, ladder_id, sensor_id = beast2_ladders[i]
483  print('Sensor: ', layer_id, '.', ladder_id, '.', sensor_id)
484  for j in [1, 2, 3, 4, 5, 6]:
485  number = float(dataframe['value'][dataframe['layer'] == layer_id][dataframe['ladder'] == ladder_id]
486  [dataframe['sensor'] == sensor_id][dataframe['parameter'] == j])
487  if (number != 0.0):
488  line[j] = quantity[j] + str(round(number, 5)) + unit[j]
489  print(line[j])
490  else:
491  print('Non calculated ladder!!')
492  print('')
493 
494  if not excludedLadder[i]:
495  ax.text(
496  ladderCoordinates[i][0] + 0.000,
497  ladderCoordinates[i][1] + 0.011,
498  line[1],
499  color='black',
500  size='8',
501  bbox=dict(
502  facecolor='white',
503  edgecolor='black',
504  boxstyle='round,pad=0.15'))
505 
506  ax.text(
507  ladderCoordinates[i][0] + 0.200,
508  ladderCoordinates[i][1] + 0.011,
509  line[2],
510  color='black',
511  size='8',
512  bbox=dict(
513  facecolor='white',
514  edgecolor='black',
515  boxstyle='round,pad=0.15'))
516  ax.text(
517  ladderCoordinates[i][0] + 0.400,
518  ladderCoordinates[i][1] + 0.011,
519  line[3],
520  color='black',
521  size='8',
522  bbox=dict(
523  facecolor='white',
524  edgecolor='black',
525  boxstyle='round,pad=0.15'))
526  ax.text(
527  ladderCoordinates[i][0] + 0.000,
528  ladderCoordinates[i][1] - 0.011,
529  line[4],
530  color='black',
531  size='8',
532  bbox=dict(
533  facecolor='white',
534  edgecolor='black',
535  boxstyle='round,pad=0.15'))
536  ax.text(
537  ladderCoordinates[i][0] + 0.200,
538  ladderCoordinates[i][1] - 0.011,
539  line[5],
540  color='black',
541  size='8',
542  bbox=dict(
543  facecolor='white',
544  edgecolor='black',
545  boxstyle='round,pad=0.15'))
546  ax.text(
547  ladderCoordinates[i][0] + 0.400,
548  ladderCoordinates[i][1] - 0.011,
549  line[6],
550  color='black',
551  size='8',
552  bbox=dict(
553  facecolor='white',
554  edgecolor='black',
555  boxstyle='round,pad=0.15'))
556  line = ['NAN', r'$u$ = NAN', r'$v$ = NAN', r'$w$ = NAN', r'$\alpha$ = NAN', r'$\beta$ = NAN', r'$\gamma$ = NAN']
557 
558 ax.text(0.10, 0.25, ' PXD half shell', color='black', size='12', weight='bold')
559 ax.text(0.70, 0.25, ' SVD half shell', color='black', size='12', weight='bold')
560 
561 number = 0.0
562 for i in range(0, 2):
563  layer_id, ladder_id, sensor_id = beast2_halfshells[i]
564  print('Sensor: ', layer_id, '.', ladder_id, '.', sensor_id)
565  for j in [1, 2, 3, 4, 5, 6]:
566  number = float(dataframe['value'][dataframe['layer'] == layer_id][dataframe['ladder'] == ladder_id]
567  [dataframe['sensor'] == sensor_id][dataframe['parameter'] == j])
568  if (number != 0.0):
569  excludedHalfShell[i] = False
570  line[j] = quantity[j] + str(round(number, 5)) + unit[j]
571  print(line[j])
572  else:
573  print('Non calculated ladder!!')
574  print('')
575 
576  if excludedHalfShell[i]:
577  ax.add_patch(patches.Arc(xy=[0.45, 0.15], width=0.10, height=0.07, angle=.0,
578  theta1=-90.0, theta2=90.0, color='red', alpha=0.1, linewidth=35.0))
579  ax.add_patch(patches.Arc(xy=[0.45, 0.15], width=0.28, height=0.20, angle=.0,
580  theta1=-90.0, theta2=90.0, color='red', alpha=0.1, linewidth=40.0))
581  else:
582  ax.add_patch(patches.Arc(xy=[0.45, 0.15], width=0.10, height=0.07, angle=.0,
583  theta1=-90.0, theta2=90.0, color='green', alpha=0.1, linewidth=35.0))
584  ax.add_patch(patches.Arc(xy=[0.45, 0.15], width=0.28, height=0.20, angle=.0,
585  theta1=-90.0, theta2=90.0, color='green', alpha=0.1, linewidth=40.0))
586 
587  ax.text(0.12 + 0.6 * i, 0.22,
588  line[1],
589  color='black',
590  size='8',
591  bbox=dict(
592  facecolor='white',
593  edgecolor='black',
594  boxstyle='round,pad=0.15'))
595 
596  ax.text(0.12 + 0.6 * i, 0.19,
597  line[2],
598  color='black',
599  size='8',
600  bbox=dict(
601  facecolor='white',
602  edgecolor='black',
603  boxstyle='round,pad=0.15'))
604  ax.text(0.12 + 0.6 * i, 0.16,
605  line[3],
606  color='black',
607  size='8',
608  bbox=dict(
609  facecolor='white',
610  edgecolor='black',
611  boxstyle='round,pad=0.15'))
612  ax.text(0.12 + 0.6 * i, 0.13,
613  line[4],
614  color='black',
615  size='8',
616  bbox=dict(
617  facecolor='white',
618  edgecolor='black',
619  boxstyle='round,pad=0.15'))
620  ax.text(0.12 + 0.6 * i, 0.10,
621  line[5],
622  color='black',
623  size='8',
624  bbox=dict(
625  facecolor='white',
626  edgecolor='black',
627  boxstyle='round,pad=0.15'))
628  ax.text(0.12 + 0.6 * i, 0.07,
629  line[6],
630  color='black',
631  size='8',
632  bbox=dict(
633  facecolor='white',
634  edgecolor='black',
635  boxstyle='round,pad=0.15'))
636  line = ['NAN', r'$u$ = NAN', r'$v$ = NAN', r'$w$ = NAN', r'$\alpha$ = NAN', r'$\beta$ = NAN', r'$\gamma$ = NAN']
637 
638 ax.axis('off')
639 fig.savefig('outputLadders.png', dpi=300)
640 # plt.show()
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33