script for convert .t3pa files to .t3pa_cls
.t3pa file example:
Index $\quad$ Matrix $\quad$ Index $\quad$ ToA $\quad$ ToT $\quad$ FToA $\quad$ Overflow
0 $\quad$ 4574 $\quad$ 832 $\quad$ 29 $\quad$ 6 $\quad$ 0
1 $\quad$ 4831 $\quad$ 832 $\quad$ 35 $\quad$ 7 $\quad$ 0
2 $\quad$ 4575 $\quad$ 832 $\quad$ 100 $\quad$ 8 $\quad$ 0
3 $\quad$ 31031 $\quad$ 1745 $\quad$ 22 $\quad$ 11 $\quad$ 0
.
.
.
.t3pa_cls file example:
% Index $\quad$ Matrix Index $\quad$ [ RowNo, ClmNo ] $\quad$ ToA $\quad$ FToA $\quad$ ( ToA_in_ns ) $\quad$ ToT ( ToT_in_keV ) $\quad$ Overflow
# 1, $\quad$ Nunmasked = 3, $\quad$ Nmasked = 0, $\quad$ Ntot = 3 # Tfirst = 2.0787500000000000e+04 ns, $\quad$ Tlast = 2.0790625000000000e+04 ns, $\quad$ dT = 3.125000 ns, $\quad$ Etot = 64.428148 keV
2 $\quad$ 4575 $\quad$ [ 17, 223 ] $\quad$ 832 $\quad$ 8 $\quad$ ( 2.0787500000000000e+04 ns ) $\quad$ 100 $\quad$ ( 37.867914 keV ) $\quad$ 0
1 $\quad$ 4831 $\quad$ [ 18, 223 ] $\quad$ 832 $\quad$ 7 $\quad$ ( 2.0789062500000000e+04 ns ) $\quad$ 35 $\quad$ ( 14.733453 keV ) $\quad$ 0
0 $\quad$ 4574 $\quad$ [ 17, 222 ] $\quad$ 832 $\quad$ 6 $\quad$ ( 2.0790625000000000e+04 ns ) $\quad$ 29 $\quad$ ( 11.826781 keV ) $\quad$ 0
# 2, $\quad$ Nunmasked = 3, $\quad$ Nmasked = 0, $\quad$ Ntot = 3 # Tfirst = 4.3601562500000000e+04 ns, $\quad$ Tlast = 4.3607812500000000e+04 ns, $\quad$ dT = 6.250000 ns, $\quad$ Etot = 63.577435 keV
5 $\quad$ 30775 $\quad$ [ 120, 55 ] $\quad$ 1745 $\quad$ 15 $\quad$ ( 4.3601562500000000e+04 ns ) $\quad$ 99 $\quad$ ( 37.617059 keV ) $\quad$ 0
4 $\quad$ 30776 $\quad$ [ 120, 56 ] $\quad$ 1745 $\quad$ 13 $\quad$ ( 4.3604687500000000e+04 ns ) $\quad$ 44 $\quad$ ( 14.715446 keV ) $\quad$ 0
3 $\quad$ 31031 $\quad$ [ 121, 55 ] $\quad$ 1745 $\quad$ 11 $\quad$ ( 4.3607812500000000e+04 ns ) $\quad$2 2 $\quad$ ( 11.244929 keV ) $\quad$ 0
.
.
.
import numpy as np
import math
#import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.cm as cm
#from matplotlib.mlab import griddata
from urllib.error import HTTPError # recognise the error stemming from missing data
#import urllib
import urllib.request
t3pa2cls_XII - upravena fce energy(a, b, c, t, ToT, pocet_udalosti, RowNo, ClmNo) - nyni je se pocita i s pripadem "nan" t3pa2cls_XV_pc - zkousim vyzobat vysoke energie (jednotlive interakce) - funkce single_interaction. Dale delam prumernou velikost stopy stopy interakce pro danou energii - funkce size_of_interactions_average. Dale delam spektra 2 casti vyboje podle zadaneho casu - primarne pro double breakdown, tj. funkce energy_spectra_doublebreakdown
#Define an exception which will be raised if the data is missing and stop the notebook execution
class StopExecution(Exception):
def _render_traceback_(self):
pass
#shot_no = 44395 #test discharge for which the notebook will definitely work
shot_no = 45022
shot = shot_no
identifier='H03-W0051_shot_'+str(shot)+'_450V'
detector = 'H03-W0051'
ds = np.DataSource('/tmp') # temporary storage for downloaded files
scalars_URL = 'http://golem.fjfi.cvut.cz/shots/{shot_no}/Diagnostics/PlasmaDetection/Results/{name}'
def get_scalar(shot_no, name):
return float(ds.open(scalars_URL.format(shot_no=shot_no, name=name)).read())
t_plasma_start = get_scalar(shot_no, 't_plasma_start')
t_plasma_end = get_scalar(shot_no, 't_plasma_end')
is_plasma = get_scalar(shot_no, 'b_plasma')
def get_file(shot, identifier):
#Pick the discharge to analyse
URL = 'http://golem.fjfi.cvut.cz/shots/{shot}/Diagnostics/TimepixDetector/H03/{identifier}.t3pa'
url = URL.format(shot=shot, identifier=identifier)
try:
file_name_t3pa=url
with urllib.request.urlopen(file_name_t3pa) as ft3pa:
line = ft3pa.readline()
line = line.decode('utf‐8')
ft3pa.close
except HTTPError:
print('File not found at %s. Aborting notebook execution.' % url)
raise StopExecution
return file_name_t3pa
def get_file_calib(name_calib):
#Pick the discharge to analyse
URL = 'http://golem.fjfi.cvut.cz/shots/{shot}/Diagnostics/TimepixDetector/calib_matrix_H03/{name_calib}.txt'
url = URL.format(shot=shot, name_calib=name_calib)
#print(url)
try:
file_calib=url
with urllib.request.urlopen(file_calib) as calib:
line = calib.readline()
line = line.decode('utf‐8')
calib.close
except HTTPError:
print('File not found at %s. Aborting notebook execution.' % url)
raise StopExecution
return file_calib
def load_calib(file_calib):
with urllib.request.urlopen(file_calib) as fc:
calib=[] #vytvoreni 1D pole
for i in range(0,256): #tj. rozsah 0-255
temp = [] # docasne pole
for j in range(0,256):
temp.append(0) #naplneni docasneho pole 0
calib.append(temp) #naplneni pole a[] docasnym polem temp
for i in range(0,256): #nacteni calib matice do pole calib
line = fc.readline()
line = line.decode('utf‐8')
word=line.strip().split(' ')
for j in range(0,256):
#calib[i][j]=float(word[j]) #i = radek, j = sloupec0
calib[j][i]=float(word[j]) #j = radek, i = sloupec0 - pouze pro stavajici kalibraci - verze XV
fc.close
return calib
def load_t3pa_file(file_t3pa):
index=[]
matrix_index=[]
ToA=[]
ToT=[]
FToA=[]
overflow=[]
pocet_udalosti = 0
with urllib.request.urlopen(file_t3pa) as ft3pa:
line = ft3pa.readline()
line = line.decode('utf‐8')
while True:
line = ft3pa.readline()
line = line.decode('utf‐8')
word=line.strip().split('\t') #v t3pa souboru je oddelovac \t
if line == '':
break
index.append(word[0])
matrix_index.append(word[1])
ToA.append(float(word[2]))
ToT.append(float(word[3]))
FToA.append(float(word[4]))
overflow.append(float(word[5]))
pocet_udalosti = pocet_udalosti + 1
ft3pa.close
return index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti
def noise(index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti): #tuto fci nemus9m explicitn2 volat - volam ji v fci load_t3pa
pocet=int(0) #pocet sumicich pixelu
konst=int(len(index)/1000)+1
noise_matrix_index=[]
for i in range(0,konst):
pom = [] # pomocne pole
k=0 #pomocna promenna - udava, kolik je v czklu ve skutecnosti udalosti - aby nebyla chyba 'list index out of range'
for j in range(0,1001):
if i*1000+j>=len(index):
break
pom.append(matrix_index[i*1000+j])
k=k+1
for m in range(0,k):
count=int(0) #pocet vvyskytu stejneho matrix index behem 1000 udalosti
index_=int(-1) #budu testovat, jestli pixel na ktery koukam je sumici (abych ho nezapocital 2x)
for p in range(0,pocet):
#index=int(p)
if pom[m]==noise_matrix_index[p]:
index_=p #pixel na ktery jsem uz koukal a byl sumici
break
if index_ >=0 and pom[m]==noise_matrix_index[index_]:
continue
for l in range(0,k):
if pom[m]==pom[l]:
count=count+1
####podminka na sumici pixely
if count>=50: #kdyz se pixel vyskytne behem tisice udalosti vicekrat nez toto cislo, je sumici
noise_matrix_index.append(pom[m])
#noise_matrix_index[pocet]=pom[i]
pocet=pocet+1
pom.clear()
pocet_udalosti=len(index)
for n in range (0,pocet_udalosti):
for o in range(0,len(noise_matrix_index)):
if n >=pocet_udalosti:
break
if(matrix_index[n]==noise_matrix_index[o]):
del matrix_index[n]
del index[n]
del ToA[n]
del ToT[n]
del FToA[n]
del overflow[n]
pocet_udalosti=pocet_udalosti-1
continue
return pocet_udalosti,index, matrix_index, ToA, ToT, FToA, overflow
def t3pa_data(pocet_udalosti,index, matrix_index, ToA, ToT, FToA, overflow):
#rovnou vyhodim sumici pixely
pocet_udalosti,index, matrix_index, ToA, ToT, FToA, overflow=noise(index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti)
RowNo=[]
ClmNo=[]
for i in range(0,len(matrix_index)):
#RowNo.append(int(int(matrix_index[i]))//int(256))
#ClmNo.append(int(int(matrix_index[i]))%int(256))
ClmNo.append(int(int(matrix_index[i]))//int(256)) #ver XV - bude pro novou kalibraci - nyn9 to bere 3patnou kalibraci jednotlivych pixelu (cislovani radku a sloupcu stejne jako v pixetu)
RowNo.append(int(int(matrix_index[i]))%int(256)) ##ver XV - bude super pro novou kalibraci - odpovida radkum a sloupcum v pixetu. Nyni bere spatne kalibrace pixelu (viz fce load_calib)
return index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti, RowNo, ClmNo
def hit_map(detector,hit_map_fig,RowNo,ClmNo):
plt.hist2d(RowNo,ClmNo,bins=(256,256),cmap='Blues')
cb=plt.colorbar()
cb.set_label('Counts in pixel')
plt.xlabel('x [pixel]')
plt.ylabel('y [pixel]')
plt.title(detector)
plt.savefig(hit_map_fig, dpi = 1000)
return
def energy(a, b, c, t, ToT, pocet_udalosti, RowNo, ClmNo):
E=[] #energy in keV
#for i in range (0,pocet_udalosti):
pom=0
for i in range (0,len(ToT)):
Sqrt=float(0.0)
e1=float(0.0)
e2=float(0.0)
# promenna sqrt je vnitrek odmocniny
Sqrt = (((float(b[RowNo[i]][ClmNo[i]])+float(a[RowNo[i]][ClmNo[i]])*float(t[RowNo[i]][ClmNo[i]])-float(ToT[i])))*(((float(b[RowNo[i]][ClmNo[i]])+float(a[RowNo[i]][ClmNo[i]])*float(t[RowNo[i]][ClmNo[i]])-float(ToT[i])))) + (float(4)*float(a[RowNo[i]][ClmNo[i]])*float(c[RowNo[i]][ClmNo[i]]))) #zmena oproti verzi VI
if float(Sqrt)<float(0):
E.append(float(0))
else:
'''
V kalibracni matici a se obcas vyskytne 0 -> ve vypoctu energie
je tim padem deleni nulou -> energie diverguje. Jak to vyresit?
zatim polozim energii = 0 (kdyz a=0), pak se uvidi
nakonec udelam limitu vyrazu energie pro a->0 (L'hopital)
'''
if a[RowNo[i]][ClmNo[i]]==0:
e1=((float(t[RowNo[i]][ClmNo[i]]))/float(2)) + ((((float(b[RowNo[i]][ClmNo[i]])+float(a[RowNo[i]][ClmNo[i]])*float(t[RowNo[i]][ClmNo[i]])-float(ToT[i]))*(float(t[RowNo[i]][ClmNo[i]]))) - 2*(float(c[RowNo[i]][ClmNo[i]])))/(float(2)*np.sqrt(float(Sqrt))))
e2=((float(t[RowNo[i]][ClmNo[i]]))/float(2)) - ((((float(b[RowNo[i]][ClmNo[i]])+float(a[RowNo[i]][ClmNo[i]])*float(t[RowNo[i]][ClmNo[i]])-float(ToT[i]))*(float(t[RowNo[i]][ClmNo[i]]))) - 2*(float(c[RowNo[i]][ClmNo[i]])))/(float(2)*np.sqrt(float(Sqrt))))
else:
e1=((-(float(b[RowNo[i]][ClmNo[i]]) - (float(a[RowNo[i]][ClmNo[i]])*float(t[RowNo[i]][ClmNo[i]]))-float(ToT[i])))+np.sqrt(float(Sqrt)))/(float(2)*float(a[RowNo[i]][ClmNo[i]]))
e2=((-(float(b[RowNo[i]][ClmNo[i]]) - (float(a[RowNo[i]][ClmNo[i]])*float(t[RowNo[i]][ClmNo[i]]))-float(ToT[i])))-np.sqrt(float(Sqrt)))/(float(2)*float(a[RowNo[i]][ClmNo[i]]))
if a[RowNo[i]][ClmNo[i]]<0:
e1=-1
e2=-1
if math.isnan(e1):
e1=-1
if math.isnan(e2):
e2=-1
if e1<0 and e2<0:
E.append(float(0))
if e1>=0 and e1>e2:
E.append(float(e1))
if e2>=0 and e2>e1:
E.append(float(e2))
if e1>=0 and e2==e1:
E.append(float(e1))
return E
def Time(ToA, FToA, pocet_udalosti, RowNo, ClmNo):
T=[] #time in ns
for i in range (0,pocet_udalosti):
Time=float(0.0)
Time=(float(ToA[i])-((float(FToA[i])/float(16))))*float(25)
T.append(float(Time))
return T
def Timewalk_parameters_Si():
#SI - korekce na TimeWalk - parametry
A = -1.21988
B = 4.33638
C = 29.5075
D = 1
sigma_A=0.7013
sigma_B=0.1366
sigma_C=4.753
sigma_D=0
return A, B, C, D, sigma_A, sigma_B, sigma_C, sigma_D
def Timewalk(E,T):
i=0
A, B, C, D, sigma_A, sigma_B, sigma_C, sigma_D = Timewalk_parameters_Si()
while i < len(T):
timewalk=float(0)
timewalk = (C / (E[i] - B)) + A
if(timewalk<0):
timewalk=0
T[i]=T[i]-timewalk
i=i+1
return E,T
def remove_interactions_with_zero_energy(index, matrix_index, ToA, ToT, FToA, overflow, RowNo, ClmNo, E, T):
i=0
treshold=5.015347
while i < len(T):
if E[i]<treshold: #E[i] < energy treshold
index.pop(i)
matrix_index.pop(i)
ToA.pop(i)
ToT.pop(i)
FToA.pop(i)
overflow.pop(i)
RowNo.pop(i)
ClmNo.pop(i)
E.pop(i)
T.pop(i)
continue
i=i+1
return index, matrix_index, ToA, ToT, FToA, overflow, RowNo, ClmNo, E, T
def clustering_new(index, matrix_index, ToA, ToT, FToA, overflow, RowNo, ClmNo, E, T):
dT=float(50)
indexCl, TCl,ECl, matrix_indexCl, ToACl,ToTCl,FToACl,RowNoCl,ClmNoCl,overflowCl=[],[],[],[],[],[],[],[],[],[]
StartLastElem=len(T)-1
indexCl.append(int(index[StartLastElem]))
TCl.append(float(T[StartLastElem]))
ECl.append(float(E[StartLastElem]))
matrix_indexCl.append(int(matrix_index[StartLastElem]))
RowNoCl.append(int(RowNo[StartLastElem]))
ClmNoCl.append(int(ClmNo[StartLastElem]))
ToACl.append(float(ToA[StartLastElem]))
ToTCl.append(float(ToT[StartLastElem]))
FToACl.append(float(FToA[StartLastElem]))
overflowCl.append(float(overflow[StartLastElem]))
del index[StartLastElem]
del T[StartLastElem]
del E[StartLastElem]
del matrix_index[StartLastElem]
del RowNo[StartLastElem]
del ClmNo[StartLastElem]
del ToA[StartLastElem]
del ToT[StartLastElem]
del FToA[StartLastElem]
del overflow[StartLastElem]
j=1
pom=float(TCl[0]+dT)
while(j >0):
if(len(T) == 0):
break
k=0
j=0
while (k<=(len(TCl)-1)):
i=len(T)-1
if(len(T) == 0):
break
pocet_sousedu=0 #pocet sousednich pixelu - mohou byt maximalne 4
delka=0
# verze X
count=0 #pomocna promanna, kterou urcuji, ze se ma nasledujici cyklus while projit jeste jednou, pokud je i = -1
while(float(T[i])<=(pom)):
delka=delka+1
if(((((int(RowNoCl[k]))==(int(RowNo[i])+1))or((int(RowNoCl[k]))==(int(RowNo[i])-1))) and ((int(ClmNoCl[k]))==(int(ClmNo[i])))) or (((int(RowNoCl[k]))==(int(RowNo[i]))) and (((int(ClmNoCl[k]))==(int(ClmNo[i])+1))or((int(ClmNoCl[k]))==(int(ClmNo[i])-1))))):
#beru jen pixely, které mají společnou jednu stranu.
#pixely, kter0 spolu sousedí přes roh neuvažuji
indexCl.append(int(index[i]))
TCl.append(float(T[i]))
ECl.append(float(E[i]))
matrix_indexCl.append(int(matrix_index[i]))
RowNoCl.append(int(RowNo[i]))
ClmNoCl.append(int(ClmNo[i]))
ToACl.append(float(ToA[i]))
ToTCl.append(float(ToT[i]))
FToACl.append(float(FToA[i]))
overflowCl.append(float(overflow[i]))
# Removes i-th Row
del index[i]
del T[i]
del E[i]
del matrix_index[i]
del RowNo[i]
del ClmNo[i]
del ToA[i]
del ToT[i]
del FToA[i]
del overflow[i]
j=j+1
i=len(T)-1
pocet_sousedu=pocet_sousedu+1
if(len(T) == 0):
break
if(pocet_sousedu==4):
break
continue
i=i-1
if(i==-1): # verze X
count=count+1
if(i<0 and len(T)>0): # verze X
i=0
if(count>1):
break
if(i>=len(T)):
break
k=k+1
if(len(TCl)>2):
indexCl, TCl, ECl, matrix_indexCl, RowNoCl, ClmNoCl, ToACl, ToTCl, FToACl, overflowCl = insertionSort(indexCl, TCl, ECl, matrix_indexCl, RowNoCl, ClmNoCl, ToACl, ToTCl, FToACl, overflowCl)
return T, indexCl,TCl, ECl, matrix_indexCl, RowNoCl, ClmNoCl, ToACl, ToTCl, FToACl, overflowCl
def insertionSort(indexCl, TCl, ECl, matrix_indexCl, RowNoCl, ClmNoCl, ToACl, ToTCl, FToACl, overflowCl):
# Function to do insertion sort
# Traverse through 1 to len(arr)
for i in range(1, len(TCl)):
key = TCl[i]
# Move elements of arr[0..i-1], that are
# greater than key, to one position ahead
# of their current position
#ostatni
key1 = indexCl[i]
key2 = ECl[i]
key3 = matrix_indexCl[i]
key4 = RowNoCl[i]
key5 = ClmNoCl[i]
key6 = ToACl[i]
key7 = ToTCl[i]
key8 = FToACl[i]
key9 = overflowCl[i]
j = i-1
while j >= 0 and key < TCl[j] :
TCl[j + 1] = TCl[j]
#ostatni
indexCl[j + 1] = indexCl[j]
ECl[j + 1] = ECl[j]
matrix_indexCl[j + 1] = matrix_indexCl[j]
RowNoCl[j + 1] = RowNoCl[j]
ClmNoCl[j + 1] = ClmNoCl[j]
ToACl[j + 1] = ToACl[j]
ToTCl[j + 1] = ToTCl[j]
FToACl[j + 1] = FToACl[j]
overflowCl[j + 1] = overflowCl[j]
j -= 1
TCl[j + 1] = key
#ostatni
indexCl[j + 1] = key1
ECl[j + 1] = key2
matrix_indexCl[j + 1] = key3
RowNoCl[j + 1] =key4
ClmNoCl[j + 1] = key5
ToACl[j + 1] = key6
ToTCl[j + 1] = key7
FToACl[j + 1] = key8
overflowCl [j + 1] = key9
return indexCl, TCl, ECl, matrix_indexCl, RowNoCl, ClmNoCl, ToACl, ToTCl, FToACl, overflowCl
def file_t3pa_cls_new(file_t3pa_cls,T):
with open(file_t3pa_cls, "w", encoding="utf-8") as t3pa_cls:
t3pa_cls.write('%\n')
t3pa_cls.write('% Index Matrix Index [ RowNo, ClmNo ] ToA FToA ( ToA_in_ns ) ToT ( ToT_in_keV ) Overflow\n')
t3pa_cls.write('\n')
i=1
T_first=[]
E_tot=[]
N_tot=[]
eventNo=0 #for high_energy_event function
while(len(T) > 0):
T, indexCl,TCl, ECl, matrix_indexCl, RowNoCl, ClmNoCl, ToACl, ToTCl, FToACl, overflowCl = clustering_new(index, matrix_index, ToA, ToT, FToA, overflow, RowNo, ClmNo, E, T)
Tfirst=float(TCl[0])
Tlast=float(TCl[len(TCl)-1])
dT=Tlast-Tfirst
Etot=float(0)
for k in range(0,len(TCl)):
Etot=Etot+float(ECl[k])
T_first.append(float(Tfirst))
dT=Tlast-Tfirst
E_tot.append(float(Etot))
N_tot.append(len(TCl)) #new in ver. XV
t3pa_cls.write('# '+str(i)+', Nunmasked = '+str(len(TCl))+', Nmasked = 0, Ntot = '+str(len(TCl))+'\n')
t3pa_cls.write('# Tfirst = '+str(Tfirst)+' ns, Tlast = '+str(Tlast)+' ns, dT = '+str(dT)+' ns, Etot = '+str(Etot)+' keV\n')
for j in range(0,len(TCl)):
t3pa_cls.write(str(indexCl[j])+' '+str(matrix_indexCl[j])+' [ '+str(RowNoCl[j])+', '+str(ClmNoCl[j])+' ] '+str(ToACl[j])+' '+str(FToACl[j])+' ( '+str(TCl[j])+' ns ) '+str(ToTCl[j])+' ( '+str(ECl[j])+' keV ) '+str(overflowCl[j])+'\n')
t3pa_cls.write('\n')
#eventNo=single_interaction(eventNo,Etot, Tfirst, ECl, TCl, RowNoCl, ClmNoCl,path)
i=i+1
t3pa_cls.close
return T_first, E_tot, N_tot
def energy_spectrum_in_time(Tfirst, Etot): #dela histogram - energie zaznamenana v case
pom = 0
dt=100 #(ns) time width of 1 bin
T_first=0 #cas, kdy prisel trigger a yacalo mereni
T_last=(max(Tfirst)) #posledni z Tfirst
Delta_T = T_last - T_first
poc = int(int(Delta_T) / float(dt)) + 1 #pocet casovych oken
T_int_first=[] #cas
E=[] #energie
for i in range(0,poc):
T_int_first.append((i*dt) + dt/2)
E.append(0)
#XII
for j in range(0,len(Tfirst)):
time_index=0
time_index=int(((Tfirst[j]-T_first)/dt))
if float(Tfirst[j]-T_first) >= (T_int_first[time_index] - dt / 2) and float(Tfirst[j]-T_first) < (T_int_first[time_index] + dt / 2):
E[time_index]=float(E[time_index])+float(Etot[j])
pom=pom+1
for l in range(0,len(T_int_first)):
T_int_first[l]=T_int_first[l]+T_first
caption, T_int_first = energy_in_time_hist(T_int_first, E, figure_E_in_time_hist, t_plasma_start, t_plasma_end, is_plasma, dt)
return dt, caption, T_int_first, E
def energy_in_time_hist(T_int_first, E,figure_E_in_time_hist, t_plasma_start, t_plasma_end, is_plasma, dt):
plt.rcParams.update({'font.size': 20})
fig, ax = plt.subplots(figsize =(10, 7))
for k in range(0,len(T_int_first)):
T_int_first[k] = T_int_first[k] / 1000000
plt.plot(T_int_first, E, drawstyle='steps-mid')
plt.title(detector+', #'+str(shot_no))
plt.xlabel('Time [ms]')
plt.ylabel('Energy [keV]')
if is_plasma == 1:
for t in (t_plasma_start, t_plasma_end):
plt.axvline(t, color='k', linestyle='--')
plt.xlim([0, (t_plasma_start + t_plasma_end)])
else:
plt.xlim(0,)
plt.ylim(0,) #10 000 keV
plt.savefig(figure_E_in_time_hist, dpi = 1000)
caption = '# x = time in ms, count = energy in keV, dT= '+str(dt)+' ns'
return caption, T_int_first
def hits_in_time_hist_new(T, dt, t_plasma_start, t_plasma_end, is_plasma,figure_count_in_time_hist):
pom = 0
T_first=0 #cas, kdy prisel trigger a yacalo mereni
T_last=(max(T)) #posledni z Tfirst
Delta_T = T_last - T_first
poc = int(int(Delta_T) / float(dt)) + 1 #pocet casovych oken
T_hit=[] #cas
count=[] #energie
for i in range(0,poc):
T_hit.append((i*dt) + dt/2)
count.append(0)
for j in range(0,len(T)):
time_index=0
time_index=int(((T[j]-T_first)/dt))
k=time_index
for j in range(0,len(T)):
time_index=0
time_index=int(((T[j]-T_first)/dt))
if float(T[j]-T_first) >= (T_hit[time_index] - dt / 2) and float(T[j]-T_first) < (T_hit[time_index] + dt / 2):
count[time_index] = count[time_index] + 1
pom=pom+1
for l in range(0,len(T_hit)):
T_hit[l]=T_hit[l]+T_first
plt.rcParams.update({'font.size': 20})
fig, ax = plt.subplots(figsize =(10, 7))
for k in range(0,len(T_hit)):
T_hit[k] = T_hit[k] / 1000000
#plt.plot(T_hit, count)
plt.plot(T_hit, count, drawstyle='steps-mid')
plt.title(detector+', #'+str(shot_no))
plt.xlabel('Time [ms]')
plt.ylabel('Count')
if is_plasma == 1:
for t in (t_plasma_start, t_plasma_end):
plt.axvline(t, color='k', linestyle='--')
plt.xlim([0, (t_plasma_start + t_plasma_end)])
else:
plt.xlim(0,)
plt.ylim(0,) #10 000 keV
plt.savefig(figure_count_in_time_hist, dpi = 1000)
caption = '# x = time in ms, dT= '+str(dt)+' ns'
return caption, T_hit,count
def energy_spectrum(Etot):
E_min=0
dE=5 #keV
E_max=max(Etot)
pocet=(E_max//dE) + 3
pocet=int(pocet)
E_max=float(dE*pocet)
xle=[]
xre=[]
xmean=[]
for p in range (0,pocet):
xle.append(E_min + (p * (E_max - E_min)) / pocet)
xre.append(xle[p]+dE)
xmean.append((xle[p] + xre[p]) / 2)
count=[]
for l in range(0,pocet):
count.append(0)
#XII
for i in range(0,len(Etot)):
E_index=int(((Etot[i]-E_min)/dE))
if ((xle[E_index] <= Etot[i]) and (Etot[i] < xre[E_index])):
count[E_index]=count[E_index]+1
plt.rcParams.update({'font.size': 20})
fig, ax = plt.subplots(figsize =(10, 7))
#ax.hist(Etot, bins = xle)
plt.fill_between(xmean, count,step='mid') #pre mid post
plt.plot(xmean, count, drawstyle='steps-mid')
plt.title(detector+', #'+str(shot_no))
plt.xlabel('Energy [keV]')
plt.ylabel('Count')
plt.xlim(0,)
ax.set_yscale('log') #log scale y
caption = '# x = energy in keV, dE= '+str(dE)+' keV'
plt.savefig(figure_E_hist, dpi = 1000)
return caption, xmean,count, xle, Etot
def hist_file(file_hist, xmean, count, caption ):
with open(file_hist, "w", encoding="utf-8") as hist:
hist.write('#\n')
hist.write('#'+str(caption)+'\n')
hist.write('# x_mean count\n')
hist.write('\n')
for m in range(0,len(xmean)):
hist.write(str(xmean[m])+' '+str(count[m])+'\n')
hist.close
return T_first, E_tot
def multiplot(icon_fig, x1,y1,x2,y2):
plt.rcParams.update({'font.size': 20})
fig, ax = plt.subplots(nrows=2,figsize =(10, 7))
ax[0].plot(x1, y1, drawstyle='steps-mid')
ax[0].set_xlabel('Time [ms]')
ax[0].set_ylabel('Energy [keV]')
if is_plasma == 1:
for t in (t_plasma_start, t_plasma_end):
ax[0].axvline(t, color='k', linestyle='--')
ax[0].set_xlim([0, (t_plasma_start + t_plasma_end)])
else:
ax[0].set_xlim(0,)
ax[0].set_ylim(0,) #keV
#ax[1].hist(y2, bins = x2)
ax[1].fill_between(x2, y2,step='mid') #pre mid post
ax[1].plot(x2, y2, drawstyle='steps-mid')
ax[1].set_xlabel('Energy [keV]')
ax[1].set_ylabel('Count')
ax[1].set_xlim(0,)
#ax[1].set_ylim(0,)
ax[1].set_yscale('log') #log scale y
fig.subplots_adjust(hspace=0.3)
plt.savefig(icon_fig, dpi = 1000)
return
def single_interaction(eventNo,Etot, Tfirst, ECl, TCl, RowNoCl, ClmNoCl,path): # ver XV
#tuto funkci volam ve funkci file_t3pa_cls_new(file_t3pa_cls,T):
#This function is calling in function file_t3pa_cls_new(file_t3pa_cls,T)
high_E = 1500 #[keV] - zadani, jaka energie je pro me vysoka
if(Etot>=high_E or len(ECl)>15):
#if (len(ECl)>15): #len(ECl) = pocet pixelu dane interakce
print("Total energy of track: "+str(Etot)+" keV\n")
A, B, C, D, sigma_A, sigma_B, sigma_C, sigma_D = Timewalk_parameters_Si()
######################
#SI - rekonstrukce z(t) - parametry
a=0.0193947
b=-0.0273934
sigma_a=0.0004163
sigma_b=0.009832
#######################
time=[]
sigma_time=[]
time_min = []
time_max=[]
z_rec=[]
z_rec_min=[]
z_rec_max=[]
sigma_z_rec=[]
for i in range(0, len(TCl)):
time.append(TCl[i] - Tfirst)
#chyba urceni casu = chyba timewalk ->
sigma_time.append(np.sqrt(((sigma_C / (pow((ECl[i] - B), D)))*(sigma_C / (pow((ECl[i] - B), D)))) + (((sigma_B*C*D) / (pow((ECl[i] - B), (D + 1))))*((sigma_B*C*D) / (pow((ECl[i] - B), (D + 1))))) + (((sigma_D*C*math.log(ECl[i] - B)) / (pow((ECl[i] - B), D)))* ((sigma_D*C*math.log(ECl[i] - B)) / (pow((ECl[i] - B), D)))) + (sigma_A*sigma_A)))
time_min.append(time[i] - sigma_time[i])
time_max.append(time[i] + sigma_time[i])
#//
#//rekonstrukce hloubky interakce
z_rec.append(a * time[i] + (b))
sigma_z_rec.append(np.sqrt(((time[i]*time[i])*(sigma_a*sigma_a)) + (sigma_b*sigma_b) + (a*a)*(sigma_time[i]*sigma_time[i])))
z_rec_min.append(z_rec[i] - sigma_z_rec[i])
z_rec_max.append(z_rec[i] + sigma_z_rec[i])
#//
single_interaction_file=str(path)+'event'+str(eventNo)+'.txt'
single_interaction_2D_fig=str(path)+'2D_event'+str(eventNo)+'.png'
single_interaction_3D_fig=str(path)+'3D_event'+str(eventNo)+'.png'
with open(single_interaction_file, "w", encoding="utf-8") as f:
f.write('#\n')
f.write('# x_mean y_mean z_rec z_rec_min z_rec_max sigma_z_rec\n')
f.write('#E_tot='+str(Etot)+'\n')
f.write('\n')
for m in range(0,len(TCl)):
#print(str(RowNoCl[m])+' '+str(ClmNoCl[m])+' '+str(z_rec[m])+' '+str(z_rec_min[m])+' '+str(z_rec_max[m])+' '+str(sigma_z_rec[m])+' '+str(ECl[m])+'\n')
f.write(str(RowNoCl[m])+' '+str(ClmNoCl[m])+' '+str(z_rec[m])+' '+str(z_rec_min[m])+' '+str(z_rec_max[m])+' '+str(sigma_z_rec[m])+' '+str(ECl[m])+'\n')
f.close
############################### plot
#binwidth=1
if ((max(RowNoCl)-min(RowNoCl))>=(max(ClmNoCl)-min(ClmNoCl))):
rang=max(RowNoCl)-min(RowNoCl)
#bins=(range((min(RowNoCl)-1), (max(RowNoCl)+3), binwidth), range((min(ClmNoCl)-1), (min(ClmNoCl)+rang+3), binwidth))
x_min=min(RowNoCl)-1
x_max=max(RowNoCl)+2
y_min=min(ClmNoCl)-1
y_max=min(ClmNoCl)+rang+2
else:
rang = max(ClmNoCl)-min(ClmNoCl)
#bins=(range((min(RowNoCl)-1), (min(RowNoCl)+rang+3), binwidth), range((min(ClmNoCl)-1), (max(ClmNoCl)+3), binwidth))
x_min=min(RowNoCl)-1
x_max=min(RowNoCl)+rang+2
y_min=min(ClmNoCl)-1
y_max=max(ClmNoCl)+2
###############$$$$$$$$$$$$$$$$$$$$
rows, cols = (x_max-x_min, x_max-x_min)
#arrECl = [[0]*cols]*rows
arrECl= [[0] * cols for _ in range(rows)]
for i in range (x_min,x_max):
for j in range (y_min,y_max):
for k in range(0,len(RowNoCl)):
if ((i==RowNoCl[k]) and (j==ClmNoCl[k])):
#print(str(i)+" "+str(j)+" "+str(RowNoCl[k])+" "+str(ClmNoCl[k])+"\n")
arrECl[i-x_min][j-y_min]=ECl[k]
arrECl=np.transpose(arrECl)
arrECl[arrECl == 0] = np.nan
#2D plot
plt.imshow(arrECl,cmap='jet', interpolation='none', origin=[(x_min-0.2),(y_min-0.2)], aspect='equal', extent=[x_min-0.2,x_max,y_min-0.2,y_max])
###############$$$$$$$$$$$$$$$$$$$$
cb=plt.colorbar(pad=0.005)
plt.tick_params(axis="x",direction="in")
plt.tick_params(axis="y",direction="in")
cb.ax.tick_params(axis='y', direction='in')
cb.set_label('Energy in pixel [keV]')
plt.xlabel('x [pixel]')
plt.ylabel('y [pixel]')
plt.title('$E_{tot}$ = '+str(round(Etot, 2))+' keV, $N_{tot}$ = '+str(len(ECl)))
plt.savefig(single_interaction_2D_fig, dpi = 1000)
plt.show()
plt.close()
############################### plot
############## 3D plot
# Creating figure
fig = plt.figure(figsize = (16, 9))
ax = plt.axes(projection ="3d")
# Add x, y gridlines
ax.grid(b = True, color ='grey', #
linestyle ='-.', linewidth = 0.3,
alpha = 0.2)
# Creating plot
sctt = ax.scatter3D(RowNoCl, ClmNoCl, z_rec,
alpha = 0.8,
c = ECl,
cmap = 'jet',
s = 4000, #size of bubbles in plot
marker ='o')
plt.title('$E_{tot}$ = '+str(round(Etot, 2))+' keV, $N_{tot}$ = '+str(len(ECl)))
ax.set_xlabel('x [pixel]', fontweight ='bold')
ax.set_ylabel('y [pixel]', fontweight ='bold')
ax.set_zlabel('z [mm]', fontweight ='bold')
cb=fig.colorbar(sctt, ax = ax, shrink = 0.5,aspect = 10,pad=0.00005) #
cb.ax.tick_params(axis='y', direction='in')
cb.set_label('Energy in pixel [keV]', fontweight ='bold')
plt.savefig(single_interaction_3D_fig, dpi = 1000)
# show plot
plt.show()
plt.close()
############## 3D plot
eventNo=eventNo+1
return eventNo
def size_of_interactions_average(Etot, Ntot,file_hist): #ver XV
E_min=0
dE=5 #keV
E_max=max(Etot)
pocet=(E_max//dE) + 3
pocet=int(pocet)
E_max=float(dE*pocet)
xle=[]
xre=[]
xmean=[]
count=[]
nop=[] #number of pixels
nop_mean=[] #mean number of pixels in dE
sigma=[] #root mean square error of the mean - stredni kvadraticka chyba prumeru
for p in range (0,pocet):
xle.append(E_min + (p * (E_max - E_min)) / pocet)
xre.append(xle[p]+dE)
xmean.append((xle[p] + xre[p]) / 2)
count.append(0)
nop.append(0)
nop_mean.append(0)
sigma.append(0)
#XII
for i in range(0,len(Etot)):
E_index=int(((Etot[i]-E_min)/dE))
if ((xle[E_index] <= Etot[i]) and (Etot[i] < xre[E_index])):
count[E_index]=count[E_index]+1
nop[E_index]=nop[E_index]+Ntot[i] #ver XV
for l in range(0,pocet):
if nop[l]!=0:
nop_mean[l]=float(nop[l])/float(count[l])
#####Computing sigma
for i in range(0,len(Etot)):
E_index=int(((Etot[i]-E_min)/dE))
if ((xle[E_index] <= Etot[i]) and (Etot[i] < xre[E_index])):
if nop_mean[E_index]!=0:
sigma[E_index]=sigma[E_index]+((float(Ntot[i])-float(nop_mean[E_index]))*(float(Ntot[i])-float(nop_mean[E_index])))
for l in range(0,pocet):
if nop[l]!=0 and count[l]>1:
sigma[l]=np.sqrt(sigma[l]/(float(count[l])*(float(count[l])-1)))
if nop[l]!=0 and count[l]==1:
sigma[l]=10
#####Computing sigma
#####write to file
with open(file_hist, "w", encoding="utf-8") as hist:
hist.write('# x_mean [keV] mean_size_of_interaction [pixel] sigma_mean_size_of_interaction\n')
for m in range(0,len(xmean)):
hist.write(str(xmean[m])+' '+str(nop_mean[m])+' '+str(sigma[m])+'\n')
hist.close
#####write to file
plt.rcParams.update({'font.size': 20})
fig, ax = plt.subplots(figsize =(10, 7))
#plt.fill_between(xmean, nop,step='mid',color='blue', alpha=0.3) #pre mid post
#plt.fill_between(xmean, nop,step='mid') #pre mid post
plt.plot(xmean, nop_mean, drawstyle='steps-mid')
plt.errorbar(xmean, nop_mean, yerr = sigma,fmt ='.', linewidth=0.7)
plt.title(detector+', #'+str(shot_no))
plt.xlabel('Energy [keV]')
plt.ylabel('Average size of interaction [pixel]')
plt.xlim(0,500)
plt.ylim(0,17)
#ax.set_yscale('log') #log scale y
caption = '# x = energy in keV, dE= '+str(dE)+' keV'
plt.savefig(figure_size_interaction, dpi = 1000)
return
def energy_spectra_doublebreakdown(Etot, Tfirst, file_hist):
#this function separates discharge into two parts acording to time Tsep and creates energy spectrum for each part.
#This is for discharges with double brakdown
Tsep=14636000 # [ns]
E_min=0
dE=5 #keV
E_max=max(Etot)
pocet=(E_max//dE) + 3
pocet=int(pocet)
E_max=float(dE*pocet)
xle=[]
xre=[]
xmean=[]
for p in range (0,pocet):
xle.append(E_min + (p * (E_max - E_min)) / pocet)
xre.append(xle[p]+dE)
xmean.append((xle[p] + xre[p]) / 2)
count_first=[]
count_second=[]
for l in range(0,pocet):
count_first.append(0)
count_second.append(0)
#XII
for i in range(0,len(Etot)):
E_index=int(((Etot[i]-E_min)/dE))
if ((xle[E_index] <= Etot[i]) and (Etot[i] < xre[E_index])):
if(Tfirst[i]<Tsep):
count_first[E_index]=count_first[E_index]+1
else:
count_second[E_index]=count_second[E_index]+1
caption = '# x = energy in keV, dE= '+str(dE)+' keV'
with open(file_hist, "w", encoding="utf-8") as hist:
hist.write('#\n')
hist.write('#'+str(caption)+'\n')
hist.write('# x_mean count_before_2nd_breakdown count_2nd_breakdown\n')
hist.write('\n')
for m in range(0,len(xmean)):
hist.write(str(xmean[m])+' '+str(count_first[m])+' '+str(count_second[m])+'\n')
hist.close
plt.rcParams.update({'font.size': 20})
fig, ax = plt.subplots(figsize =(10, 7))
#plt.fill_between(xmean, count_first,step='mid') #pre mid post
plt.plot(xmean, count_first, label='Before 2nd breakdown', drawstyle='steps-mid')
plt.plot(xmean, count_second, label='2nd breakdown', drawstyle='steps-mid')
plt.legend(loc='best')
plt.title(detector+', #'+str(shot_no))
plt.xlabel('Energy [keV]')
plt.ylabel('Count')
plt.xlim(0,500)
ax.set_yscale('log') #log scale y
plt.savefig(figure_energy_spectra_doublebreakdown, dpi = 1000)
return
#soubory, ktere ctu
#read files
t3pa=get_file(shot, identifier)
name_calib='caliba'
caliba=get_file_calib(name_calib)
name_calib='calibb'
calibb=get_file_calib(name_calib)
name_calib='calibc'
calibc=get_file_calib(name_calib)
name_calib='calibt'
calibt=get_file_calib(name_calib)
#vytvorene soubory:
#created files
t3pa_cls= 'H03-W0051_shot_'+str(shot)+'_450V.t3pa_cls'
E_hist= 'H03-W0051_shot_'+str(shot)+'_450V_E_hist.txt'
E_in_time_hist= 'H03-W0051_shot_'+str(shot)+'_450V_discharge_energy.txt'
count_in_time_hist= 'H03-W0051_shot_'+str(shot)+'_450V_discharge_hits.txt'
size_interaction= 'H03-W0051_shot_'+str(shot)+'size_interaction.txt'
file_energy_spectra_doublebreakdown= 'H03-W0051_shot_'+str(shot)+'energy_spectra_doublebreakdown.txt'
#created figures
icon_fig='icon-fig'
figure_E_in_time_hist='discharge_energy'
figure_count_in_time_hist='discharge_hits'
figure_E_hist='Energy_spectrum'
hit_map_fig='hit-map'
figure_size_interaction= 'H03-W0051_shot_'+str(shot)+'size_interaction'
figure_energy_spectra_doublebreakdown= 'H03-W0051_shot_'+str(shot)+'energy_spectra_doublebreakdown'
#nactu jednotlive kalibracni matice - abych to nemusel delat v kazde funkci
a=load_calib(caliba)
b=load_calib(calibb)
c=load_calib(calibc)
t=load_calib(calibt)
#nactu a urcim jednotlive hodnoty - abych to nemusel delat v kazde funkci
index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti = load_t3pa_file(t3pa)
index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti, RowNo, ClmNo = t3pa_data(pocet_udalosti,index, matrix_index, ToA, ToT, FToA, overflow)
raw data
#hit map
hit_map(detector,hit_map_fig,RowNo,ClmNo)
Energy and time calculation from raw data.
E=energy(a, b, c, t, ToT, pocet_udalosti, RowNo, ClmNo)
T=Time(ToA, FToA, pocet_udalosti, RowNo, ClmNo)
index, matrix_index, ToA, ToT, FToA, overflow, RowNo, ClmNo, E, T = remove_interactions_with_zero_energy(index, matrix_index, ToA, ToT, FToA, overflow, RowNo, ClmNo, E, T)
E,T=Timewalk(E,T)
#sort by time
T, index, matrix_index, ToA, ToT, FToA, overflow, RowNo, ClmNo, E = (list(t) for t in zip(*sorted(zip(T, index, matrix_index, ToA, ToT, FToA, overflow, RowNo, ClmNo, E), reverse=True))) #serazeni od nejvetsiho po nejmensi
T_pom=T.copy()
#save to file
T_first, E_tot, Ntot = file_t3pa_cls_new(t3pa_cls,T)
dt, caption, T_int_first, E = energy_spectrum_in_time(T_first, E_tot)
hist_file(E_in_time_hist, T_int_first, E, caption);
([8380331.25, 8395560.050087672, 8395599.113519607, 8413685.332156368, 8469477.899334786, 8573482.8125, 8574587.5, 8586434.375, 8593820.3125, 8616407.8125, 8636062.514269773, 8676559.616374252, 8682597.492422476, 8688431.798158076, 8752336.449505294, 8760895.772253396, 8771205.037165966, 8778641.781268893, 8780961.677396834, 8781171.875, 8781184.375, 8781185.350899678, 8782433.817219468, 8795382.007719627, 8815208.233783968, 8815281.356361995, 8820546.875, 8825135.556760259, 8840122.943189211, 8840726.17644689, 8852832.8125, 8852835.71474651, 8863806.016206292, 8874783.398631912, 8881631.25, 8885672.89278627, 8886023.614101319, 8904004.6875, 8915728.227761522, 8926711.286877338, 8931748.4375, 8947577.324533904, 8958143.29671559, 8963067.1875, 8971262.5, 9018897.702680828, 9032049.0897948, 9042578.322873177, 9046269.833657775, 9064519.733593045, 9064650.0, 9067714.725653425, 9070296.875, 9087215.413590765, 9087376.008841421, 9103548.520502768, 9104461.590896888, 9113435.916038278, 9118183.14143849, 9137784.193645308, 9138370.583174491, 9138601.5625, 9141800.83817383, 9147863.146666493, 9256093.081555046, 9307860.887813134, 9307918.123741427, 9327880.59491078, 9328839.318132462, 9343811.411298105, 9345789.232602473, 9360976.5625, 9361173.889707617, 9369742.94272419, 9369764.0625, 9369782.751127174, 9386254.850706257, 9386312.19194304, 9396045.3125, 9420342.457985824, 9420343.860857528, 9473414.236538298, 9476247.040159889, 9483540.702486962, 9485105.544341223, 9522945.3125, 9522951.5625, 9556987.153210023, 9559408.867453163, 9563474.024432903, 9569631.739846876, 9570446.824874856, 9595313.658684969, 9606013.004574098, 9610996.587982725, 9611144.916375902, 9615406.6825912, 9620534.936218375, 9635239.0625, 9660657.8125, 9673108.996870456, 9689057.8125, 9689064.0625, 9689762.794663794, 9689770.621211167, 9690948.4375, 9693741.999018285, 9701508.104636258, 9703456.508466678, 9719746.170663599, 9744779.38652106, 9744868.915949652, 9746270.121031754, 9766224.926173681, 9766279.175492348, 9786910.9375, 9816943.75, 9824307.8125, 9827518.75, 9828187.060693908, 9830158.362582933, 9830671.714220468, 9840150.539150072, 9841232.790237462, 9841310.718540898, 9849805.35098437, 9857138.766167508, 9921668.75, 9928062.5, 9944286.633969182, 9956490.955305835, 9964969.48678167, 9969453.034394667, 9986599.255618092, 9992645.44357981, 10001445.47586707, 10083687.972331883, 10084019.61351077, 10127925.0, 10150971.875, 10163358.676858148, 10166863.176715828, 10172147.08534053, 10202536.002154639, 10227347.808074016, 10227671.388878739, 10251998.87972701, 10264566.824187037, 10287243.64389981, 10296700.0, 10300623.276256204, 10308350.606008422, 10327710.428810623, 10329917.1875, 10335060.9375, 10349469.241365355, 10358749.804183543, 10366247.42803561, 10369211.235285422, 10371115.225080809, 10403179.6875, 10405100.416646453, 10413827.561329193, 10484717.1875, 10488302.90687093, 10488327.834116042, 10525814.303833934, 10527674.594659885, 10692070.3125, 10713636.580444977, 10714586.422275009, 10723078.125, 10750154.606687015, 10774423.4375, 10813771.433421278, 10926417.845473066, 10993553.94443892, 11013045.011695787, 11015957.8125, 11015990.668643162, 11027215.625, 11030682.8125, 11030693.634400634, 11032831.603672102, 11044901.029922618, 11050197.920411926, 11086990.625, 11088087.024305306, 11090968.75, 11101416.170910718, 11105037.322327498, 11111688.20877576, 11151393.75, 11190351.148027968, 11204606.25, 11213280.96116831, 11218848.31453733, 11218865.697820103, 11224710.970670218, 11242244.486741222, 11243100.442028962, 11247900.836369803, 11265267.1875, 11278873.4375, 11279972.44155031, 11280275.0, 11288017.339613318, 11304930.62858387, 11305698.047005376, 11314703.61014108, 11319453.85161488, 11323420.3125, 11323435.812344866, 11368283.756312069, 11369171.875, 11370674.744864717, 11371408.13710705, 11373830.454153756, 11374725.0, 11376267.17378618, 11382852.669409066, 11433026.319293363, 11433569.244679587, 11451190.625, 11451470.095823174, 11451975.0, 11454107.6289706, 11461097.505728504, 11461935.9375, 11462537.844093114, 11468054.034612898, 11468463.91378842, 11468965.625, 11470160.638264539, 11470378.125, 11470642.589249508, 11470885.52821646, 11475300.0, 11479099.890875898, 11481092.748057775, 11508921.141116988, 11519068.91372498, 11519512.053793004, 11521044.232853025, 11525012.925564293, 11561720.3125, 11572796.875, 11581500.0, 11590839.750401711, 11592367.175737336, 11592577.630783547, 11592791.910093011, 11621251.861350225, 11629680.257614864, 11631456.25, 11637591.493111053, 11638364.341006128, 11665998.853800263, 11669407.53940684, 11674323.906193437, 11676102.388441144, 11677321.875, 11678035.9375, 11678625.0, 11690987.5, 11700464.540652862, 11700515.232785745, 11703470.03697864, 11724862.5, 11727526.09283982, 11731637.567592416, 11731738.621614046, 11733021.385630136, 11759202.40646637, 11784807.04548231, 11787548.712406786, 11930632.0745438, 11932222.25855049, 11952286.816443358, 12016429.633845055, 12050473.08392265, 12090543.475914735, 12165506.84932908, 12585924.200061047, 12602335.594428815, 12602430.081073085, 12632769.329902602, 12648418.894417904, 12666369.39494912, 12695235.9375, 12784835.860850526, 12787794.58088709, 12814187.256572904, 12817554.939826958, 12823151.73830205, 12862949.337413695, 12869419.83837722, 12898957.760721065, 12904979.727822984, 13021878.125, 13021899.269030595, 13424291.584438957, 15497018.75, 15596375.0, 15755921.733252643, 15808604.360725978, 15835010.9375, 15856725.0, 15858360.9375, 15863847.910280814, 15868238.121898754, 15896971.617192341, 15905289.37397273, 15906481.54480872, 15917393.598055288, 15918261.308446163, 15918319.925604945, 15919929.717876649, 15919951.092868183, 15919961.512499735, 15923132.8125, 15923329.6875, 15928562.5, 15929010.84299964, 15930243.520116245, 15937858.29603355, 15939275.0, 15940293.75, 15940472.342478478, 15941154.313476779, 15941885.510571364, 15941900.075167548, 15941945.690865451, 15942911.749981342, 15943134.097462079, 15943425.240502872, 15943475.999760253, 15943622.64591996, 15943901.451838711, 15944236.865292246, 15944923.6058725, 15944976.5625, 15945014.871960258, 15945482.88742259, 15948026.667688554, 15948242.1875, 15948866.870647231, 15949297.74013802, 15951748.75881344, 15951975.193491241, 15952214.086428422, 15953655.688286988, 15953845.20061705, 15954771.115908582, 15954794.523761306, 15954869.752005333, 15955151.5625, 15955237.5, 15955248.697993528, 15956398.4375, 15961028.102829656, 15964019.791327477, 15964250.759706799, 15964272.587456673, 15969940.585474877, 15970578.664088141, 15970580.19753573, 15971117.979963452, 15973030.496825922, 15974375.577745214, 15974431.37878686, 15974753.097022904, 15975576.5625, 15976895.3125, 15977637.837760314, 15978159.382373286, 15978706.633209335, 15978708.516790317, 15980470.989919841, 15981098.4375, 15982320.993058478, 15984657.552367434, 15988062.64670236, 15989460.836099716, 15989466.058534805, 15989474.282079747, 15989557.401056996, 15992303.066133155, 15992321.65747341, 15994271.875, 15994807.505294966, 15996093.455669519, 15999443.75, 16005097.780904002, 16006250.061389744, 16007792.05567506, 16009312.102219375, 16011577.030510934, 16017014.049985029, 16030895.3125, 146613115.23697713], [44.00466664089657, 50.253376388026616, 8.679639692444283, 35.29781078528086, 14.145906753351786, 28.61460893459307, 54.474650698417115, 46.23743704872715, 52.82248266856681, 29.22741154240919, 11.150084870314812, 34.433729367771875, 17.9659776651498, 64.30609345589377, 12.034909760215593, 72.52767900118937, 43.42729854985976, 6.425242233706373, 5.427533494266044, 40.111029523828265, 82.36677242257082, 106.50205122314524, 32.00179122825693, 6.924834307900447, 16.833753929196458, 5.132781869345306, 78.48494800317066, 22.771426898092045, 43.36996113105175, 22.7104329507187, 78.75129948490877, 38.76507506024323, 24.634951713311757, 99.22450340741833, 45.303097913244954, 21.649552016005295, 11.415441226523388, 62.501027872234985, 15.348208824250761, 14.86123674560449, 39.811984132932345, 8.735333044147184, 21.972124476081074, 75.82893372300559, 84.58875642838333, 70.79162477018268, 51.20441449442475, 135.66397214517286, 136.81795675653913, 31.064494544055577, 84.2382175583116, 28.757968025353932, 43.09851633477869, 64.42781267430846, 20.974022026956927, 8.330963783337026, 58.51174381165867, 37.029259504207474, 10.56593808852168, 13.925166220851256, 24.945506544345918, 58.486743240269604, 18.333862546129016, 18.15260577324523, 12.8872338942968, 37.97881073411865, 7.981018704272332, 24.587240761803173, 278.7891002188353, 38.789885252968446, 12.223801987995607, 102.19502506655597, 195.33288713256215, 12.556527438760357, 50.7605501252434, 13.469242671791218, 15.60233747016462, 23.64836784606985, 49.16298874390166, 102.8253753653481, 29.067074966407347, 11.41109107952489, 11.396063234890805, 11.251023142392873, 52.26602469824332, 49.33758540161766, 67.99442410930305, 19.69991455370709, 8.936198633688505, 18.092176758846758, 17.20751355111505, 8.260246996503287, 20.562607995868845, 17.29073223790282, 53.350353797037684, 27.80406324705209, 45.446870013427386, 12.973958998521828, 78.58065307486763, 74.75685645346577, 5.2795482728034075, 51.86758271604424, 36.603535937311776, 17.82302689543313, 11.647149499211103, 73.77294000817953, 25.288028793210504, 55.39222076563386, 7.191093630604197, 12.79921339675803, 13.906300524365275, 5.953988895585133, 5.239817903946845, 73.84612510218324, 167.2090816575525, 47.178557613412565, 43.755391829019274, 73.88468484203239, 44.775933833750095, 83.32035225734296, 7.273970456412515, 58.484611132413235, 17.490403866006766, 234.84671690214157, 24.84423242903533, 82.72570060180718, 6.7057537927619935, 51.72829952774249, 39.89068217908445, 18.482478553043556, 6.309852019662575, 42.85547663316697, 14.607055473276262, 8.772422721924253, 5.467420898228986, 32.75136136302909, 9.765494768148299, 84.7761756967878, 57.81019587384227, 49.57447136004485, 8.80347596302395, 21.117538391728715, 73.34651903666224, 15.193805267288896, 64.30419305525629, 13.364218031998746, 30.568653900743573, 22.974348129065866, 8.231255548206855, 71.84800496827995, 10.884690995672583, 30.348036945430593, 13.30231071018863, 169.8999182029905, 42.686925787792944, 15.862483705233359, 19.829257330579704, 59.984042784591786, 77.05561021365799, 56.58131329573391, 45.03936043188413, 66.85237828412406, 49.290727841777546, 29.529505227008087, 66.26680029369795, 24.021396539450624, 21.282433543632322, 24.899013866486417, 85.32216414333382, 103.5792393452837, 18.02038857690019, 84.05082300731395, 27.02236380137591, 68.23002735885737, 10.501167311775234, 12.339701083644483, 6.014092010995906, 50.68365717306231, 69.85675426584037, 11.196616046915043, 56.21452206294536, 33.87607470585054, 5.241921381447826, 229.70219957782598, 10.386150954005807, 23.071611245723403, 56.373913298748, 13.393109132660278, 56.85577313992679, 97.29741367590528, 8.194803985459707, 24.512395346082954, 60.25545481285178, 9.003920436980257, 29.88670160668009, 14.619859204151176, 5.607277577320924, 6.276442710512052, 119.21606488479864, 28.145590494063434, 77.76112421987662, 14.350875825411283, 191.44601350466144, 45.03219302044385, 17.65306230015979, 58.24542851849673, 15.554824197661535, 13.00537746061748, 9.021690800525256, 23.703394305126835, 23.76673718893126, 71.451052513897, 37.33881147483891, 169.93492775916232, 29.63659282961991, 6.713617757674249, 13.52033897819242, 12.58278422107216, 48.39570837396122, 40.54639549770045, 16.035612310099136, 24.50435860142383, 9.787910243495018, 28.89177634225713, 16.220414074879397, 116.74107367262819, 25.361962410832838, 13.415469476328479, 37.949957451175635, 9.640348787524074, 63.87092665725222, 14.403448596418864, 81.22012390539463, 23.760512493280764, 42.78688543423992, 6.846453791505382, 22.44843522052236, 72.14826011554729, 10.961317770541534, 17.61714552721617, 101.38266744154339, 62.71964389904297, 51.48438516910589, 57.74063888157765, 92.53538294541791, 86.33916809511022, 52.59224074239854, 60.91939109363362, 12.405200123062214, 13.78288926979333, 50.15480132486677, 24.043690767744444, 30.532901197489885, 49.7453700323089, 41.34223030847243, 102.06662297662022, 16.121118968572574, 6.849564533410527, 35.702269845155115, 7.250359494450179, 12.112048221713678, 51.33299844671894, 48.671562726816205, 49.365859879418736, 67.6183720402811, 9.771315626924109, 74.8194901222403, 8.146059915401972, 52.340839547126436, 58.37709543632463, 16.846439396395237, 35.4208465280636, 42.282929194658266, 21.23946214618678, 25.98516335688908, 11.586427715196365, 63.81516673184322, 48.38486024764981, 71.89681353386648, 75.76386838090909, 23.089668735407777, 43.23476618629269, 173.88453833040788, 18.94536263082835, 5.280606367319426, 186.24164637759873, 16.591518957449004, 28.05905201040685, 9.943579537162107, 76.01130323527443, 5.808330545732891, 78.91564587546569, 8.161911594971865, 9.55427977641886, 27.434452614588764, 12.90177582132292, 139.0321873974375, 11.047726147713368, 26.87479539498316, 30.158435751457603, 5.878179628410904, 13.05237877922327, 38.204821190861374, 57.90268751734623, 5.526240416271941, 6.054764260736961, 30.890618169465228, 31.278596086203336, 29.445607419196588, 45.558702407891744, 59.591755809103006, 54.670864206943826, 9.609430210157303, 11.622054239037688, 14.392356381194649, 25.900444742594956, 5.090916776779495, 22.233298959214032, 64.75674155102352, 5.857786659767736, 121.2003023206619, 68.72945994799161, 35.817904558920915, 26.786122035931932, 24.689696109490768, 5.358768198394923, 69.24422062987963, 65.58815478905126, 8.55029145744922, 22.849110014681262, 5.327502184130052, 15.235967867384975, 57.66915220810209, 19.31557696601144, 10.719943862386195, 15.94492695572195, 5.377388126386723, 6.369772912739069, 52.45290379356414, 38.58437738558531, 13.867645793934152, 83.17304405992876, 19.292639690961494, 55.557755909237656, 13.971953846067773, 28.955158794078805, 6.2279794419200405, 6.949457195145357, 21.477577313656887, 9.500551240102116, 75.94044411996163, 26.33843391422959, 53.0112843070318, 19.24690358316715, 12.599196929008588, 11.685410278202507, 76.8363555949044, 40.12452669351477, 121.11725084442953, 74.30347947817697, 28.093468553941193, 118.8221724096274, 25.590801938176075, 6.361613718760577, 38.44663179097417, 5.360739967075305, 8.576058197223745, 53.04062986752708, 7.351794330688262, 70.230893426684, 5.168371837479809, 11.084256583139537, 53.714907907703726, 67.09362165560867, 92.06857704011688, 14.969687607419129, 68.74709812637269, 18.535719063401235, 18.35446005191506, 46.716132450929116, 20.646016943043207, 6.061459118527651, 6.51033666530046, 23.76369734904979, 11.880459727468082, 12.766371104210185, 89.48949062353616, 8.255690956767301, 65.77589269120108, 44.76708858453067, 7.4957816109032285, 9.094341547119528, 38.06963332681306, 46.99768800471213, 11.22503813678314, 9.222370837091196, 12.17645541222469, 71.74187320608485, 6.086798736060638, 47.66432212037243, 10.570925879814514])
caption, xmean,count, xle, Etot = energy_spectrum(E_tot)
hist_file(E_hist, xmean, count, caption);
([8380331.25, 8395560.050087672, 8395599.113519607, 8413685.332156368, 8469477.899334786, 8573482.8125, 8574587.5, 8586434.375, 8593820.3125, 8616407.8125, 8636062.514269773, 8676559.616374252, 8682597.492422476, 8688431.798158076, 8752336.449505294, 8760895.772253396, 8771205.037165966, 8778641.781268893, 8780961.677396834, 8781171.875, 8781184.375, 8781185.350899678, 8782433.817219468, 8795382.007719627, 8815208.233783968, 8815281.356361995, 8820546.875, 8825135.556760259, 8840122.943189211, 8840726.17644689, 8852832.8125, 8852835.71474651, 8863806.016206292, 8874783.398631912, 8881631.25, 8885672.89278627, 8886023.614101319, 8904004.6875, 8915728.227761522, 8926711.286877338, 8931748.4375, 8947577.324533904, 8958143.29671559, 8963067.1875, 8971262.5, 9018897.702680828, 9032049.0897948, 9042578.322873177, 9046269.833657775, 9064519.733593045, 9064650.0, 9067714.725653425, 9070296.875, 9087215.413590765, 9087376.008841421, 9103548.520502768, 9104461.590896888, 9113435.916038278, 9118183.14143849, 9137784.193645308, 9138370.583174491, 9138601.5625, 9141800.83817383, 9147863.146666493, 9256093.081555046, 9307860.887813134, 9307918.123741427, 9327880.59491078, 9328839.318132462, 9343811.411298105, 9345789.232602473, 9360976.5625, 9361173.889707617, 9369742.94272419, 9369764.0625, 9369782.751127174, 9386254.850706257, 9386312.19194304, 9396045.3125, 9420342.457985824, 9420343.860857528, 9473414.236538298, 9476247.040159889, 9483540.702486962, 9485105.544341223, 9522945.3125, 9522951.5625, 9556987.153210023, 9559408.867453163, 9563474.024432903, 9569631.739846876, 9570446.824874856, 9595313.658684969, 9606013.004574098, 9610996.587982725, 9611144.916375902, 9615406.6825912, 9620534.936218375, 9635239.0625, 9660657.8125, 9673108.996870456, 9689057.8125, 9689064.0625, 9689762.794663794, 9689770.621211167, 9690948.4375, 9693741.999018285, 9701508.104636258, 9703456.508466678, 9719746.170663599, 9744779.38652106, 9744868.915949652, 9746270.121031754, 9766224.926173681, 9766279.175492348, 9786910.9375, 9816943.75, 9824307.8125, 9827518.75, 9828187.060693908, 9830158.362582933, 9830671.714220468, 9840150.539150072, 9841232.790237462, 9841310.718540898, 9849805.35098437, 9857138.766167508, 9921668.75, 9928062.5, 9944286.633969182, 9956490.955305835, 9964969.48678167, 9969453.034394667, 9986599.255618092, 9992645.44357981, 10001445.47586707, 10083687.972331883, 10084019.61351077, 10127925.0, 10150971.875, 10163358.676858148, 10166863.176715828, 10172147.08534053, 10202536.002154639, 10227347.808074016, 10227671.388878739, 10251998.87972701, 10264566.824187037, 10287243.64389981, 10296700.0, 10300623.276256204, 10308350.606008422, 10327710.428810623, 10329917.1875, 10335060.9375, 10349469.241365355, 10358749.804183543, 10366247.42803561, 10369211.235285422, 10371115.225080809, 10403179.6875, 10405100.416646453, 10413827.561329193, 10484717.1875, 10488302.90687093, 10488327.834116042, 10525814.303833934, 10527674.594659885, 10692070.3125, 10713636.580444977, 10714586.422275009, 10723078.125, 10750154.606687015, 10774423.4375, 10813771.433421278, 10926417.845473066, 10993553.94443892, 11013045.011695787, 11015957.8125, 11015990.668643162, 11027215.625, 11030682.8125, 11030693.634400634, 11032831.603672102, 11044901.029922618, 11050197.920411926, 11086990.625, 11088087.024305306, 11090968.75, 11101416.170910718, 11105037.322327498, 11111688.20877576, 11151393.75, 11190351.148027968, 11204606.25, 11213280.96116831, 11218848.31453733, 11218865.697820103, 11224710.970670218, 11242244.486741222, 11243100.442028962, 11247900.836369803, 11265267.1875, 11278873.4375, 11279972.44155031, 11280275.0, 11288017.339613318, 11304930.62858387, 11305698.047005376, 11314703.61014108, 11319453.85161488, 11323420.3125, 11323435.812344866, 11368283.756312069, 11369171.875, 11370674.744864717, 11371408.13710705, 11373830.454153756, 11374725.0, 11376267.17378618, 11382852.669409066, 11433026.319293363, 11433569.244679587, 11451190.625, 11451470.095823174, 11451975.0, 11454107.6289706, 11461097.505728504, 11461935.9375, 11462537.844093114, 11468054.034612898, 11468463.91378842, 11468965.625, 11470160.638264539, 11470378.125, 11470642.589249508, 11470885.52821646, 11475300.0, 11479099.890875898, 11481092.748057775, 11508921.141116988, 11519068.91372498, 11519512.053793004, 11521044.232853025, 11525012.925564293, 11561720.3125, 11572796.875, 11581500.0, 11590839.750401711, 11592367.175737336, 11592577.630783547, 11592791.910093011, 11621251.861350225, 11629680.257614864, 11631456.25, 11637591.493111053, 11638364.341006128, 11665998.853800263, 11669407.53940684, 11674323.906193437, 11676102.388441144, 11677321.875, 11678035.9375, 11678625.0, 11690987.5, 11700464.540652862, 11700515.232785745, 11703470.03697864, 11724862.5, 11727526.09283982, 11731637.567592416, 11731738.621614046, 11733021.385630136, 11759202.40646637, 11784807.04548231, 11787548.712406786, 11930632.0745438, 11932222.25855049, 11952286.816443358, 12016429.633845055, 12050473.08392265, 12090543.475914735, 12165506.84932908, 12585924.200061047, 12602335.594428815, 12602430.081073085, 12632769.329902602, 12648418.894417904, 12666369.39494912, 12695235.9375, 12784835.860850526, 12787794.58088709, 12814187.256572904, 12817554.939826958, 12823151.73830205, 12862949.337413695, 12869419.83837722, 12898957.760721065, 12904979.727822984, 13021878.125, 13021899.269030595, 13424291.584438957, 15497018.75, 15596375.0, 15755921.733252643, 15808604.360725978, 15835010.9375, 15856725.0, 15858360.9375, 15863847.910280814, 15868238.121898754, 15896971.617192341, 15905289.37397273, 15906481.54480872, 15917393.598055288, 15918261.308446163, 15918319.925604945, 15919929.717876649, 15919951.092868183, 15919961.512499735, 15923132.8125, 15923329.6875, 15928562.5, 15929010.84299964, 15930243.520116245, 15937858.29603355, 15939275.0, 15940293.75, 15940472.342478478, 15941154.313476779, 15941885.510571364, 15941900.075167548, 15941945.690865451, 15942911.749981342, 15943134.097462079, 15943425.240502872, 15943475.999760253, 15943622.64591996, 15943901.451838711, 15944236.865292246, 15944923.6058725, 15944976.5625, 15945014.871960258, 15945482.88742259, 15948026.667688554, 15948242.1875, 15948866.870647231, 15949297.74013802, 15951748.75881344, 15951975.193491241, 15952214.086428422, 15953655.688286988, 15953845.20061705, 15954771.115908582, 15954794.523761306, 15954869.752005333, 15955151.5625, 15955237.5, 15955248.697993528, 15956398.4375, 15961028.102829656, 15964019.791327477, 15964250.759706799, 15964272.587456673, 15969940.585474877, 15970578.664088141, 15970580.19753573, 15971117.979963452, 15973030.496825922, 15974375.577745214, 15974431.37878686, 15974753.097022904, 15975576.5625, 15976895.3125, 15977637.837760314, 15978159.382373286, 15978706.633209335, 15978708.516790317, 15980470.989919841, 15981098.4375, 15982320.993058478, 15984657.552367434, 15988062.64670236, 15989460.836099716, 15989466.058534805, 15989474.282079747, 15989557.401056996, 15992303.066133155, 15992321.65747341, 15994271.875, 15994807.505294966, 15996093.455669519, 15999443.75, 16005097.780904002, 16006250.061389744, 16007792.05567506, 16009312.102219375, 16011577.030510934, 16017014.049985029, 16030895.3125, 146613115.23697713], [44.00466664089657, 50.253376388026616, 8.679639692444283, 35.29781078528086, 14.145906753351786, 28.61460893459307, 54.474650698417115, 46.23743704872715, 52.82248266856681, 29.22741154240919, 11.150084870314812, 34.433729367771875, 17.9659776651498, 64.30609345589377, 12.034909760215593, 72.52767900118937, 43.42729854985976, 6.425242233706373, 5.427533494266044, 40.111029523828265, 82.36677242257082, 106.50205122314524, 32.00179122825693, 6.924834307900447, 16.833753929196458, 5.132781869345306, 78.48494800317066, 22.771426898092045, 43.36996113105175, 22.7104329507187, 78.75129948490877, 38.76507506024323, 24.634951713311757, 99.22450340741833, 45.303097913244954, 21.649552016005295, 11.415441226523388, 62.501027872234985, 15.348208824250761, 14.86123674560449, 39.811984132932345, 8.735333044147184, 21.972124476081074, 75.82893372300559, 84.58875642838333, 70.79162477018268, 51.20441449442475, 135.66397214517286, 136.81795675653913, 31.064494544055577, 84.2382175583116, 28.757968025353932, 43.09851633477869, 64.42781267430846, 20.974022026956927, 8.330963783337026, 58.51174381165867, 37.029259504207474, 10.56593808852168, 13.925166220851256, 24.945506544345918, 58.486743240269604, 18.333862546129016, 18.15260577324523, 12.8872338942968, 37.97881073411865, 7.981018704272332, 24.587240761803173, 278.7891002188353, 38.789885252968446, 12.223801987995607, 102.19502506655597, 195.33288713256215, 12.556527438760357, 50.7605501252434, 13.469242671791218, 15.60233747016462, 23.64836784606985, 49.16298874390166, 102.8253753653481, 29.067074966407347, 11.41109107952489, 11.396063234890805, 11.251023142392873, 52.26602469824332, 49.33758540161766, 67.99442410930305, 19.69991455370709, 8.936198633688505, 18.092176758846758, 17.20751355111505, 8.260246996503287, 20.562607995868845, 17.29073223790282, 53.350353797037684, 27.80406324705209, 45.446870013427386, 12.973958998521828, 78.58065307486763, 74.75685645346577, 5.2795482728034075, 51.86758271604424, 36.603535937311776, 17.82302689543313, 11.647149499211103, 73.77294000817953, 25.288028793210504, 55.39222076563386, 7.191093630604197, 12.79921339675803, 13.906300524365275, 5.953988895585133, 5.239817903946845, 73.84612510218324, 167.2090816575525, 47.178557613412565, 43.755391829019274, 73.88468484203239, 44.775933833750095, 83.32035225734296, 7.273970456412515, 58.484611132413235, 17.490403866006766, 234.84671690214157, 24.84423242903533, 82.72570060180718, 6.7057537927619935, 51.72829952774249, 39.89068217908445, 18.482478553043556, 6.309852019662575, 42.85547663316697, 14.607055473276262, 8.772422721924253, 5.467420898228986, 32.75136136302909, 9.765494768148299, 84.7761756967878, 57.81019587384227, 49.57447136004485, 8.80347596302395, 21.117538391728715, 73.34651903666224, 15.193805267288896, 64.30419305525629, 13.364218031998746, 30.568653900743573, 22.974348129065866, 8.231255548206855, 71.84800496827995, 10.884690995672583, 30.348036945430593, 13.30231071018863, 169.8999182029905, 42.686925787792944, 15.862483705233359, 19.829257330579704, 59.984042784591786, 77.05561021365799, 56.58131329573391, 45.03936043188413, 66.85237828412406, 49.290727841777546, 29.529505227008087, 66.26680029369795, 24.021396539450624, 21.282433543632322, 24.899013866486417, 85.32216414333382, 103.5792393452837, 18.02038857690019, 84.05082300731395, 27.02236380137591, 68.23002735885737, 10.501167311775234, 12.339701083644483, 6.014092010995906, 50.68365717306231, 69.85675426584037, 11.196616046915043, 56.21452206294536, 33.87607470585054, 5.241921381447826, 229.70219957782598, 10.386150954005807, 23.071611245723403, 56.373913298748, 13.393109132660278, 56.85577313992679, 97.29741367590528, 8.194803985459707, 24.512395346082954, 60.25545481285178, 9.003920436980257, 29.88670160668009, 14.619859204151176, 5.607277577320924, 6.276442710512052, 119.21606488479864, 28.145590494063434, 77.76112421987662, 14.350875825411283, 191.44601350466144, 45.03219302044385, 17.65306230015979, 58.24542851849673, 15.554824197661535, 13.00537746061748, 9.021690800525256, 23.703394305126835, 23.76673718893126, 71.451052513897, 37.33881147483891, 169.93492775916232, 29.63659282961991, 6.713617757674249, 13.52033897819242, 12.58278422107216, 48.39570837396122, 40.54639549770045, 16.035612310099136, 24.50435860142383, 9.787910243495018, 28.89177634225713, 16.220414074879397, 116.74107367262819, 25.361962410832838, 13.415469476328479, 37.949957451175635, 9.640348787524074, 63.87092665725222, 14.403448596418864, 81.22012390539463, 23.760512493280764, 42.78688543423992, 6.846453791505382, 22.44843522052236, 72.14826011554729, 10.961317770541534, 17.61714552721617, 101.38266744154339, 62.71964389904297, 51.48438516910589, 57.74063888157765, 92.53538294541791, 86.33916809511022, 52.59224074239854, 60.91939109363362, 12.405200123062214, 13.78288926979333, 50.15480132486677, 24.043690767744444, 30.532901197489885, 49.7453700323089, 41.34223030847243, 102.06662297662022, 16.121118968572574, 6.849564533410527, 35.702269845155115, 7.250359494450179, 12.112048221713678, 51.33299844671894, 48.671562726816205, 49.365859879418736, 67.6183720402811, 9.771315626924109, 74.8194901222403, 8.146059915401972, 52.340839547126436, 58.37709543632463, 16.846439396395237, 35.4208465280636, 42.282929194658266, 21.23946214618678, 25.98516335688908, 11.586427715196365, 63.81516673184322, 48.38486024764981, 71.89681353386648, 75.76386838090909, 23.089668735407777, 43.23476618629269, 173.88453833040788, 18.94536263082835, 5.280606367319426, 186.24164637759873, 16.591518957449004, 28.05905201040685, 9.943579537162107, 76.01130323527443, 5.808330545732891, 78.91564587546569, 8.161911594971865, 9.55427977641886, 27.434452614588764, 12.90177582132292, 139.0321873974375, 11.047726147713368, 26.87479539498316, 30.158435751457603, 5.878179628410904, 13.05237877922327, 38.204821190861374, 57.90268751734623, 5.526240416271941, 6.054764260736961, 30.890618169465228, 31.278596086203336, 29.445607419196588, 45.558702407891744, 59.591755809103006, 54.670864206943826, 9.609430210157303, 11.622054239037688, 14.392356381194649, 25.900444742594956, 5.090916776779495, 22.233298959214032, 64.75674155102352, 5.857786659767736, 121.2003023206619, 68.72945994799161, 35.817904558920915, 26.786122035931932, 24.689696109490768, 5.358768198394923, 69.24422062987963, 65.58815478905126, 8.55029145744922, 22.849110014681262, 5.327502184130052, 15.235967867384975, 57.66915220810209, 19.31557696601144, 10.719943862386195, 15.94492695572195, 5.377388126386723, 6.369772912739069, 52.45290379356414, 38.58437738558531, 13.867645793934152, 83.17304405992876, 19.292639690961494, 55.557755909237656, 13.971953846067773, 28.955158794078805, 6.2279794419200405, 6.949457195145357, 21.477577313656887, 9.500551240102116, 75.94044411996163, 26.33843391422959, 53.0112843070318, 19.24690358316715, 12.599196929008588, 11.685410278202507, 76.8363555949044, 40.12452669351477, 121.11725084442953, 74.30347947817697, 28.093468553941193, 118.8221724096274, 25.590801938176075, 6.361613718760577, 38.44663179097417, 5.360739967075305, 8.576058197223745, 53.04062986752708, 7.351794330688262, 70.230893426684, 5.168371837479809, 11.084256583139537, 53.714907907703726, 67.09362165560867, 92.06857704011688, 14.969687607419129, 68.74709812637269, 18.535719063401235, 18.35446005191506, 46.716132450929116, 20.646016943043207, 6.061459118527651, 6.51033666530046, 23.76369734904979, 11.880459727468082, 12.766371104210185, 89.48949062353616, 8.255690956767301, 65.77589269120108, 44.76708858453067, 7.4957816109032285, 9.094341547119528, 38.06963332681306, 46.99768800471213, 11.22503813678314, 9.222370837091196, 12.17645541222469, 71.74187320608485, 6.086798736060638, 47.66432212037243, 10.570925879814514])
caption, T_hit,count1 = hits_in_time_hist_new(T_pom, dt, t_plasma_start, t_plasma_end, is_plasma, figure_count_in_time_hist)
hist_file(count_in_time_hist, T_hit, count1, caption);
([8380331.25, 8395560.050087672, 8395599.113519607, 8413685.332156368, 8469477.899334786, 8573482.8125, 8574587.5, 8586434.375, 8593820.3125, 8616407.8125, 8636062.514269773, 8676559.616374252, 8682597.492422476, 8688431.798158076, 8752336.449505294, 8760895.772253396, 8771205.037165966, 8778641.781268893, 8780961.677396834, 8781171.875, 8781184.375, 8781185.350899678, 8782433.817219468, 8795382.007719627, 8815208.233783968, 8815281.356361995, 8820546.875, 8825135.556760259, 8840122.943189211, 8840726.17644689, 8852832.8125, 8852835.71474651, 8863806.016206292, 8874783.398631912, 8881631.25, 8885672.89278627, 8886023.614101319, 8904004.6875, 8915728.227761522, 8926711.286877338, 8931748.4375, 8947577.324533904, 8958143.29671559, 8963067.1875, 8971262.5, 9018897.702680828, 9032049.0897948, 9042578.322873177, 9046269.833657775, 9064519.733593045, 9064650.0, 9067714.725653425, 9070296.875, 9087215.413590765, 9087376.008841421, 9103548.520502768, 9104461.590896888, 9113435.916038278, 9118183.14143849, 9137784.193645308, 9138370.583174491, 9138601.5625, 9141800.83817383, 9147863.146666493, 9256093.081555046, 9307860.887813134, 9307918.123741427, 9327880.59491078, 9328839.318132462, 9343811.411298105, 9345789.232602473, 9360976.5625, 9361173.889707617, 9369742.94272419, 9369764.0625, 9369782.751127174, 9386254.850706257, 9386312.19194304, 9396045.3125, 9420342.457985824, 9420343.860857528, 9473414.236538298, 9476247.040159889, 9483540.702486962, 9485105.544341223, 9522945.3125, 9522951.5625, 9556987.153210023, 9559408.867453163, 9563474.024432903, 9569631.739846876, 9570446.824874856, 9595313.658684969, 9606013.004574098, 9610996.587982725, 9611144.916375902, 9615406.6825912, 9620534.936218375, 9635239.0625, 9660657.8125, 9673108.996870456, 9689057.8125, 9689064.0625, 9689762.794663794, 9689770.621211167, 9690948.4375, 9693741.999018285, 9701508.104636258, 9703456.508466678, 9719746.170663599, 9744779.38652106, 9744868.915949652, 9746270.121031754, 9766224.926173681, 9766279.175492348, 9786910.9375, 9816943.75, 9824307.8125, 9827518.75, 9828187.060693908, 9830158.362582933, 9830671.714220468, 9840150.539150072, 9841232.790237462, 9841310.718540898, 9849805.35098437, 9857138.766167508, 9921668.75, 9928062.5, 9944286.633969182, 9956490.955305835, 9964969.48678167, 9969453.034394667, 9986599.255618092, 9992645.44357981, 10001445.47586707, 10083687.972331883, 10084019.61351077, 10127925.0, 10150971.875, 10163358.676858148, 10166863.176715828, 10172147.08534053, 10202536.002154639, 10227347.808074016, 10227671.388878739, 10251998.87972701, 10264566.824187037, 10287243.64389981, 10296700.0, 10300623.276256204, 10308350.606008422, 10327710.428810623, 10329917.1875, 10335060.9375, 10349469.241365355, 10358749.804183543, 10366247.42803561, 10369211.235285422, 10371115.225080809, 10403179.6875, 10405100.416646453, 10413827.561329193, 10484717.1875, 10488302.90687093, 10488327.834116042, 10525814.303833934, 10527674.594659885, 10692070.3125, 10713636.580444977, 10714586.422275009, 10723078.125, 10750154.606687015, 10774423.4375, 10813771.433421278, 10926417.845473066, 10993553.94443892, 11013045.011695787, 11015957.8125, 11015990.668643162, 11027215.625, 11030682.8125, 11030693.634400634, 11032831.603672102, 11044901.029922618, 11050197.920411926, 11086990.625, 11088087.024305306, 11090968.75, 11101416.170910718, 11105037.322327498, 11111688.20877576, 11151393.75, 11190351.148027968, 11204606.25, 11213280.96116831, 11218848.31453733, 11218865.697820103, 11224710.970670218, 11242244.486741222, 11243100.442028962, 11247900.836369803, 11265267.1875, 11278873.4375, 11279972.44155031, 11280275.0, 11288017.339613318, 11304930.62858387, 11305698.047005376, 11314703.61014108, 11319453.85161488, 11323420.3125, 11323435.812344866, 11368283.756312069, 11369171.875, 11370674.744864717, 11371408.13710705, 11373830.454153756, 11374725.0, 11376267.17378618, 11382852.669409066, 11433026.319293363, 11433569.244679587, 11451190.625, 11451470.095823174, 11451975.0, 11454107.6289706, 11461097.505728504, 11461935.9375, 11462537.844093114, 11468054.034612898, 11468463.91378842, 11468965.625, 11470160.638264539, 11470378.125, 11470642.589249508, 11470885.52821646, 11475300.0, 11479099.890875898, 11481092.748057775, 11508921.141116988, 11519068.91372498, 11519512.053793004, 11521044.232853025, 11525012.925564293, 11561720.3125, 11572796.875, 11581500.0, 11590839.750401711, 11592367.175737336, 11592577.630783547, 11592791.910093011, 11621251.861350225, 11629680.257614864, 11631456.25, 11637591.493111053, 11638364.341006128, 11665998.853800263, 11669407.53940684, 11674323.906193437, 11676102.388441144, 11677321.875, 11678035.9375, 11678625.0, 11690987.5, 11700464.540652862, 11700515.232785745, 11703470.03697864, 11724862.5, 11727526.09283982, 11731637.567592416, 11731738.621614046, 11733021.385630136, 11759202.40646637, 11784807.04548231, 11787548.712406786, 11930632.0745438, 11932222.25855049, 11952286.816443358, 12016429.633845055, 12050473.08392265, 12090543.475914735, 12165506.84932908, 12585924.200061047, 12602335.594428815, 12602430.081073085, 12632769.329902602, 12648418.894417904, 12666369.39494912, 12695235.9375, 12784835.860850526, 12787794.58088709, 12814187.256572904, 12817554.939826958, 12823151.73830205, 12862949.337413695, 12869419.83837722, 12898957.760721065, 12904979.727822984, 13021878.125, 13021899.269030595, 13424291.584438957, 15497018.75, 15596375.0, 15755921.733252643, 15808604.360725978, 15835010.9375, 15856725.0, 15858360.9375, 15863847.910280814, 15868238.121898754, 15896971.617192341, 15905289.37397273, 15906481.54480872, 15917393.598055288, 15918261.308446163, 15918319.925604945, 15919929.717876649, 15919951.092868183, 15919961.512499735, 15923132.8125, 15923329.6875, 15928562.5, 15929010.84299964, 15930243.520116245, 15937858.29603355, 15939275.0, 15940293.75, 15940472.342478478, 15941154.313476779, 15941885.510571364, 15941900.075167548, 15941945.690865451, 15942911.749981342, 15943134.097462079, 15943425.240502872, 15943475.999760253, 15943622.64591996, 15943901.451838711, 15944236.865292246, 15944923.6058725, 15944976.5625, 15945014.871960258, 15945482.88742259, 15948026.667688554, 15948242.1875, 15948866.870647231, 15949297.74013802, 15951748.75881344, 15951975.193491241, 15952214.086428422, 15953655.688286988, 15953845.20061705, 15954771.115908582, 15954794.523761306, 15954869.752005333, 15955151.5625, 15955237.5, 15955248.697993528, 15956398.4375, 15961028.102829656, 15964019.791327477, 15964250.759706799, 15964272.587456673, 15969940.585474877, 15970578.664088141, 15970580.19753573, 15971117.979963452, 15973030.496825922, 15974375.577745214, 15974431.37878686, 15974753.097022904, 15975576.5625, 15976895.3125, 15977637.837760314, 15978159.382373286, 15978706.633209335, 15978708.516790317, 15980470.989919841, 15981098.4375, 15982320.993058478, 15984657.552367434, 15988062.64670236, 15989460.836099716, 15989466.058534805, 15989474.282079747, 15989557.401056996, 15992303.066133155, 15992321.65747341, 15994271.875, 15994807.505294966, 15996093.455669519, 15999443.75, 16005097.780904002, 16006250.061389744, 16007792.05567506, 16009312.102219375, 16011577.030510934, 16017014.049985029, 16030895.3125, 146613115.23697713], [44.00466664089657, 50.253376388026616, 8.679639692444283, 35.29781078528086, 14.145906753351786, 28.61460893459307, 54.474650698417115, 46.23743704872715, 52.82248266856681, 29.22741154240919, 11.150084870314812, 34.433729367771875, 17.9659776651498, 64.30609345589377, 12.034909760215593, 72.52767900118937, 43.42729854985976, 6.425242233706373, 5.427533494266044, 40.111029523828265, 82.36677242257082, 106.50205122314524, 32.00179122825693, 6.924834307900447, 16.833753929196458, 5.132781869345306, 78.48494800317066, 22.771426898092045, 43.36996113105175, 22.7104329507187, 78.75129948490877, 38.76507506024323, 24.634951713311757, 99.22450340741833, 45.303097913244954, 21.649552016005295, 11.415441226523388, 62.501027872234985, 15.348208824250761, 14.86123674560449, 39.811984132932345, 8.735333044147184, 21.972124476081074, 75.82893372300559, 84.58875642838333, 70.79162477018268, 51.20441449442475, 135.66397214517286, 136.81795675653913, 31.064494544055577, 84.2382175583116, 28.757968025353932, 43.09851633477869, 64.42781267430846, 20.974022026956927, 8.330963783337026, 58.51174381165867, 37.029259504207474, 10.56593808852168, 13.925166220851256, 24.945506544345918, 58.486743240269604, 18.333862546129016, 18.15260577324523, 12.8872338942968, 37.97881073411865, 7.981018704272332, 24.587240761803173, 278.7891002188353, 38.789885252968446, 12.223801987995607, 102.19502506655597, 195.33288713256215, 12.556527438760357, 50.7605501252434, 13.469242671791218, 15.60233747016462, 23.64836784606985, 49.16298874390166, 102.8253753653481, 29.067074966407347, 11.41109107952489, 11.396063234890805, 11.251023142392873, 52.26602469824332, 49.33758540161766, 67.99442410930305, 19.69991455370709, 8.936198633688505, 18.092176758846758, 17.20751355111505, 8.260246996503287, 20.562607995868845, 17.29073223790282, 53.350353797037684, 27.80406324705209, 45.446870013427386, 12.973958998521828, 78.58065307486763, 74.75685645346577, 5.2795482728034075, 51.86758271604424, 36.603535937311776, 17.82302689543313, 11.647149499211103, 73.77294000817953, 25.288028793210504, 55.39222076563386, 7.191093630604197, 12.79921339675803, 13.906300524365275, 5.953988895585133, 5.239817903946845, 73.84612510218324, 167.2090816575525, 47.178557613412565, 43.755391829019274, 73.88468484203239, 44.775933833750095, 83.32035225734296, 7.273970456412515, 58.484611132413235, 17.490403866006766, 234.84671690214157, 24.84423242903533, 82.72570060180718, 6.7057537927619935, 51.72829952774249, 39.89068217908445, 18.482478553043556, 6.309852019662575, 42.85547663316697, 14.607055473276262, 8.772422721924253, 5.467420898228986, 32.75136136302909, 9.765494768148299, 84.7761756967878, 57.81019587384227, 49.57447136004485, 8.80347596302395, 21.117538391728715, 73.34651903666224, 15.193805267288896, 64.30419305525629, 13.364218031998746, 30.568653900743573, 22.974348129065866, 8.231255548206855, 71.84800496827995, 10.884690995672583, 30.348036945430593, 13.30231071018863, 169.8999182029905, 42.686925787792944, 15.862483705233359, 19.829257330579704, 59.984042784591786, 77.05561021365799, 56.58131329573391, 45.03936043188413, 66.85237828412406, 49.290727841777546, 29.529505227008087, 66.26680029369795, 24.021396539450624, 21.282433543632322, 24.899013866486417, 85.32216414333382, 103.5792393452837, 18.02038857690019, 84.05082300731395, 27.02236380137591, 68.23002735885737, 10.501167311775234, 12.339701083644483, 6.014092010995906, 50.68365717306231, 69.85675426584037, 11.196616046915043, 56.21452206294536, 33.87607470585054, 5.241921381447826, 229.70219957782598, 10.386150954005807, 23.071611245723403, 56.373913298748, 13.393109132660278, 56.85577313992679, 97.29741367590528, 8.194803985459707, 24.512395346082954, 60.25545481285178, 9.003920436980257, 29.88670160668009, 14.619859204151176, 5.607277577320924, 6.276442710512052, 119.21606488479864, 28.145590494063434, 77.76112421987662, 14.350875825411283, 191.44601350466144, 45.03219302044385, 17.65306230015979, 58.24542851849673, 15.554824197661535, 13.00537746061748, 9.021690800525256, 23.703394305126835, 23.76673718893126, 71.451052513897, 37.33881147483891, 169.93492775916232, 29.63659282961991, 6.713617757674249, 13.52033897819242, 12.58278422107216, 48.39570837396122, 40.54639549770045, 16.035612310099136, 24.50435860142383, 9.787910243495018, 28.89177634225713, 16.220414074879397, 116.74107367262819, 25.361962410832838, 13.415469476328479, 37.949957451175635, 9.640348787524074, 63.87092665725222, 14.403448596418864, 81.22012390539463, 23.760512493280764, 42.78688543423992, 6.846453791505382, 22.44843522052236, 72.14826011554729, 10.961317770541534, 17.61714552721617, 101.38266744154339, 62.71964389904297, 51.48438516910589, 57.74063888157765, 92.53538294541791, 86.33916809511022, 52.59224074239854, 60.91939109363362, 12.405200123062214, 13.78288926979333, 50.15480132486677, 24.043690767744444, 30.532901197489885, 49.7453700323089, 41.34223030847243, 102.06662297662022, 16.121118968572574, 6.849564533410527, 35.702269845155115, 7.250359494450179, 12.112048221713678, 51.33299844671894, 48.671562726816205, 49.365859879418736, 67.6183720402811, 9.771315626924109, 74.8194901222403, 8.146059915401972, 52.340839547126436, 58.37709543632463, 16.846439396395237, 35.4208465280636, 42.282929194658266, 21.23946214618678, 25.98516335688908, 11.586427715196365, 63.81516673184322, 48.38486024764981, 71.89681353386648, 75.76386838090909, 23.089668735407777, 43.23476618629269, 173.88453833040788, 18.94536263082835, 5.280606367319426, 186.24164637759873, 16.591518957449004, 28.05905201040685, 9.943579537162107, 76.01130323527443, 5.808330545732891, 78.91564587546569, 8.161911594971865, 9.55427977641886, 27.434452614588764, 12.90177582132292, 139.0321873974375, 11.047726147713368, 26.87479539498316, 30.158435751457603, 5.878179628410904, 13.05237877922327, 38.204821190861374, 57.90268751734623, 5.526240416271941, 6.054764260736961, 30.890618169465228, 31.278596086203336, 29.445607419196588, 45.558702407891744, 59.591755809103006, 54.670864206943826, 9.609430210157303, 11.622054239037688, 14.392356381194649, 25.900444742594956, 5.090916776779495, 22.233298959214032, 64.75674155102352, 5.857786659767736, 121.2003023206619, 68.72945994799161, 35.817904558920915, 26.786122035931932, 24.689696109490768, 5.358768198394923, 69.24422062987963, 65.58815478905126, 8.55029145744922, 22.849110014681262, 5.327502184130052, 15.235967867384975, 57.66915220810209, 19.31557696601144, 10.719943862386195, 15.94492695572195, 5.377388126386723, 6.369772912739069, 52.45290379356414, 38.58437738558531, 13.867645793934152, 83.17304405992876, 19.292639690961494, 55.557755909237656, 13.971953846067773, 28.955158794078805, 6.2279794419200405, 6.949457195145357, 21.477577313656887, 9.500551240102116, 75.94044411996163, 26.33843391422959, 53.0112843070318, 19.24690358316715, 12.599196929008588, 11.685410278202507, 76.8363555949044, 40.12452669351477, 121.11725084442953, 74.30347947817697, 28.093468553941193, 118.8221724096274, 25.590801938176075, 6.361613718760577, 38.44663179097417, 5.360739967075305, 8.576058197223745, 53.04062986752708, 7.351794330688262, 70.230893426684, 5.168371837479809, 11.084256583139537, 53.714907907703726, 67.09362165560867, 92.06857704011688, 14.969687607419129, 68.74709812637269, 18.535719063401235, 18.35446005191506, 46.716132450929116, 20.646016943043207, 6.061459118527651, 6.51033666530046, 23.76369734904979, 11.880459727468082, 12.766371104210185, 89.48949062353616, 8.255690956767301, 65.77589269120108, 44.76708858453067, 7.4957816109032285, 9.094341547119528, 38.06963332681306, 46.99768800471213, 11.22503813678314, 9.222370837091196, 12.17645541222469, 71.74187320608485, 6.086798736060638, 47.66432212037243, 10.570925879814514])
Detected energies during the discharge + Energy spectrum
multiplot(icon_fig, T_int_first,E,xmean,count)
size_of_interactions_average(Etot, Ntot,size_interaction)
#energy_spectra_doublebreakdown(Etot, T_first, file_energy_spectra_doublebreakdown)