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 = 44850
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);
([5762867.1875, 5771543.75, 5771857.518944695, 5968094.111091736, 5984423.4375, 5993654.011682652, 6024833.492569973, 6026268.969067068, 6029150.972991183, 6033998.369837508, 6034095.935267932, 6053313.62033091, 6070053.125, 6070099.385228222, 6148734.0489571765, 6150737.249485087, 6158706.25, 6175998.4375, 6203874.281121433, 6206259.209364204, 6206840.625, 6215035.9375, 6244733.910996761, 6262924.291262942, 6264300.626576529, 6265049.556022674, 6266373.4375, 6273751.48969333, 6275525.0, 6279695.3125, 6281170.3125, 6295335.388447535, 6300610.940553419, 6330857.8979615485, 6330905.66732585, 6332432.798826728, 6333767.091306901, 6340618.006868892, 6352773.4375, 6353500.9540543035, 6384675.456167174, 6407991.44927245, 6421443.282177832, 6421944.486282859, 6425320.3125, 6433586.717001811, 6434279.6875, 6438009.37426859, 6466965.625, 6495899.3970326735, 6500695.343761748, 6501913.162490786, 6527417.308348983, 6534208.220618709, 6536742.060566667, 6564750.0, 6568735.840891089, 6606920.7949377205, 6608414.54723425, 6609731.703490218, 6611096.875, 6623600.284467385, 6623614.848689083, 6651568.676072781, 6678390.60512634, 6684883.519425331, 6685237.568601772, 6712846.263508329, 6714105.782368884, 6717356.731213864, 6717559.375, 6717992.2344504045, 6719135.529423565, 6724261.5539595075, 6724443.30820776, 6754194.229175228, 6758622.283459757, 6786181.587492619, 6806026.5625, 6839055.374057642, 6867221.875, 6878721.545604124, 6890923.4375, 6892405.908760407, 6901429.6875, 6918922.554859861, 6925671.386937638, 6926097.778967945, 6939832.182529842, 6961503.125, 6965163.464655266, 6967885.439433658, 6968728.125, 6968837.47318516, 6969620.3125, 6969642.263128097, 6972290.529459227, 6996375.0, 7022493.1133600995, 7023028.125, 7023182.8125, 7027599.980525499, 7043819.003974354, 7044339.0625, 7046656.817974884, 7046880.8488592245, 7047070.11541496, 7047534.279861267, 7047565.471527242, 7048130.5351419225, 7048139.0625, 7049609.375, 7067048.138867046, 7107303.117685035, 7110609.375, 7200726.5625, 7200739.394698389, 7236960.252315429, 7248997.5951241115, 7262640.483921059, 7271208.951491552, 7324838.8314457005, 7396766.573281212, 7398293.214682898, 7398856.988965473, 7400293.635186077, 7431990.625, 7432624.363268056, 7437135.414299267, 7445540.625, 7471152.268448007, 7477453.983358649, 7477598.007430388, 7485967.1875, 7505669.823572805, 7506756.303893664, 7507064.832467157, 7512782.8125, 7546370.284597385, 7583632.061442829, 7608089.0625, 7617407.8125, 7620356.176801916, 7622282.809843249, 7622809.375, 7647773.4375, 7656937.5, 7656956.241741509, 7656960.383479636, 7659721.860440156, 7665213.65288027, 7682491.221459171, 7736619.190512087, 7736625.635756905, 7742343.302688506, 7746140.343593187, 7747118.75, 7757379.6875, 7789678.216189175, 7796284.167733138, 7799509.375, 7801142.927792865, 7805624.622353985, 7809163.986962744, 7820610.824274965, 7827006.455001192, 7827046.084515571, 7863041.540272705, 7865211.962906366, 7865736.776532261, 7866612.5, 7866959.008938833, 7869000.0, 7873114.0625, 7873593.308194413, 7874096.875, 7874756.531007664, 7876802.366937105, 7878105.9374527875, 7880844.178371609, 7884909.15386732, 7911506.514931304, 7928396.114414116, 7933662.986522752, 7933731.25, 7934250.998067157, 7936806.905341273, 7937007.8125, 7939183.146338605, 7939297.848396753, 7939569.611419536, 7940617.1875, 7940707.757523306, 7940723.503283187, 7940770.502537538, 7940832.8125, 7941349.180203991, 7941810.853780171, 7941929.686508307, 7942335.9375, 7942398.012101978, 7942512.159129828, 7943189.466124016, 7943208.458378089, 7943713.5608802, 7944439.858283676, 7945107.338446406, 7945415.3991380725, 7958019.2085841475, 7962486.40895796, 7962926.843628009, 7962988.753460263, 7969102.990723889, 7971698.918631968, 7973091.603947148, 7973284.375, 7973390.625, 7973396.253234824, 7974499.583027552, 7974507.990658345, 7977820.3125, 7982125.462569523, 7996962.5, 8004346.875, 8007533.888484931, 8012911.721041176, 8025104.897200552, 8037607.981786831, 8051296.407268947, 8055436.962825499, 8077982.061952556, 8078799.108317904, 8078918.75, 8080213.418298987, 8083244.930770345, 8091370.612199246, 8114755.003785151, 8114796.757877075, 8116470.3125, 8119231.25, 8121440.514154764, 8143671.5818222435, 8146476.094666708, 8167340.625, 8210817.1875, 8214796.674286238, 8218177.969385354, 8219940.697635652, 8238422.544322381, 8241573.987363132, 8265402.151751149, 8316674.339069678, 8463475.0, 8471504.993504858, 8476081.220616197, 8476099.787215091, 8499178.19835362, 8525271.875, 8527496.875, 8575969.89306547, 8698431.25, 8992250.118700221, 9045116.158814777, 9050690.625, 9480387.409962894, 9481027.717919888, 9481035.66227375, 9481038.65245725, 9481243.212905116, 9481777.674496477, 9481810.97049287, 9481873.99769166, 9481880.972654957, 9482359.22086066, 9482569.167063706, 9484524.98801597, 10054968.75, 10056972.443865092, 10111792.985131554, 10112064.053297674, 10112201.134674147, 10112265.53386166, 10112339.030883813, 10114048.037432054, 10114675.392142585, 10116449.803859226, 10117176.5625, 10117241.657592911, 10117494.790915726, 10118589.976073824, 10119337.652897846, 10119536.081815898, 10119835.130250314, 10119905.956503864, 10120090.692516504, 10120404.141417928, 10120410.690529795, 10121201.125110935, 10121223.859962832, 10121694.342121763, 10121858.0502648, 10121869.048131524, 10121948.4375, 10121987.5, 10122143.75, 10122173.02655571, 10122195.3125, 10122266.128940234, 10122318.820882117, 10122320.685985435, 10122337.330702223, 10122351.614277871, 10122397.461892942, 10122450.419419501, 10122509.375, 10122517.803658659, 10122593.777463077, 10122612.534187792, 10122673.77892823, 10122680.027310759, 10122766.947379515, 10122806.25, 10122850.29535998, 10122932.8125, 10122965.368752658, 10122973.778147697, 10123032.561727278, 10123098.424451055, 10123141.286129028, 10123211.811169818, 10123225.0, 10123252.478497772, 10123263.454005728, 10123321.077838114, 10123334.686319914, 10123468.75, 10123753.125, 10123823.4375, 10123954.275855148, 10123960.215396017, 10124054.51487494, 10124329.247376593, 10124400.943202069, 10124446.432055775, 10124462.303809723, 10124610.883272178, 10124666.73214798, 10124698.65706379, 10124725.107587026, 10124740.526273029, 10124759.714625543, 10124768.019952616, 10124792.661923219, 10125074.206248036, 10125320.56676462, 10125495.3125, 10126140.625, 10126159.375, 10126462.417100016, 10126486.787283042, 10126538.210398287, 10126897.483590683, 10127937.227421083, 10127995.416360809, 10128087.125361495, 10128353.431114137, 10128601.09827324, 10129225.186411897, 10129308.442103148, 10129612.240485962, 10129699.736278526, 10129940.432446865, 10130201.010573242, 10130699.256926, 10130842.59547921, 10130900.0, 10131027.486496096, 10131221.268560668, 10131480.147242889, 10131613.69358974, 10131904.53527518, 10132279.284105942, 10132357.912758125, 10133151.415044114, 10133467.512964675, 10133746.146245258, 10134789.0625, 10134800.274983957, 10135100.0, 10136981.677015021, 10137324.024096582, 10137476.5625, 10137945.813367594, 10139501.396332283, 10142840.00708938, 10143198.349180778, 10143793.687104937, 10144856.25, 10151667.009456087, 10154922.544287676, 10154944.138184592, 10156668.480971998], [43.38602804620143, 35.576507787228486, 65.80282480911495, 41.3535607899723, 96.04227468396071, 57.52587916170309, 8.682230603112504, 9.523770418462753, 38.072646567817316, 7.578947276549465, 6.894550125314807, 13.487271855565893, 31.867831504635596, 16.263863511823136, 98.92546842328474, 9.128196101777545, 33.364709034139246, 45.39075667446491, 173.48879360044612, 9.195168613451177, 53.07472558828404, 30.966805684912572, 7.44361559247646, 193.72597920181536, 98.41308175757308, 19.248234780149534, 47.24146980682538, 35.816358322717036, 53.58081094522712, 60.227558472248866, 29.59308133085109, 18.087959810364318, 13.346337830268837, 52.543735805255196, 34.79425007708921, 23.064561281900733, 35.69785745443531, 10.1357973711849, 33.22609798980777, 10.293488780406584, 17.0028037111745, 12.219629614667504, 21.82021130474225, 86.45341715581175, 44.64988418068424, 60.95264539675249, 45.46628063439183, 11.126563753701916, 39.03963535354618, 26.224603418455853, 17.917397968409013, 59.94880573620911, 6.282588464454149, 35.08396228436403, 35.57065634101442, 69.73804991100732, 6.078110030702215, 52.894658340327, 17.358935168429042, 102.71616940719585, 73.08562621693962, 21.697838860569465, 19.118282746838332, 47.29187253829572, 49.81874493709614, 18.553746652209103, 23.182224808613782, 13.030727595603805, 21.44161671596555, 22.51527007872808, 50.51972121766521, 21.02498184310182, 24.211051993362794, 62.358869041901784, 24.06176463735285, 61.25837406707107, 16.76624157242259, 35.20033856665516, 32.875221869189225, 26.15110811178004, 35.39650964674817, 23.382374614250825, 55.14154476255571, 119.423805779277, 47.33745619388164, 18.370728325471497, 10.441873877244468, 6.388588539229704, 25.397941229960455, 65.72129705974932, 8.872349349031865, 6.41175004918781, 50.15140822958821, 6.263816439897228, 68.15500718300589, 37.37397383708311, 30.4763795950091, 71.3838445240838, 42.68128678542248, 86.34407525071556, 68.60471193689399, 117.48165389910574, 24.856327369175062, 75.4386409453259, 6.149224628029161, 42.16646259857624, 52.01016201432133, 84.8269530822382, 14.387122471091141, 17.77360680012989, 89.87894912677226, 44.38226881143853, 27.294253114235367, 11.116292260002503, 75.25467235799687, 50.60063247708851, 8.470425423840386, 19.82535630203808, 73.62314723210129, 66.9369497343669, 40.629085790756875, 54.52752911658617, 8.860960698272041, 56.115398448358036, 6.920582905833345, 32.95210423704349, 72.16600058345108, 58.123563907548444, 13.262950665124942, 56.69324121117948, 35.28600399396331, 6.6306264731221685, 5.38228350731839, 75.04361616625297, 32.48116981205151, 9.37739287813508, 7.907673345034054, 42.01739217821939, 33.74391847685495, 41.86801217276933, 90.34528950740672, 58.626663132232174, 9.270267591808793, 40.85000765516894, 67.86946507635527, 71.53691721031186, 31.341900731797413, 14.91012507385122, 94.76548839817428, 14.886303004463084, 86.9664456460605, 149.44859049619797, 183.05471285106248, 18.082388822459347, 50.281717545787075, 43.99007650083875, 88.78156640247447, 41.90008855516701, 87.09109493775617, 15.245598664114793, 43.23334864503968, 10.047044292949066, 49.55166855301441, 69.49474072968044, 61.066823427534715, 15.785026938599403, 7.90855895790753, 10.24721048902045, 31.23789257975723, 167.22696440166612, 28.6591412492301, 10.599990381484798, 35.266009511840835, 44.816423406207825, 71.67454275282857, 41.176048234966025, 36.67899347069677, 8.763317634001455, 7.041646734798786, 31.808150583528324, 86.5487685867507, 23.625135763262314, 19.23565205636849, 17.18887770016271, 36.6301474064023, 27.773114173820357, 9.954674444708742, 89.33325786962851, 49.61983098302642, 6.028907724867361, 19.69718546829858, 51.01991177842259, 27.482118750021872, 50.643447173374085, 21.348611172205167, 47.86825412506822, 93.55809248597987, 14.63172969465865, 28.505586456852278, 51.032999937121076, 32.476355294129405, 67.01492101735542, 16.7409730730152, 77.53585046352146, 10.424794570825458, 20.3152774286481, 21.75589402452437, 7.523540179062741, 14.734436511363308, 5.8497075882549, 16.133472059337766, 46.83547266069343, 68.80153114801033, 69.79346844272294, 191.52818467319517, 53.9027907795991, 49.49993473431921, 8.855731186922696, 9.00207506365171, 23.32398761071109, 46.7255212045656, 9.755760549744647, 73.97360818078704, 110.18909588317808, 18.650470591931104, 91.26482171569674, 53.50562024406739, 30.68780272703772, 5.899682060425015, 18.40316611409991, 19.311557131057192, 6.1607516281549755, 56.95021166744607, 16.850166859626096, 53.75475146941815, 5.630842207526623, 16.301653767576298, 62.43124038999092, 41.421460810931606, 67.39989261599767, 110.16723285809158, 11.311066565845627, 21.34259682292935, 28.608530045819357, 71.8068485807847, 6.242168368519039, 25.788662705384546, 53.70548474110078, 30.59778140569336, 17.5535253758634, 41.10402017593515, 5.578497174731295, 106.73219339093161, 16.25198176084425, 6.4824949064226445, 49.780504338625704, 15.574035762864412, 62.542145936838295, 54.8529427761514, 22.33628145411568, 36.90701411144158, 70.18674453393186, 23.870646849921016, 38.79942369784406, 26.862614593677844, 22.47296478574406, 10.723137881173084, 64.71788971777939, 67.75392475699087, 7.448039014856053, 71.68303812378888, 36.18801928439754, 9.107408589935357, 8.206713834073264, 88.22384424782797, 14.8960278092231, 45.15052608118392, 42.44316398292928, 29.066941182557038, 5.93860453209275, 13.528158143369106, 18.284392012977886, 69.88192415326782, 82.11163261073261, 46.75994975872994, 25.174704240268895, 58.53973711246862, 5.585385965174616, 29.04824588947611, 38.55448230140668, 54.86698765707017, 51.67803049714223, 18.892676126848922, 13.929581646263825, 15.205250587183919, 19.67881182732335, 39.48081360750911, 22.14127399427046, 16.83999682278393, 12.199263280080828, 9.540877829288258, 16.21421761518542, 38.82689761161724, 49.49954769082495, 51.6151830152796, 10.540877515500929, 89.41820278257181, 6.142120699315385, 11.240337561109424, 16.325515217565442, 46.07873101645974, 8.314149446781126, 105.05407903569929, 42.92417254418977, 40.51329094991043, 19.94453009656791, 17.73662795305519, 30.414824536828878, 26.152253447843698, 59.55891639822969, 50.57885542965472, 29.856719980121472, 61.31826519870732, 63.87159061253053, 24.326186537720755, 63.231540771876375, 5.238180469898945, 12.176875107372013, 31.737289921426992, 27.85919509135034, 76.70630091390042, 12.941954071066881, 65.67497187868834, 5.428561006500038, 15.504826019054446, 29.104993739361838, 29.38762777130245, 45.427652811923, 15.908229904681718, 17.843297650686146, 14.321980501018837, 44.967323760939976, 20.380232801005615, 22.081791429413855, 25.17397574566733, 32.6483236097624, 26.02502069792765, 5.0452635037663125, 104.43975452698106, 9.249296160588132, 9.636092878903693, 16.17416388403603, 17.12149808886111, 5.757494574316923, 20.98250616233265, 50.232962176088186, 77.46706705951743, 44.089028346630286, 75.43641959114099, 10.170672499812685, 5.6545923390947035, 8.636956558828633, 44.67865777452679, 6.280410219720844, 13.68301510644945, 9.604385612175887, 21.857537621548722, 15.703045086477204, 5.423101264655044, 8.153949638040327, 10.739081593008102, 9.173728106043484, 7.415110756997822, 19.457657122993606, 6.5530055944879235, 30.08132492448663, 22.904719756927502, 36.95277381622014, 17.040689190243338, 10.596204551895072, 9.205921971271147, 80.88825967833097, 24.397475083996156, 8.210109666577967, 7.209717874404497, 10.152230272045752, 82.90251950964186, 9.575269414286637, 49.055413139435366, 9.720601692996144, 12.187703786473744, 43.27182401208216, 12.012603924903113, 35.78961208864936, 8.858400813975884, 13.991021707425402, 50.12334277764782, 45.159099609818846, 105.51247061220968, 5.7507197124789435, 7.227374471613009, 57.38602908255779])
caption, xmean,count, xle, Etot = energy_spectrum(E_tot)
hist_file(E_hist, xmean, count, caption);
([5762867.1875, 5771543.75, 5771857.518944695, 5968094.111091736, 5984423.4375, 5993654.011682652, 6024833.492569973, 6026268.969067068, 6029150.972991183, 6033998.369837508, 6034095.935267932, 6053313.62033091, 6070053.125, 6070099.385228222, 6148734.0489571765, 6150737.249485087, 6158706.25, 6175998.4375, 6203874.281121433, 6206259.209364204, 6206840.625, 6215035.9375, 6244733.910996761, 6262924.291262942, 6264300.626576529, 6265049.556022674, 6266373.4375, 6273751.48969333, 6275525.0, 6279695.3125, 6281170.3125, 6295335.388447535, 6300610.940553419, 6330857.8979615485, 6330905.66732585, 6332432.798826728, 6333767.091306901, 6340618.006868892, 6352773.4375, 6353500.9540543035, 6384675.456167174, 6407991.44927245, 6421443.282177832, 6421944.486282859, 6425320.3125, 6433586.717001811, 6434279.6875, 6438009.37426859, 6466965.625, 6495899.3970326735, 6500695.343761748, 6501913.162490786, 6527417.308348983, 6534208.220618709, 6536742.060566667, 6564750.0, 6568735.840891089, 6606920.7949377205, 6608414.54723425, 6609731.703490218, 6611096.875, 6623600.284467385, 6623614.848689083, 6651568.676072781, 6678390.60512634, 6684883.519425331, 6685237.568601772, 6712846.263508329, 6714105.782368884, 6717356.731213864, 6717559.375, 6717992.2344504045, 6719135.529423565, 6724261.5539595075, 6724443.30820776, 6754194.229175228, 6758622.283459757, 6786181.587492619, 6806026.5625, 6839055.374057642, 6867221.875, 6878721.545604124, 6890923.4375, 6892405.908760407, 6901429.6875, 6918922.554859861, 6925671.386937638, 6926097.778967945, 6939832.182529842, 6961503.125, 6965163.464655266, 6967885.439433658, 6968728.125, 6968837.47318516, 6969620.3125, 6969642.263128097, 6972290.529459227, 6996375.0, 7022493.1133600995, 7023028.125, 7023182.8125, 7027599.980525499, 7043819.003974354, 7044339.0625, 7046656.817974884, 7046880.8488592245, 7047070.11541496, 7047534.279861267, 7047565.471527242, 7048130.5351419225, 7048139.0625, 7049609.375, 7067048.138867046, 7107303.117685035, 7110609.375, 7200726.5625, 7200739.394698389, 7236960.252315429, 7248997.5951241115, 7262640.483921059, 7271208.951491552, 7324838.8314457005, 7396766.573281212, 7398293.214682898, 7398856.988965473, 7400293.635186077, 7431990.625, 7432624.363268056, 7437135.414299267, 7445540.625, 7471152.268448007, 7477453.983358649, 7477598.007430388, 7485967.1875, 7505669.823572805, 7506756.303893664, 7507064.832467157, 7512782.8125, 7546370.284597385, 7583632.061442829, 7608089.0625, 7617407.8125, 7620356.176801916, 7622282.809843249, 7622809.375, 7647773.4375, 7656937.5, 7656956.241741509, 7656960.383479636, 7659721.860440156, 7665213.65288027, 7682491.221459171, 7736619.190512087, 7736625.635756905, 7742343.302688506, 7746140.343593187, 7747118.75, 7757379.6875, 7789678.216189175, 7796284.167733138, 7799509.375, 7801142.927792865, 7805624.622353985, 7809163.986962744, 7820610.824274965, 7827006.455001192, 7827046.084515571, 7863041.540272705, 7865211.962906366, 7865736.776532261, 7866612.5, 7866959.008938833, 7869000.0, 7873114.0625, 7873593.308194413, 7874096.875, 7874756.531007664, 7876802.366937105, 7878105.9374527875, 7880844.178371609, 7884909.15386732, 7911506.514931304, 7928396.114414116, 7933662.986522752, 7933731.25, 7934250.998067157, 7936806.905341273, 7937007.8125, 7939183.146338605, 7939297.848396753, 7939569.611419536, 7940617.1875, 7940707.757523306, 7940723.503283187, 7940770.502537538, 7940832.8125, 7941349.180203991, 7941810.853780171, 7941929.686508307, 7942335.9375, 7942398.012101978, 7942512.159129828, 7943189.466124016, 7943208.458378089, 7943713.5608802, 7944439.858283676, 7945107.338446406, 7945415.3991380725, 7958019.2085841475, 7962486.40895796, 7962926.843628009, 7962988.753460263, 7969102.990723889, 7971698.918631968, 7973091.603947148, 7973284.375, 7973390.625, 7973396.253234824, 7974499.583027552, 7974507.990658345, 7977820.3125, 7982125.462569523, 7996962.5, 8004346.875, 8007533.888484931, 8012911.721041176, 8025104.897200552, 8037607.981786831, 8051296.407268947, 8055436.962825499, 8077982.061952556, 8078799.108317904, 8078918.75, 8080213.418298987, 8083244.930770345, 8091370.612199246, 8114755.003785151, 8114796.757877075, 8116470.3125, 8119231.25, 8121440.514154764, 8143671.5818222435, 8146476.094666708, 8167340.625, 8210817.1875, 8214796.674286238, 8218177.969385354, 8219940.697635652, 8238422.544322381, 8241573.987363132, 8265402.151751149, 8316674.339069678, 8463475.0, 8471504.993504858, 8476081.220616197, 8476099.787215091, 8499178.19835362, 8525271.875, 8527496.875, 8575969.89306547, 8698431.25, 8992250.118700221, 9045116.158814777, 9050690.625, 9480387.409962894, 9481027.717919888, 9481035.66227375, 9481038.65245725, 9481243.212905116, 9481777.674496477, 9481810.97049287, 9481873.99769166, 9481880.972654957, 9482359.22086066, 9482569.167063706, 9484524.98801597, 10054968.75, 10056972.443865092, 10111792.985131554, 10112064.053297674, 10112201.134674147, 10112265.53386166, 10112339.030883813, 10114048.037432054, 10114675.392142585, 10116449.803859226, 10117176.5625, 10117241.657592911, 10117494.790915726, 10118589.976073824, 10119337.652897846, 10119536.081815898, 10119835.130250314, 10119905.956503864, 10120090.692516504, 10120404.141417928, 10120410.690529795, 10121201.125110935, 10121223.859962832, 10121694.342121763, 10121858.0502648, 10121869.048131524, 10121948.4375, 10121987.5, 10122143.75, 10122173.02655571, 10122195.3125, 10122266.128940234, 10122318.820882117, 10122320.685985435, 10122337.330702223, 10122351.614277871, 10122397.461892942, 10122450.419419501, 10122509.375, 10122517.803658659, 10122593.777463077, 10122612.534187792, 10122673.77892823, 10122680.027310759, 10122766.947379515, 10122806.25, 10122850.29535998, 10122932.8125, 10122965.368752658, 10122973.778147697, 10123032.561727278, 10123098.424451055, 10123141.286129028, 10123211.811169818, 10123225.0, 10123252.478497772, 10123263.454005728, 10123321.077838114, 10123334.686319914, 10123468.75, 10123753.125, 10123823.4375, 10123954.275855148, 10123960.215396017, 10124054.51487494, 10124329.247376593, 10124400.943202069, 10124446.432055775, 10124462.303809723, 10124610.883272178, 10124666.73214798, 10124698.65706379, 10124725.107587026, 10124740.526273029, 10124759.714625543, 10124768.019952616, 10124792.661923219, 10125074.206248036, 10125320.56676462, 10125495.3125, 10126140.625, 10126159.375, 10126462.417100016, 10126486.787283042, 10126538.210398287, 10126897.483590683, 10127937.227421083, 10127995.416360809, 10128087.125361495, 10128353.431114137, 10128601.09827324, 10129225.186411897, 10129308.442103148, 10129612.240485962, 10129699.736278526, 10129940.432446865, 10130201.010573242, 10130699.256926, 10130842.59547921, 10130900.0, 10131027.486496096, 10131221.268560668, 10131480.147242889, 10131613.69358974, 10131904.53527518, 10132279.284105942, 10132357.912758125, 10133151.415044114, 10133467.512964675, 10133746.146245258, 10134789.0625, 10134800.274983957, 10135100.0, 10136981.677015021, 10137324.024096582, 10137476.5625, 10137945.813367594, 10139501.396332283, 10142840.00708938, 10143198.349180778, 10143793.687104937, 10144856.25, 10151667.009456087, 10154922.544287676, 10154944.138184592, 10156668.480971998], [43.38602804620143, 35.576507787228486, 65.80282480911495, 41.3535607899723, 96.04227468396071, 57.52587916170309, 8.682230603112504, 9.523770418462753, 38.072646567817316, 7.578947276549465, 6.894550125314807, 13.487271855565893, 31.867831504635596, 16.263863511823136, 98.92546842328474, 9.128196101777545, 33.364709034139246, 45.39075667446491, 173.48879360044612, 9.195168613451177, 53.07472558828404, 30.966805684912572, 7.44361559247646, 193.72597920181536, 98.41308175757308, 19.248234780149534, 47.24146980682538, 35.816358322717036, 53.58081094522712, 60.227558472248866, 29.59308133085109, 18.087959810364318, 13.346337830268837, 52.543735805255196, 34.79425007708921, 23.064561281900733, 35.69785745443531, 10.1357973711849, 33.22609798980777, 10.293488780406584, 17.0028037111745, 12.219629614667504, 21.82021130474225, 86.45341715581175, 44.64988418068424, 60.95264539675249, 45.46628063439183, 11.126563753701916, 39.03963535354618, 26.224603418455853, 17.917397968409013, 59.94880573620911, 6.282588464454149, 35.08396228436403, 35.57065634101442, 69.73804991100732, 6.078110030702215, 52.894658340327, 17.358935168429042, 102.71616940719585, 73.08562621693962, 21.697838860569465, 19.118282746838332, 47.29187253829572, 49.81874493709614, 18.553746652209103, 23.182224808613782, 13.030727595603805, 21.44161671596555, 22.51527007872808, 50.51972121766521, 21.02498184310182, 24.211051993362794, 62.358869041901784, 24.06176463735285, 61.25837406707107, 16.76624157242259, 35.20033856665516, 32.875221869189225, 26.15110811178004, 35.39650964674817, 23.382374614250825, 55.14154476255571, 119.423805779277, 47.33745619388164, 18.370728325471497, 10.441873877244468, 6.388588539229704, 25.397941229960455, 65.72129705974932, 8.872349349031865, 6.41175004918781, 50.15140822958821, 6.263816439897228, 68.15500718300589, 37.37397383708311, 30.4763795950091, 71.3838445240838, 42.68128678542248, 86.34407525071556, 68.60471193689399, 117.48165389910574, 24.856327369175062, 75.4386409453259, 6.149224628029161, 42.16646259857624, 52.01016201432133, 84.8269530822382, 14.387122471091141, 17.77360680012989, 89.87894912677226, 44.38226881143853, 27.294253114235367, 11.116292260002503, 75.25467235799687, 50.60063247708851, 8.470425423840386, 19.82535630203808, 73.62314723210129, 66.9369497343669, 40.629085790756875, 54.52752911658617, 8.860960698272041, 56.115398448358036, 6.920582905833345, 32.95210423704349, 72.16600058345108, 58.123563907548444, 13.262950665124942, 56.69324121117948, 35.28600399396331, 6.6306264731221685, 5.38228350731839, 75.04361616625297, 32.48116981205151, 9.37739287813508, 7.907673345034054, 42.01739217821939, 33.74391847685495, 41.86801217276933, 90.34528950740672, 58.626663132232174, 9.270267591808793, 40.85000765516894, 67.86946507635527, 71.53691721031186, 31.341900731797413, 14.91012507385122, 94.76548839817428, 14.886303004463084, 86.9664456460605, 149.44859049619797, 183.05471285106248, 18.082388822459347, 50.281717545787075, 43.99007650083875, 88.78156640247447, 41.90008855516701, 87.09109493775617, 15.245598664114793, 43.23334864503968, 10.047044292949066, 49.55166855301441, 69.49474072968044, 61.066823427534715, 15.785026938599403, 7.90855895790753, 10.24721048902045, 31.23789257975723, 167.22696440166612, 28.6591412492301, 10.599990381484798, 35.266009511840835, 44.816423406207825, 71.67454275282857, 41.176048234966025, 36.67899347069677, 8.763317634001455, 7.041646734798786, 31.808150583528324, 86.5487685867507, 23.625135763262314, 19.23565205636849, 17.18887770016271, 36.6301474064023, 27.773114173820357, 9.954674444708742, 89.33325786962851, 49.61983098302642, 6.028907724867361, 19.69718546829858, 51.01991177842259, 27.482118750021872, 50.643447173374085, 21.348611172205167, 47.86825412506822, 93.55809248597987, 14.63172969465865, 28.505586456852278, 51.032999937121076, 32.476355294129405, 67.01492101735542, 16.7409730730152, 77.53585046352146, 10.424794570825458, 20.3152774286481, 21.75589402452437, 7.523540179062741, 14.734436511363308, 5.8497075882549, 16.133472059337766, 46.83547266069343, 68.80153114801033, 69.79346844272294, 191.52818467319517, 53.9027907795991, 49.49993473431921, 8.855731186922696, 9.00207506365171, 23.32398761071109, 46.7255212045656, 9.755760549744647, 73.97360818078704, 110.18909588317808, 18.650470591931104, 91.26482171569674, 53.50562024406739, 30.68780272703772, 5.899682060425015, 18.40316611409991, 19.311557131057192, 6.1607516281549755, 56.95021166744607, 16.850166859626096, 53.75475146941815, 5.630842207526623, 16.301653767576298, 62.43124038999092, 41.421460810931606, 67.39989261599767, 110.16723285809158, 11.311066565845627, 21.34259682292935, 28.608530045819357, 71.8068485807847, 6.242168368519039, 25.788662705384546, 53.70548474110078, 30.59778140569336, 17.5535253758634, 41.10402017593515, 5.578497174731295, 106.73219339093161, 16.25198176084425, 6.4824949064226445, 49.780504338625704, 15.574035762864412, 62.542145936838295, 54.8529427761514, 22.33628145411568, 36.90701411144158, 70.18674453393186, 23.870646849921016, 38.79942369784406, 26.862614593677844, 22.47296478574406, 10.723137881173084, 64.71788971777939, 67.75392475699087, 7.448039014856053, 71.68303812378888, 36.18801928439754, 9.107408589935357, 8.206713834073264, 88.22384424782797, 14.8960278092231, 45.15052608118392, 42.44316398292928, 29.066941182557038, 5.93860453209275, 13.528158143369106, 18.284392012977886, 69.88192415326782, 82.11163261073261, 46.75994975872994, 25.174704240268895, 58.53973711246862, 5.585385965174616, 29.04824588947611, 38.55448230140668, 54.86698765707017, 51.67803049714223, 18.892676126848922, 13.929581646263825, 15.205250587183919, 19.67881182732335, 39.48081360750911, 22.14127399427046, 16.83999682278393, 12.199263280080828, 9.540877829288258, 16.21421761518542, 38.82689761161724, 49.49954769082495, 51.6151830152796, 10.540877515500929, 89.41820278257181, 6.142120699315385, 11.240337561109424, 16.325515217565442, 46.07873101645974, 8.314149446781126, 105.05407903569929, 42.92417254418977, 40.51329094991043, 19.94453009656791, 17.73662795305519, 30.414824536828878, 26.152253447843698, 59.55891639822969, 50.57885542965472, 29.856719980121472, 61.31826519870732, 63.87159061253053, 24.326186537720755, 63.231540771876375, 5.238180469898945, 12.176875107372013, 31.737289921426992, 27.85919509135034, 76.70630091390042, 12.941954071066881, 65.67497187868834, 5.428561006500038, 15.504826019054446, 29.104993739361838, 29.38762777130245, 45.427652811923, 15.908229904681718, 17.843297650686146, 14.321980501018837, 44.967323760939976, 20.380232801005615, 22.081791429413855, 25.17397574566733, 32.6483236097624, 26.02502069792765, 5.0452635037663125, 104.43975452698106, 9.249296160588132, 9.636092878903693, 16.17416388403603, 17.12149808886111, 5.757494574316923, 20.98250616233265, 50.232962176088186, 77.46706705951743, 44.089028346630286, 75.43641959114099, 10.170672499812685, 5.6545923390947035, 8.636956558828633, 44.67865777452679, 6.280410219720844, 13.68301510644945, 9.604385612175887, 21.857537621548722, 15.703045086477204, 5.423101264655044, 8.153949638040327, 10.739081593008102, 9.173728106043484, 7.415110756997822, 19.457657122993606, 6.5530055944879235, 30.08132492448663, 22.904719756927502, 36.95277381622014, 17.040689190243338, 10.596204551895072, 9.205921971271147, 80.88825967833097, 24.397475083996156, 8.210109666577967, 7.209717874404497, 10.152230272045752, 82.90251950964186, 9.575269414286637, 49.055413139435366, 9.720601692996144, 12.187703786473744, 43.27182401208216, 12.012603924903113, 35.78961208864936, 8.858400813975884, 13.991021707425402, 50.12334277764782, 45.159099609818846, 105.51247061220968, 5.7507197124789435, 7.227374471613009, 57.38602908255779])
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);
([5762867.1875, 5771543.75, 5771857.518944695, 5968094.111091736, 5984423.4375, 5993654.011682652, 6024833.492569973, 6026268.969067068, 6029150.972991183, 6033998.369837508, 6034095.935267932, 6053313.62033091, 6070053.125, 6070099.385228222, 6148734.0489571765, 6150737.249485087, 6158706.25, 6175998.4375, 6203874.281121433, 6206259.209364204, 6206840.625, 6215035.9375, 6244733.910996761, 6262924.291262942, 6264300.626576529, 6265049.556022674, 6266373.4375, 6273751.48969333, 6275525.0, 6279695.3125, 6281170.3125, 6295335.388447535, 6300610.940553419, 6330857.8979615485, 6330905.66732585, 6332432.798826728, 6333767.091306901, 6340618.006868892, 6352773.4375, 6353500.9540543035, 6384675.456167174, 6407991.44927245, 6421443.282177832, 6421944.486282859, 6425320.3125, 6433586.717001811, 6434279.6875, 6438009.37426859, 6466965.625, 6495899.3970326735, 6500695.343761748, 6501913.162490786, 6527417.308348983, 6534208.220618709, 6536742.060566667, 6564750.0, 6568735.840891089, 6606920.7949377205, 6608414.54723425, 6609731.703490218, 6611096.875, 6623600.284467385, 6623614.848689083, 6651568.676072781, 6678390.60512634, 6684883.519425331, 6685237.568601772, 6712846.263508329, 6714105.782368884, 6717356.731213864, 6717559.375, 6717992.2344504045, 6719135.529423565, 6724261.5539595075, 6724443.30820776, 6754194.229175228, 6758622.283459757, 6786181.587492619, 6806026.5625, 6839055.374057642, 6867221.875, 6878721.545604124, 6890923.4375, 6892405.908760407, 6901429.6875, 6918922.554859861, 6925671.386937638, 6926097.778967945, 6939832.182529842, 6961503.125, 6965163.464655266, 6967885.439433658, 6968728.125, 6968837.47318516, 6969620.3125, 6969642.263128097, 6972290.529459227, 6996375.0, 7022493.1133600995, 7023028.125, 7023182.8125, 7027599.980525499, 7043819.003974354, 7044339.0625, 7046656.817974884, 7046880.8488592245, 7047070.11541496, 7047534.279861267, 7047565.471527242, 7048130.5351419225, 7048139.0625, 7049609.375, 7067048.138867046, 7107303.117685035, 7110609.375, 7200726.5625, 7200739.394698389, 7236960.252315429, 7248997.5951241115, 7262640.483921059, 7271208.951491552, 7324838.8314457005, 7396766.573281212, 7398293.214682898, 7398856.988965473, 7400293.635186077, 7431990.625, 7432624.363268056, 7437135.414299267, 7445540.625, 7471152.268448007, 7477453.983358649, 7477598.007430388, 7485967.1875, 7505669.823572805, 7506756.303893664, 7507064.832467157, 7512782.8125, 7546370.284597385, 7583632.061442829, 7608089.0625, 7617407.8125, 7620356.176801916, 7622282.809843249, 7622809.375, 7647773.4375, 7656937.5, 7656956.241741509, 7656960.383479636, 7659721.860440156, 7665213.65288027, 7682491.221459171, 7736619.190512087, 7736625.635756905, 7742343.302688506, 7746140.343593187, 7747118.75, 7757379.6875, 7789678.216189175, 7796284.167733138, 7799509.375, 7801142.927792865, 7805624.622353985, 7809163.986962744, 7820610.824274965, 7827006.455001192, 7827046.084515571, 7863041.540272705, 7865211.962906366, 7865736.776532261, 7866612.5, 7866959.008938833, 7869000.0, 7873114.0625, 7873593.308194413, 7874096.875, 7874756.531007664, 7876802.366937105, 7878105.9374527875, 7880844.178371609, 7884909.15386732, 7911506.514931304, 7928396.114414116, 7933662.986522752, 7933731.25, 7934250.998067157, 7936806.905341273, 7937007.8125, 7939183.146338605, 7939297.848396753, 7939569.611419536, 7940617.1875, 7940707.757523306, 7940723.503283187, 7940770.502537538, 7940832.8125, 7941349.180203991, 7941810.853780171, 7941929.686508307, 7942335.9375, 7942398.012101978, 7942512.159129828, 7943189.466124016, 7943208.458378089, 7943713.5608802, 7944439.858283676, 7945107.338446406, 7945415.3991380725, 7958019.2085841475, 7962486.40895796, 7962926.843628009, 7962988.753460263, 7969102.990723889, 7971698.918631968, 7973091.603947148, 7973284.375, 7973390.625, 7973396.253234824, 7974499.583027552, 7974507.990658345, 7977820.3125, 7982125.462569523, 7996962.5, 8004346.875, 8007533.888484931, 8012911.721041176, 8025104.897200552, 8037607.981786831, 8051296.407268947, 8055436.962825499, 8077982.061952556, 8078799.108317904, 8078918.75, 8080213.418298987, 8083244.930770345, 8091370.612199246, 8114755.003785151, 8114796.757877075, 8116470.3125, 8119231.25, 8121440.514154764, 8143671.5818222435, 8146476.094666708, 8167340.625, 8210817.1875, 8214796.674286238, 8218177.969385354, 8219940.697635652, 8238422.544322381, 8241573.987363132, 8265402.151751149, 8316674.339069678, 8463475.0, 8471504.993504858, 8476081.220616197, 8476099.787215091, 8499178.19835362, 8525271.875, 8527496.875, 8575969.89306547, 8698431.25, 8992250.118700221, 9045116.158814777, 9050690.625, 9480387.409962894, 9481027.717919888, 9481035.66227375, 9481038.65245725, 9481243.212905116, 9481777.674496477, 9481810.97049287, 9481873.99769166, 9481880.972654957, 9482359.22086066, 9482569.167063706, 9484524.98801597, 10054968.75, 10056972.443865092, 10111792.985131554, 10112064.053297674, 10112201.134674147, 10112265.53386166, 10112339.030883813, 10114048.037432054, 10114675.392142585, 10116449.803859226, 10117176.5625, 10117241.657592911, 10117494.790915726, 10118589.976073824, 10119337.652897846, 10119536.081815898, 10119835.130250314, 10119905.956503864, 10120090.692516504, 10120404.141417928, 10120410.690529795, 10121201.125110935, 10121223.859962832, 10121694.342121763, 10121858.0502648, 10121869.048131524, 10121948.4375, 10121987.5, 10122143.75, 10122173.02655571, 10122195.3125, 10122266.128940234, 10122318.820882117, 10122320.685985435, 10122337.330702223, 10122351.614277871, 10122397.461892942, 10122450.419419501, 10122509.375, 10122517.803658659, 10122593.777463077, 10122612.534187792, 10122673.77892823, 10122680.027310759, 10122766.947379515, 10122806.25, 10122850.29535998, 10122932.8125, 10122965.368752658, 10122973.778147697, 10123032.561727278, 10123098.424451055, 10123141.286129028, 10123211.811169818, 10123225.0, 10123252.478497772, 10123263.454005728, 10123321.077838114, 10123334.686319914, 10123468.75, 10123753.125, 10123823.4375, 10123954.275855148, 10123960.215396017, 10124054.51487494, 10124329.247376593, 10124400.943202069, 10124446.432055775, 10124462.303809723, 10124610.883272178, 10124666.73214798, 10124698.65706379, 10124725.107587026, 10124740.526273029, 10124759.714625543, 10124768.019952616, 10124792.661923219, 10125074.206248036, 10125320.56676462, 10125495.3125, 10126140.625, 10126159.375, 10126462.417100016, 10126486.787283042, 10126538.210398287, 10126897.483590683, 10127937.227421083, 10127995.416360809, 10128087.125361495, 10128353.431114137, 10128601.09827324, 10129225.186411897, 10129308.442103148, 10129612.240485962, 10129699.736278526, 10129940.432446865, 10130201.010573242, 10130699.256926, 10130842.59547921, 10130900.0, 10131027.486496096, 10131221.268560668, 10131480.147242889, 10131613.69358974, 10131904.53527518, 10132279.284105942, 10132357.912758125, 10133151.415044114, 10133467.512964675, 10133746.146245258, 10134789.0625, 10134800.274983957, 10135100.0, 10136981.677015021, 10137324.024096582, 10137476.5625, 10137945.813367594, 10139501.396332283, 10142840.00708938, 10143198.349180778, 10143793.687104937, 10144856.25, 10151667.009456087, 10154922.544287676, 10154944.138184592, 10156668.480971998], [43.38602804620143, 35.576507787228486, 65.80282480911495, 41.3535607899723, 96.04227468396071, 57.52587916170309, 8.682230603112504, 9.523770418462753, 38.072646567817316, 7.578947276549465, 6.894550125314807, 13.487271855565893, 31.867831504635596, 16.263863511823136, 98.92546842328474, 9.128196101777545, 33.364709034139246, 45.39075667446491, 173.48879360044612, 9.195168613451177, 53.07472558828404, 30.966805684912572, 7.44361559247646, 193.72597920181536, 98.41308175757308, 19.248234780149534, 47.24146980682538, 35.816358322717036, 53.58081094522712, 60.227558472248866, 29.59308133085109, 18.087959810364318, 13.346337830268837, 52.543735805255196, 34.79425007708921, 23.064561281900733, 35.69785745443531, 10.1357973711849, 33.22609798980777, 10.293488780406584, 17.0028037111745, 12.219629614667504, 21.82021130474225, 86.45341715581175, 44.64988418068424, 60.95264539675249, 45.46628063439183, 11.126563753701916, 39.03963535354618, 26.224603418455853, 17.917397968409013, 59.94880573620911, 6.282588464454149, 35.08396228436403, 35.57065634101442, 69.73804991100732, 6.078110030702215, 52.894658340327, 17.358935168429042, 102.71616940719585, 73.08562621693962, 21.697838860569465, 19.118282746838332, 47.29187253829572, 49.81874493709614, 18.553746652209103, 23.182224808613782, 13.030727595603805, 21.44161671596555, 22.51527007872808, 50.51972121766521, 21.02498184310182, 24.211051993362794, 62.358869041901784, 24.06176463735285, 61.25837406707107, 16.76624157242259, 35.20033856665516, 32.875221869189225, 26.15110811178004, 35.39650964674817, 23.382374614250825, 55.14154476255571, 119.423805779277, 47.33745619388164, 18.370728325471497, 10.441873877244468, 6.388588539229704, 25.397941229960455, 65.72129705974932, 8.872349349031865, 6.41175004918781, 50.15140822958821, 6.263816439897228, 68.15500718300589, 37.37397383708311, 30.4763795950091, 71.3838445240838, 42.68128678542248, 86.34407525071556, 68.60471193689399, 117.48165389910574, 24.856327369175062, 75.4386409453259, 6.149224628029161, 42.16646259857624, 52.01016201432133, 84.8269530822382, 14.387122471091141, 17.77360680012989, 89.87894912677226, 44.38226881143853, 27.294253114235367, 11.116292260002503, 75.25467235799687, 50.60063247708851, 8.470425423840386, 19.82535630203808, 73.62314723210129, 66.9369497343669, 40.629085790756875, 54.52752911658617, 8.860960698272041, 56.115398448358036, 6.920582905833345, 32.95210423704349, 72.16600058345108, 58.123563907548444, 13.262950665124942, 56.69324121117948, 35.28600399396331, 6.6306264731221685, 5.38228350731839, 75.04361616625297, 32.48116981205151, 9.37739287813508, 7.907673345034054, 42.01739217821939, 33.74391847685495, 41.86801217276933, 90.34528950740672, 58.626663132232174, 9.270267591808793, 40.85000765516894, 67.86946507635527, 71.53691721031186, 31.341900731797413, 14.91012507385122, 94.76548839817428, 14.886303004463084, 86.9664456460605, 149.44859049619797, 183.05471285106248, 18.082388822459347, 50.281717545787075, 43.99007650083875, 88.78156640247447, 41.90008855516701, 87.09109493775617, 15.245598664114793, 43.23334864503968, 10.047044292949066, 49.55166855301441, 69.49474072968044, 61.066823427534715, 15.785026938599403, 7.90855895790753, 10.24721048902045, 31.23789257975723, 167.22696440166612, 28.6591412492301, 10.599990381484798, 35.266009511840835, 44.816423406207825, 71.67454275282857, 41.176048234966025, 36.67899347069677, 8.763317634001455, 7.041646734798786, 31.808150583528324, 86.5487685867507, 23.625135763262314, 19.23565205636849, 17.18887770016271, 36.6301474064023, 27.773114173820357, 9.954674444708742, 89.33325786962851, 49.61983098302642, 6.028907724867361, 19.69718546829858, 51.01991177842259, 27.482118750021872, 50.643447173374085, 21.348611172205167, 47.86825412506822, 93.55809248597987, 14.63172969465865, 28.505586456852278, 51.032999937121076, 32.476355294129405, 67.01492101735542, 16.7409730730152, 77.53585046352146, 10.424794570825458, 20.3152774286481, 21.75589402452437, 7.523540179062741, 14.734436511363308, 5.8497075882549, 16.133472059337766, 46.83547266069343, 68.80153114801033, 69.79346844272294, 191.52818467319517, 53.9027907795991, 49.49993473431921, 8.855731186922696, 9.00207506365171, 23.32398761071109, 46.7255212045656, 9.755760549744647, 73.97360818078704, 110.18909588317808, 18.650470591931104, 91.26482171569674, 53.50562024406739, 30.68780272703772, 5.899682060425015, 18.40316611409991, 19.311557131057192, 6.1607516281549755, 56.95021166744607, 16.850166859626096, 53.75475146941815, 5.630842207526623, 16.301653767576298, 62.43124038999092, 41.421460810931606, 67.39989261599767, 110.16723285809158, 11.311066565845627, 21.34259682292935, 28.608530045819357, 71.8068485807847, 6.242168368519039, 25.788662705384546, 53.70548474110078, 30.59778140569336, 17.5535253758634, 41.10402017593515, 5.578497174731295, 106.73219339093161, 16.25198176084425, 6.4824949064226445, 49.780504338625704, 15.574035762864412, 62.542145936838295, 54.8529427761514, 22.33628145411568, 36.90701411144158, 70.18674453393186, 23.870646849921016, 38.79942369784406, 26.862614593677844, 22.47296478574406, 10.723137881173084, 64.71788971777939, 67.75392475699087, 7.448039014856053, 71.68303812378888, 36.18801928439754, 9.107408589935357, 8.206713834073264, 88.22384424782797, 14.8960278092231, 45.15052608118392, 42.44316398292928, 29.066941182557038, 5.93860453209275, 13.528158143369106, 18.284392012977886, 69.88192415326782, 82.11163261073261, 46.75994975872994, 25.174704240268895, 58.53973711246862, 5.585385965174616, 29.04824588947611, 38.55448230140668, 54.86698765707017, 51.67803049714223, 18.892676126848922, 13.929581646263825, 15.205250587183919, 19.67881182732335, 39.48081360750911, 22.14127399427046, 16.83999682278393, 12.199263280080828, 9.540877829288258, 16.21421761518542, 38.82689761161724, 49.49954769082495, 51.6151830152796, 10.540877515500929, 89.41820278257181, 6.142120699315385, 11.240337561109424, 16.325515217565442, 46.07873101645974, 8.314149446781126, 105.05407903569929, 42.92417254418977, 40.51329094991043, 19.94453009656791, 17.73662795305519, 30.414824536828878, 26.152253447843698, 59.55891639822969, 50.57885542965472, 29.856719980121472, 61.31826519870732, 63.87159061253053, 24.326186537720755, 63.231540771876375, 5.238180469898945, 12.176875107372013, 31.737289921426992, 27.85919509135034, 76.70630091390042, 12.941954071066881, 65.67497187868834, 5.428561006500038, 15.504826019054446, 29.104993739361838, 29.38762777130245, 45.427652811923, 15.908229904681718, 17.843297650686146, 14.321980501018837, 44.967323760939976, 20.380232801005615, 22.081791429413855, 25.17397574566733, 32.6483236097624, 26.02502069792765, 5.0452635037663125, 104.43975452698106, 9.249296160588132, 9.636092878903693, 16.17416388403603, 17.12149808886111, 5.757494574316923, 20.98250616233265, 50.232962176088186, 77.46706705951743, 44.089028346630286, 75.43641959114099, 10.170672499812685, 5.6545923390947035, 8.636956558828633, 44.67865777452679, 6.280410219720844, 13.68301510644945, 9.604385612175887, 21.857537621548722, 15.703045086477204, 5.423101264655044, 8.153949638040327, 10.739081593008102, 9.173728106043484, 7.415110756997822, 19.457657122993606, 6.5530055944879235, 30.08132492448663, 22.904719756927502, 36.95277381622014, 17.040689190243338, 10.596204551895072, 9.205921971271147, 80.88825967833097, 24.397475083996156, 8.210109666577967, 7.209717874404497, 10.152230272045752, 82.90251950964186, 9.575269414286637, 49.055413139435366, 9.720601692996144, 12.187703786473744, 43.27182401208216, 12.012603924903113, 35.78961208864936, 8.858400813975884, 13.991021707425402, 50.12334277764782, 45.159099609818846, 105.51247061220968, 5.7507197124789435, 7.227374471613009, 57.38602908255779])
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)