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 = 47172
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);
([7963592.982204803, 7963613.806308329, 7963741.104124834, 7964744.680983919, 7964839.0625, 7967965.625, 7968004.6875, 8871534.099239687, 8873423.4375, 8979244.579073904, 9017137.263243465, 9018636.369102158, 9019164.282828864, 9019315.625, 9019846.875, 9020017.1875, 9021961.25884052, 9022045.212263798, 9022485.67290666, 9034270.002746161, 9066013.990138689, 9066026.28926968, 9066443.75, 9066962.878863458, 9067003.90823891, 9067244.43478072, 9067583.719711049, 9067628.769276852, 9067636.17822293, 9067661.95926901, 9067818.75, 9067823.4375, 9067849.448779108, 9067850.612629965, 9067870.71049345, 9067921.875, 9067948.317182789, 9068015.77050576, 9068092.1875, 9068096.474391127, 9068312.709967967, 9068405.540916104, 9068483.937865177, 9068490.625, 9068535.81304273, 9068565.40614541, 9068635.530090764, 9068637.030432781, 9068652.60765284, 9068672.611330105, 9068713.697294086, 9068718.75, 9068724.573610028, 9068728.125, 9068746.727793239, 9068751.023194402, 9068768.911481744, 9068787.5, 9068796.638047418, 9068845.654679539, 9068953.125, 9068963.744013736, 9068963.869187467, 9068988.118115164, 9069000.881695097, 9069011.171570987, 9069050.874987295, 9069096.473207438, 9069145.3125, 9069181.204104489, 9069326.5625, 9069421.563314188, 9069422.941742068, 9069475.0, 9069554.855608761, 9069693.335699935, 9069765.625, 9069937.220984543, 9070123.400187528, 9070381.25, 9070556.014834497, 10144567.1875, 10299055.773301495, 10342265.625, 10343067.670245446, 10355512.11842291, 10357128.125, 10393161.861029685, 10400006.25, 10400025.0, 10402627.648256913, 10408268.952776767, 10409759.375, 10411534.942384958, 10412179.060071757, 10414334.375, 10415054.413537351, 10416193.001842257, 10416304.6875, 10416561.560823966, 10416761.537642589, 10417279.6875, 10417662.18335909, 10417885.9375, 10420315.619455034, 10422593.75, 10423431.378397385, 10423654.6875, 10425475.524682034, 10425970.293885378, 10426173.390644401, 10427557.8125, 10443728.125, 10452999.008831691, 10453614.750294406, 10453624.604567643, 10454304.500624644, 10454581.20231837, 10454705.647432934, 10455626.5625, 10455699.806645755, 10456949.381212695, 10456988.82394953, 10457466.706541572, 10457609.352634994, 10457773.4375, 10457799.974396572, 10457928.686383994, 10458011.82967639, 10458323.816045541, 10458581.131909428, 10458603.400768375, 10458745.867958596, 10458920.468511289, 10458927.624965757, 10460612.261853812, 10460852.984716477, 10461158.619875861, 10461705.716521336, 10461865.321585562, 10462076.113002947, 10462853.125, 10463420.3125, 10463964.99662347, 10463971.788099406, 10464007.8125, 10464010.48632321, 10464135.9375, 10464230.852931835, 10464456.47223508, 10464647.14864606, 10464660.436193453, 10464685.411735581, 10465149.106616022, 10465167.1875, 10465258.714637661, 10465472.834041178, 10465957.722338147, 10466025.063575061, 10466076.5625, 10466088.2629128, 10466117.85103026, 10466389.906992069, 10466957.8125, 10467081.25, 10467308.149863273, 10468106.338226255, 10468152.616173755, 10475071.875, 10475438.989614183, 10477610.497038728, 11126055.661481392, 11197219.231078403, 11282321.372359717, 11283454.6875, 11283463.821637612, 11285057.666158594, 11296967.113672473, 11300712.5, 11300797.59931536, 11305640.378780058, 11310453.055866769, 11313898.221147379, 11317634.375, 11318895.3125, 11319967.908327123, 11320468.323614638, 11321190.625, 11321766.893069964, 11321973.415963707, 11321991.78802468, 11322350.0, 11322358.854233148, 11323110.784568055, 11323277.110165393, 11323972.31251413, 11324774.319154778, 11326306.763743456, 11333840.940571748, 11335120.3125, 11349284.044612015, 11349616.575191539, 11354440.120126676, 11355585.086727422, 11356248.935158845, 11358351.5625, 11358546.704702662, 11358760.9375, 11358848.892208278, 11361017.720748225, 11367022.953937488, 11368717.982338864, 11370841.647825057, 11371250.133878132, 11373799.930271162, 11374494.66496029, 11376168.75, 11376866.361529706, 11379176.700937103, 11389687.5, 11392041.41926688, 11392569.737311034, 11396660.454690026, 11423685.417948134, 11423704.163289882, 11423720.087277567, 11436869.524380893, 11437101.776986022, 11437151.2935962, 11437525.853979174, 11437691.479143698, 11437814.490936754, 11437861.792631958, 11437937.5, 11437969.14175659, 11438017.1875, 11438073.440127524, 11438167.68404711, 11438439.0625, 11438875.68930296, 11439096.464136537, 11439406.40512044, 11440487.071141219, 11440650.0, 11441163.955913164, 11441909.375, 11443554.40495292, 11443704.114207337, 11443993.75, 11444644.661183016, 11445005.7017424, 11445681.25, 11445899.967640879, 11446167.1875, 11446200.598798158, 11446220.3125, 11446305.152404064, 11446312.50939064, 11446475.0, 11446512.384993266, 11446549.182075595, 11446568.75, 11446583.830543434, 11446620.942619605, 11446693.567180589, 11446714.633562578, 11446872.110032672, 11446903.125, 11446915.770135196, 11446921.159330318, 11446973.119032143, 11447023.799211182, 11447075.195452847, 11447122.583317088, 11447128.125, 11447332.8125, 11447340.625, 11447353.125, 11447375.941917026, 11447396.107201766, 11447451.5625, 11447511.57342388, 11447552.58380527, 11447584.375, 11447587.995641561, 11447589.0625, 11447597.266490655, 11448010.940019105, 11448494.330329701, 11448506.25, 11710816.61874608, 11713549.04538004, 11714401.5625, 11714435.734435465, 11730343.384231346, 11746267.966708465, 11780426.661580306, 11780926.18706503, 13724996.00509938, 13726846.875, 13754921.00949832, 13762601.5625, 13768062.997230932, 13771275.016532991, 13792214.0625, 13801031.134139651, 13801468.75, 13802711.512941476, 13803081.655404417, 13804774.400335073, 13804782.340129334, 13804983.167949324, 13805951.325504327, 13806529.218389781, 13806795.021445438, 13807598.231705148, 13808215.625, 13810050.453737855, 13810701.190622294, 13810865.625, 13810901.181443278, 13811126.590936054, 13811216.87558172, 13811326.306067297, 13811336.757785909, 13811652.89747758, 13811796.124090934, 13811936.937831666, 13811946.875, 13811960.172369123, 13812028.125, 13812752.594399177, 13812987.173939781, 13815941.421098094, 13816365.625, 13816631.599312708, 13816821.821186103, 13816996.176864345, 13818092.762535386, 13818379.65963208, 13819000.0, 13820051.138324806, 13820441.555373793, 13820615.850039897, 13821312.156815426, 13821586.172790162, 13821769.881510034, 13823648.4375, 13824035.358088024, 13825214.798555456, 14485867.1875, 14492500.0, 14493129.352886913, 14493379.6875, 14494601.5625, 14495985.329818103, 14496827.993364064, 14499025.0, 14499255.327548087, 14499323.4375, 14499393.75, 14499560.9375, 14499574.189555805, 14499712.415253263, 14499741.274360621, 14500417.1875, 14501259.375, 14501491.101854064, 14502004.6875, 14502267.723730767, 14502681.661145387, 14503335.9375, 14503648.4375, 14504225.27840076, 14504289.541002782, 14504335.254409593, 14504979.61410399, 14505591.586475471, 14505749.94087443, 14506058.513708333, 14506966.89173253, 14507631.25, 14507682.968524897, 14508537.002239123, 14510028.598871375, 14510091.506644001, 14510374.70021433, 14510558.748183133, 14511642.484538352, 14512138.378102923, 14512420.312002828], [7.347295560992391, 8.155591270436783, 17.14759624562754, 72.26426494792628, 61.30982443356447, 73.15955584332555, 31.426467459892173, 13.985217846958248, 60.25522909604897, 6.941138359453439, 53.84954882794964, 16.888608231585444, 18.52726504203989, 108.19741875946764, 30.007770563026895, 58.99675095252624, 7.208564416545151, 5.528235458137968, 34.03952251792684, 7.494919634693362, 43.32423586232473, 13.99320692205159, 94.23408409242194, 16.61318337177656, 46.567122665600095, 63.46961163376803, 26.630647820986567, 12.310080183756735, 114.17905894931286, 10.37605447606832, 38.91923002415414, 132.0142137861193, 106.93151843395, 12.2424687457759, 7.753820234774451, 225.93984648895673, 72.26686645665053, 11.363022139100178, 54.32072205350184, 110.28335480446333, 6.520517093329958, 8.796088458112024, 8.068192910603603, 82.56203029515017, 67.01626452575262, 24.845722176236784, 24.013161543465255, 8.963594086036899, 6.203975541281992, 43.71966684146794, 5.091335485179955, 89.33617787977832, 13.5322713431884, 90.99449938274194, 8.210236361271964, 21.109766530418046, 15.594924636635021, 68.29605613943774, 30.352630705329926, 150.44965106662235, 67.34037883394168, 9.075881099088145, 148.41041113428514, 17.970339905636298, 104.22581264889115, 110.80733855600128, 19.806450701468695, 13.603308668607676, 56.173366387703076, 27.648175600958005, 48.144632025911136, 48.64428994871422, 97.14290772032307, 37.86589986144454, 14.580931605634847, 18.10344982827344, 110.2069081365405, 37.118274534810624, 27.807328673746596, 34.08517540325323, 24.615814519425978, 55.052865179246695, 21.728737564741152, 104.3823225847459, 52.321574649176, 13.662517858038614, 42.324511620461074, 20.210439226765107, 77.17155528745522, 29.40706199290491, 5.1914437443063575, 11.460176375435598, 71.51678402233152, 45.72572512876208, 12.99009243762336, 37.8485436275223, 13.990893057038198, 7.926957327383294, 39.81040805373851, 18.003232332306066, 8.631667903308546, 74.92853880335427, 120.05457196638575, 86.20931096226532, 40.902101914314756, 56.49279276817975, 15.454576412217357, 40.88350289257361, 66.8030943623321, 57.477657359167196, 114.28709451742031, 29.23198252467918, 67.56612975068279, 48.75494613730183, 25.393089809063127, 22.546482036819476, 83.38071336818504, 27.615326996413067, 48.297387766265686, 32.83403711377177, 18.463935111748974, 20.38468841335033, 14.02151099626284, 28.848725193655888, 22.63999815362437, 92.45847410203007, 37.56060491969693, 17.622086017787872, 7.961289327994554, 23.34422665121206, 6.252392881612734, 6.117253994137737, 26.420655609540837, 15.571474244693093, 21.492758651371155, 14.368408444385253, 97.5193981388888, 57.66810475958583, 21.16550948654626, 23.707224710847516, 13.466523105021716, 33.2439817140666, 102.21937185416573, 12.987686458136931, 10.994539036099772, 30.77745012369718, 29.36388867621468, 32.294928651847066, 7.465672348949046, 11.493799706964625, 34.21785876806908, 120.85836008693933, 13.256032913427322, 74.18628378441886, 118.47483975271113, 20.029835787065124, 10.29949228129394, 14.608641124266986, 9.385744294273525, 76.1396540853285, 10.072153766327338, 18.064147044946672, 5.879224521891801, 34.167834546445356, 29.033705968144336, 11.69941851323578, 83.0979611402375, 10.415754918518978, 67.97311680124773, 27.161473011960716, 60.49295596803614, 10.317550861159818, 25.323596362254015, 13.318820731892234, 42.49652466029068, 9.135719085118124, 19.61994033582354, 44.7051774914401, 54.59074412752957, 104.84091382356314, 83.41455558504823, 22.66749045932176, 30.61242889492475, 101.36236827695845, 30.277509697670673, 40.76034981391404, 27.996148997847584, 99.57682367572568, 6.441906417168382, 63.967049184374915, 5.905355753691943, 41.89091967616774, 8.926738726307262, 10.89679211957779, 17.54052691728345, 24.92665643658602, 85.75283904570789, 17.34309105196871, 11.65959732352815, 35.14447136152484, 44.53890959910781, 25.667339317709473, 10.420710072680322, 18.586718422726726, 24.16785511619703, 81.95005417670303, 43.952980053352064, 54.038927160448516, 6.136696708230347, 5.854518551084587, 17.40889489419827, 19.182613606122974, 17.28012185893428, 9.447229649756078, 93.33563340517841, 20.137594821323564, 54.970656869938686, 112.59796498970071, 11.351214321048074, 70.7983636810983, 8.756573242026638, 23.69959427430532, 6.039290200107718, 21.30025227357076, 8.027544292923556, 8.170961834218716, 26.675947344364506, 117.02245887727913, 24.15624909478717, 7.944359191617698, 7.944431774528463, 27.294496151281688, 83.65709015972743, 44.84278616130845, 7.228386576124179, 58.03780737368473, 5.706925250488892, 5.483490295776018, 41.355077771385695, 11.725437748932773, 5.155902030696243, 6.104380305427115, 7.455157644653359, 34.82397801532626, 9.242875297124835, 98.08227445136555, 23.976268279113167, 6.654207249285541, 92.59124041653834, 115.202922022989, 13.19579478641726, 63.882610623079145, 11.077501329700738, 30.024714164298683, 16.535068958063132, 83.25275171496577, 17.068982550114313, 23.4334698218483, 31.776166732202416, 55.19814277519515, 7.896731880642961, 146.92551860271152, 22.74190979161343, 51.37764136175477, 56.8176871007872, 9.865942368246678, 5.960138310825025, 56.46050325496443, 27.155409974126748, 5.317982143430457, 23.517672357440407, 11.744426545027236, 87.5781478065177, 12.450497837943889, 29.378048164472002, 66.70755620954817, 115.48547609473877, 74.39883348113257, 12.39789334642025, 8.756861216235293, 62.98540500768753, 79.16371263466968, 60.56795846498426, 81.51759871455934, 7.7929108763924475, 63.242893712296464, 7.228311200906827, 11.131646609312396, 6.582080905307526, 50.5215164536163, 13.141608529087472, 17.906166397094232, 70.67031062509756, 54.45026724969145, 81.5446714168206, 5.572132074046488, 7.147742722100942, 22.832727464967693, 9.994815541945913, 52.972614734612264, 60.10914697193614, 70.31163869354376, 84.68145354243262, 106.50858479160718, 56.24042630184604, 10.95131332687161, 31.205839628818065, 27.760052520028232, 11.826590150629048, 10.304067711313598, 10.461761891809234, 9.651197803746395, 27.243433702546525, 25.18949451106912, 5.688481563913891, 41.30650833158451, 37.490964126109645, 17.007927689532412, 16.992739957648926, 82.19271628493924, 13.664051957210015, 57.08977631122008, 56.79862189303643, 14.046586873215881, 26.614738968283593, 39.40517785339584, 7.925755638415095, 97.30443725242962, 49.49514175342056, 48.00162460895908, 44.13556866424448, 8.919726985714354, 10.653630621861707, 19.19202556886405, 92.38339457134447, 21.84744491358193, 7.583889390155773, 6.631698273477332, 50.593935717719496, 73.17610349593625, 62.12668886551231, 32.026069044201776, 7.3895623735131215, 41.312235942936326, 5.447226977731393, 7.184707053505483, 50.409244959859876, 98.50754847080253, 8.88523868161163, 136.44318666351182, 46.23994826602826, 76.67121604271013, 37.31221227099809, 46.54720940170638, 38.28074198495992, 158.7360654776128, 26.16927090369958, 127.38079498777742, 8.656764509772191, 57.31563188205357, 43.084266854261486, 41.94936748492635, 18.869773280965923, 14.62804224829878, 24.643184900662646, 99.81132413692951, 45.63811389936757, 100.20994295365864, 53.071200841535926, 8.592075523314882, 112.4263083541243, 55.779979264050354, 75.49436090099024, 16.12062306672916, 17.14413718729791, 10.205050181231115, 52.7138298282063, 10.302427227212231, 37.82320735694315, 38.96431735347823, 5.688189632141488, 100.29867433776519, 15.571532465851039, 6.996476935004705, 53.24311465816339, 11.357390731864317, 116.12615277750105, 20.314909300865384, 5.474661844271683, 5.500761641798024, 54.48443210644228])
caption, xmean,count, xle, Etot = energy_spectrum(E_tot)
hist_file(E_hist, xmean, count, caption);
([7963592.982204803, 7963613.806308329, 7963741.104124834, 7964744.680983919, 7964839.0625, 7967965.625, 7968004.6875, 8871534.099239687, 8873423.4375, 8979244.579073904, 9017137.263243465, 9018636.369102158, 9019164.282828864, 9019315.625, 9019846.875, 9020017.1875, 9021961.25884052, 9022045.212263798, 9022485.67290666, 9034270.002746161, 9066013.990138689, 9066026.28926968, 9066443.75, 9066962.878863458, 9067003.90823891, 9067244.43478072, 9067583.719711049, 9067628.769276852, 9067636.17822293, 9067661.95926901, 9067818.75, 9067823.4375, 9067849.448779108, 9067850.612629965, 9067870.71049345, 9067921.875, 9067948.317182789, 9068015.77050576, 9068092.1875, 9068096.474391127, 9068312.709967967, 9068405.540916104, 9068483.937865177, 9068490.625, 9068535.81304273, 9068565.40614541, 9068635.530090764, 9068637.030432781, 9068652.60765284, 9068672.611330105, 9068713.697294086, 9068718.75, 9068724.573610028, 9068728.125, 9068746.727793239, 9068751.023194402, 9068768.911481744, 9068787.5, 9068796.638047418, 9068845.654679539, 9068953.125, 9068963.744013736, 9068963.869187467, 9068988.118115164, 9069000.881695097, 9069011.171570987, 9069050.874987295, 9069096.473207438, 9069145.3125, 9069181.204104489, 9069326.5625, 9069421.563314188, 9069422.941742068, 9069475.0, 9069554.855608761, 9069693.335699935, 9069765.625, 9069937.220984543, 9070123.400187528, 9070381.25, 9070556.014834497, 10144567.1875, 10299055.773301495, 10342265.625, 10343067.670245446, 10355512.11842291, 10357128.125, 10393161.861029685, 10400006.25, 10400025.0, 10402627.648256913, 10408268.952776767, 10409759.375, 10411534.942384958, 10412179.060071757, 10414334.375, 10415054.413537351, 10416193.001842257, 10416304.6875, 10416561.560823966, 10416761.537642589, 10417279.6875, 10417662.18335909, 10417885.9375, 10420315.619455034, 10422593.75, 10423431.378397385, 10423654.6875, 10425475.524682034, 10425970.293885378, 10426173.390644401, 10427557.8125, 10443728.125, 10452999.008831691, 10453614.750294406, 10453624.604567643, 10454304.500624644, 10454581.20231837, 10454705.647432934, 10455626.5625, 10455699.806645755, 10456949.381212695, 10456988.82394953, 10457466.706541572, 10457609.352634994, 10457773.4375, 10457799.974396572, 10457928.686383994, 10458011.82967639, 10458323.816045541, 10458581.131909428, 10458603.400768375, 10458745.867958596, 10458920.468511289, 10458927.624965757, 10460612.261853812, 10460852.984716477, 10461158.619875861, 10461705.716521336, 10461865.321585562, 10462076.113002947, 10462853.125, 10463420.3125, 10463964.99662347, 10463971.788099406, 10464007.8125, 10464010.48632321, 10464135.9375, 10464230.852931835, 10464456.47223508, 10464647.14864606, 10464660.436193453, 10464685.411735581, 10465149.106616022, 10465167.1875, 10465258.714637661, 10465472.834041178, 10465957.722338147, 10466025.063575061, 10466076.5625, 10466088.2629128, 10466117.85103026, 10466389.906992069, 10466957.8125, 10467081.25, 10467308.149863273, 10468106.338226255, 10468152.616173755, 10475071.875, 10475438.989614183, 10477610.497038728, 11126055.661481392, 11197219.231078403, 11282321.372359717, 11283454.6875, 11283463.821637612, 11285057.666158594, 11296967.113672473, 11300712.5, 11300797.59931536, 11305640.378780058, 11310453.055866769, 11313898.221147379, 11317634.375, 11318895.3125, 11319967.908327123, 11320468.323614638, 11321190.625, 11321766.893069964, 11321973.415963707, 11321991.78802468, 11322350.0, 11322358.854233148, 11323110.784568055, 11323277.110165393, 11323972.31251413, 11324774.319154778, 11326306.763743456, 11333840.940571748, 11335120.3125, 11349284.044612015, 11349616.575191539, 11354440.120126676, 11355585.086727422, 11356248.935158845, 11358351.5625, 11358546.704702662, 11358760.9375, 11358848.892208278, 11361017.720748225, 11367022.953937488, 11368717.982338864, 11370841.647825057, 11371250.133878132, 11373799.930271162, 11374494.66496029, 11376168.75, 11376866.361529706, 11379176.700937103, 11389687.5, 11392041.41926688, 11392569.737311034, 11396660.454690026, 11423685.417948134, 11423704.163289882, 11423720.087277567, 11436869.524380893, 11437101.776986022, 11437151.2935962, 11437525.853979174, 11437691.479143698, 11437814.490936754, 11437861.792631958, 11437937.5, 11437969.14175659, 11438017.1875, 11438073.440127524, 11438167.68404711, 11438439.0625, 11438875.68930296, 11439096.464136537, 11439406.40512044, 11440487.071141219, 11440650.0, 11441163.955913164, 11441909.375, 11443554.40495292, 11443704.114207337, 11443993.75, 11444644.661183016, 11445005.7017424, 11445681.25, 11445899.967640879, 11446167.1875, 11446200.598798158, 11446220.3125, 11446305.152404064, 11446312.50939064, 11446475.0, 11446512.384993266, 11446549.182075595, 11446568.75, 11446583.830543434, 11446620.942619605, 11446693.567180589, 11446714.633562578, 11446872.110032672, 11446903.125, 11446915.770135196, 11446921.159330318, 11446973.119032143, 11447023.799211182, 11447075.195452847, 11447122.583317088, 11447128.125, 11447332.8125, 11447340.625, 11447353.125, 11447375.941917026, 11447396.107201766, 11447451.5625, 11447511.57342388, 11447552.58380527, 11447584.375, 11447587.995641561, 11447589.0625, 11447597.266490655, 11448010.940019105, 11448494.330329701, 11448506.25, 11710816.61874608, 11713549.04538004, 11714401.5625, 11714435.734435465, 11730343.384231346, 11746267.966708465, 11780426.661580306, 11780926.18706503, 13724996.00509938, 13726846.875, 13754921.00949832, 13762601.5625, 13768062.997230932, 13771275.016532991, 13792214.0625, 13801031.134139651, 13801468.75, 13802711.512941476, 13803081.655404417, 13804774.400335073, 13804782.340129334, 13804983.167949324, 13805951.325504327, 13806529.218389781, 13806795.021445438, 13807598.231705148, 13808215.625, 13810050.453737855, 13810701.190622294, 13810865.625, 13810901.181443278, 13811126.590936054, 13811216.87558172, 13811326.306067297, 13811336.757785909, 13811652.89747758, 13811796.124090934, 13811936.937831666, 13811946.875, 13811960.172369123, 13812028.125, 13812752.594399177, 13812987.173939781, 13815941.421098094, 13816365.625, 13816631.599312708, 13816821.821186103, 13816996.176864345, 13818092.762535386, 13818379.65963208, 13819000.0, 13820051.138324806, 13820441.555373793, 13820615.850039897, 13821312.156815426, 13821586.172790162, 13821769.881510034, 13823648.4375, 13824035.358088024, 13825214.798555456, 14485867.1875, 14492500.0, 14493129.352886913, 14493379.6875, 14494601.5625, 14495985.329818103, 14496827.993364064, 14499025.0, 14499255.327548087, 14499323.4375, 14499393.75, 14499560.9375, 14499574.189555805, 14499712.415253263, 14499741.274360621, 14500417.1875, 14501259.375, 14501491.101854064, 14502004.6875, 14502267.723730767, 14502681.661145387, 14503335.9375, 14503648.4375, 14504225.27840076, 14504289.541002782, 14504335.254409593, 14504979.61410399, 14505591.586475471, 14505749.94087443, 14506058.513708333, 14506966.89173253, 14507631.25, 14507682.968524897, 14508537.002239123, 14510028.598871375, 14510091.506644001, 14510374.70021433, 14510558.748183133, 14511642.484538352, 14512138.378102923, 14512420.312002828], [7.347295560992391, 8.155591270436783, 17.14759624562754, 72.26426494792628, 61.30982443356447, 73.15955584332555, 31.426467459892173, 13.985217846958248, 60.25522909604897, 6.941138359453439, 53.84954882794964, 16.888608231585444, 18.52726504203989, 108.19741875946764, 30.007770563026895, 58.99675095252624, 7.208564416545151, 5.528235458137968, 34.03952251792684, 7.494919634693362, 43.32423586232473, 13.99320692205159, 94.23408409242194, 16.61318337177656, 46.567122665600095, 63.46961163376803, 26.630647820986567, 12.310080183756735, 114.17905894931286, 10.37605447606832, 38.91923002415414, 132.0142137861193, 106.93151843395, 12.2424687457759, 7.753820234774451, 225.93984648895673, 72.26686645665053, 11.363022139100178, 54.32072205350184, 110.28335480446333, 6.520517093329958, 8.796088458112024, 8.068192910603603, 82.56203029515017, 67.01626452575262, 24.845722176236784, 24.013161543465255, 8.963594086036899, 6.203975541281992, 43.71966684146794, 5.091335485179955, 89.33617787977832, 13.5322713431884, 90.99449938274194, 8.210236361271964, 21.109766530418046, 15.594924636635021, 68.29605613943774, 30.352630705329926, 150.44965106662235, 67.34037883394168, 9.075881099088145, 148.41041113428514, 17.970339905636298, 104.22581264889115, 110.80733855600128, 19.806450701468695, 13.603308668607676, 56.173366387703076, 27.648175600958005, 48.144632025911136, 48.64428994871422, 97.14290772032307, 37.86589986144454, 14.580931605634847, 18.10344982827344, 110.2069081365405, 37.118274534810624, 27.807328673746596, 34.08517540325323, 24.615814519425978, 55.052865179246695, 21.728737564741152, 104.3823225847459, 52.321574649176, 13.662517858038614, 42.324511620461074, 20.210439226765107, 77.17155528745522, 29.40706199290491, 5.1914437443063575, 11.460176375435598, 71.51678402233152, 45.72572512876208, 12.99009243762336, 37.8485436275223, 13.990893057038198, 7.926957327383294, 39.81040805373851, 18.003232332306066, 8.631667903308546, 74.92853880335427, 120.05457196638575, 86.20931096226532, 40.902101914314756, 56.49279276817975, 15.454576412217357, 40.88350289257361, 66.8030943623321, 57.477657359167196, 114.28709451742031, 29.23198252467918, 67.56612975068279, 48.75494613730183, 25.393089809063127, 22.546482036819476, 83.38071336818504, 27.615326996413067, 48.297387766265686, 32.83403711377177, 18.463935111748974, 20.38468841335033, 14.02151099626284, 28.848725193655888, 22.63999815362437, 92.45847410203007, 37.56060491969693, 17.622086017787872, 7.961289327994554, 23.34422665121206, 6.252392881612734, 6.117253994137737, 26.420655609540837, 15.571474244693093, 21.492758651371155, 14.368408444385253, 97.5193981388888, 57.66810475958583, 21.16550948654626, 23.707224710847516, 13.466523105021716, 33.2439817140666, 102.21937185416573, 12.987686458136931, 10.994539036099772, 30.77745012369718, 29.36388867621468, 32.294928651847066, 7.465672348949046, 11.493799706964625, 34.21785876806908, 120.85836008693933, 13.256032913427322, 74.18628378441886, 118.47483975271113, 20.029835787065124, 10.29949228129394, 14.608641124266986, 9.385744294273525, 76.1396540853285, 10.072153766327338, 18.064147044946672, 5.879224521891801, 34.167834546445356, 29.033705968144336, 11.69941851323578, 83.0979611402375, 10.415754918518978, 67.97311680124773, 27.161473011960716, 60.49295596803614, 10.317550861159818, 25.323596362254015, 13.318820731892234, 42.49652466029068, 9.135719085118124, 19.61994033582354, 44.7051774914401, 54.59074412752957, 104.84091382356314, 83.41455558504823, 22.66749045932176, 30.61242889492475, 101.36236827695845, 30.277509697670673, 40.76034981391404, 27.996148997847584, 99.57682367572568, 6.441906417168382, 63.967049184374915, 5.905355753691943, 41.89091967616774, 8.926738726307262, 10.89679211957779, 17.54052691728345, 24.92665643658602, 85.75283904570789, 17.34309105196871, 11.65959732352815, 35.14447136152484, 44.53890959910781, 25.667339317709473, 10.420710072680322, 18.586718422726726, 24.16785511619703, 81.95005417670303, 43.952980053352064, 54.038927160448516, 6.136696708230347, 5.854518551084587, 17.40889489419827, 19.182613606122974, 17.28012185893428, 9.447229649756078, 93.33563340517841, 20.137594821323564, 54.970656869938686, 112.59796498970071, 11.351214321048074, 70.7983636810983, 8.756573242026638, 23.69959427430532, 6.039290200107718, 21.30025227357076, 8.027544292923556, 8.170961834218716, 26.675947344364506, 117.02245887727913, 24.15624909478717, 7.944359191617698, 7.944431774528463, 27.294496151281688, 83.65709015972743, 44.84278616130845, 7.228386576124179, 58.03780737368473, 5.706925250488892, 5.483490295776018, 41.355077771385695, 11.725437748932773, 5.155902030696243, 6.104380305427115, 7.455157644653359, 34.82397801532626, 9.242875297124835, 98.08227445136555, 23.976268279113167, 6.654207249285541, 92.59124041653834, 115.202922022989, 13.19579478641726, 63.882610623079145, 11.077501329700738, 30.024714164298683, 16.535068958063132, 83.25275171496577, 17.068982550114313, 23.4334698218483, 31.776166732202416, 55.19814277519515, 7.896731880642961, 146.92551860271152, 22.74190979161343, 51.37764136175477, 56.8176871007872, 9.865942368246678, 5.960138310825025, 56.46050325496443, 27.155409974126748, 5.317982143430457, 23.517672357440407, 11.744426545027236, 87.5781478065177, 12.450497837943889, 29.378048164472002, 66.70755620954817, 115.48547609473877, 74.39883348113257, 12.39789334642025, 8.756861216235293, 62.98540500768753, 79.16371263466968, 60.56795846498426, 81.51759871455934, 7.7929108763924475, 63.242893712296464, 7.228311200906827, 11.131646609312396, 6.582080905307526, 50.5215164536163, 13.141608529087472, 17.906166397094232, 70.67031062509756, 54.45026724969145, 81.5446714168206, 5.572132074046488, 7.147742722100942, 22.832727464967693, 9.994815541945913, 52.972614734612264, 60.10914697193614, 70.31163869354376, 84.68145354243262, 106.50858479160718, 56.24042630184604, 10.95131332687161, 31.205839628818065, 27.760052520028232, 11.826590150629048, 10.304067711313598, 10.461761891809234, 9.651197803746395, 27.243433702546525, 25.18949451106912, 5.688481563913891, 41.30650833158451, 37.490964126109645, 17.007927689532412, 16.992739957648926, 82.19271628493924, 13.664051957210015, 57.08977631122008, 56.79862189303643, 14.046586873215881, 26.614738968283593, 39.40517785339584, 7.925755638415095, 97.30443725242962, 49.49514175342056, 48.00162460895908, 44.13556866424448, 8.919726985714354, 10.653630621861707, 19.19202556886405, 92.38339457134447, 21.84744491358193, 7.583889390155773, 6.631698273477332, 50.593935717719496, 73.17610349593625, 62.12668886551231, 32.026069044201776, 7.3895623735131215, 41.312235942936326, 5.447226977731393, 7.184707053505483, 50.409244959859876, 98.50754847080253, 8.88523868161163, 136.44318666351182, 46.23994826602826, 76.67121604271013, 37.31221227099809, 46.54720940170638, 38.28074198495992, 158.7360654776128, 26.16927090369958, 127.38079498777742, 8.656764509772191, 57.31563188205357, 43.084266854261486, 41.94936748492635, 18.869773280965923, 14.62804224829878, 24.643184900662646, 99.81132413692951, 45.63811389936757, 100.20994295365864, 53.071200841535926, 8.592075523314882, 112.4263083541243, 55.779979264050354, 75.49436090099024, 16.12062306672916, 17.14413718729791, 10.205050181231115, 52.7138298282063, 10.302427227212231, 37.82320735694315, 38.96431735347823, 5.688189632141488, 100.29867433776519, 15.571532465851039, 6.996476935004705, 53.24311465816339, 11.357390731864317, 116.12615277750105, 20.314909300865384, 5.474661844271683, 5.500761641798024, 54.48443210644228])
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);
([7963592.982204803, 7963613.806308329, 7963741.104124834, 7964744.680983919, 7964839.0625, 7967965.625, 7968004.6875, 8871534.099239687, 8873423.4375, 8979244.579073904, 9017137.263243465, 9018636.369102158, 9019164.282828864, 9019315.625, 9019846.875, 9020017.1875, 9021961.25884052, 9022045.212263798, 9022485.67290666, 9034270.002746161, 9066013.990138689, 9066026.28926968, 9066443.75, 9066962.878863458, 9067003.90823891, 9067244.43478072, 9067583.719711049, 9067628.769276852, 9067636.17822293, 9067661.95926901, 9067818.75, 9067823.4375, 9067849.448779108, 9067850.612629965, 9067870.71049345, 9067921.875, 9067948.317182789, 9068015.77050576, 9068092.1875, 9068096.474391127, 9068312.709967967, 9068405.540916104, 9068483.937865177, 9068490.625, 9068535.81304273, 9068565.40614541, 9068635.530090764, 9068637.030432781, 9068652.60765284, 9068672.611330105, 9068713.697294086, 9068718.75, 9068724.573610028, 9068728.125, 9068746.727793239, 9068751.023194402, 9068768.911481744, 9068787.5, 9068796.638047418, 9068845.654679539, 9068953.125, 9068963.744013736, 9068963.869187467, 9068988.118115164, 9069000.881695097, 9069011.171570987, 9069050.874987295, 9069096.473207438, 9069145.3125, 9069181.204104489, 9069326.5625, 9069421.563314188, 9069422.941742068, 9069475.0, 9069554.855608761, 9069693.335699935, 9069765.625, 9069937.220984543, 9070123.400187528, 9070381.25, 9070556.014834497, 10144567.1875, 10299055.773301495, 10342265.625, 10343067.670245446, 10355512.11842291, 10357128.125, 10393161.861029685, 10400006.25, 10400025.0, 10402627.648256913, 10408268.952776767, 10409759.375, 10411534.942384958, 10412179.060071757, 10414334.375, 10415054.413537351, 10416193.001842257, 10416304.6875, 10416561.560823966, 10416761.537642589, 10417279.6875, 10417662.18335909, 10417885.9375, 10420315.619455034, 10422593.75, 10423431.378397385, 10423654.6875, 10425475.524682034, 10425970.293885378, 10426173.390644401, 10427557.8125, 10443728.125, 10452999.008831691, 10453614.750294406, 10453624.604567643, 10454304.500624644, 10454581.20231837, 10454705.647432934, 10455626.5625, 10455699.806645755, 10456949.381212695, 10456988.82394953, 10457466.706541572, 10457609.352634994, 10457773.4375, 10457799.974396572, 10457928.686383994, 10458011.82967639, 10458323.816045541, 10458581.131909428, 10458603.400768375, 10458745.867958596, 10458920.468511289, 10458927.624965757, 10460612.261853812, 10460852.984716477, 10461158.619875861, 10461705.716521336, 10461865.321585562, 10462076.113002947, 10462853.125, 10463420.3125, 10463964.99662347, 10463971.788099406, 10464007.8125, 10464010.48632321, 10464135.9375, 10464230.852931835, 10464456.47223508, 10464647.14864606, 10464660.436193453, 10464685.411735581, 10465149.106616022, 10465167.1875, 10465258.714637661, 10465472.834041178, 10465957.722338147, 10466025.063575061, 10466076.5625, 10466088.2629128, 10466117.85103026, 10466389.906992069, 10466957.8125, 10467081.25, 10467308.149863273, 10468106.338226255, 10468152.616173755, 10475071.875, 10475438.989614183, 10477610.497038728, 11126055.661481392, 11197219.231078403, 11282321.372359717, 11283454.6875, 11283463.821637612, 11285057.666158594, 11296967.113672473, 11300712.5, 11300797.59931536, 11305640.378780058, 11310453.055866769, 11313898.221147379, 11317634.375, 11318895.3125, 11319967.908327123, 11320468.323614638, 11321190.625, 11321766.893069964, 11321973.415963707, 11321991.78802468, 11322350.0, 11322358.854233148, 11323110.784568055, 11323277.110165393, 11323972.31251413, 11324774.319154778, 11326306.763743456, 11333840.940571748, 11335120.3125, 11349284.044612015, 11349616.575191539, 11354440.120126676, 11355585.086727422, 11356248.935158845, 11358351.5625, 11358546.704702662, 11358760.9375, 11358848.892208278, 11361017.720748225, 11367022.953937488, 11368717.982338864, 11370841.647825057, 11371250.133878132, 11373799.930271162, 11374494.66496029, 11376168.75, 11376866.361529706, 11379176.700937103, 11389687.5, 11392041.41926688, 11392569.737311034, 11396660.454690026, 11423685.417948134, 11423704.163289882, 11423720.087277567, 11436869.524380893, 11437101.776986022, 11437151.2935962, 11437525.853979174, 11437691.479143698, 11437814.490936754, 11437861.792631958, 11437937.5, 11437969.14175659, 11438017.1875, 11438073.440127524, 11438167.68404711, 11438439.0625, 11438875.68930296, 11439096.464136537, 11439406.40512044, 11440487.071141219, 11440650.0, 11441163.955913164, 11441909.375, 11443554.40495292, 11443704.114207337, 11443993.75, 11444644.661183016, 11445005.7017424, 11445681.25, 11445899.967640879, 11446167.1875, 11446200.598798158, 11446220.3125, 11446305.152404064, 11446312.50939064, 11446475.0, 11446512.384993266, 11446549.182075595, 11446568.75, 11446583.830543434, 11446620.942619605, 11446693.567180589, 11446714.633562578, 11446872.110032672, 11446903.125, 11446915.770135196, 11446921.159330318, 11446973.119032143, 11447023.799211182, 11447075.195452847, 11447122.583317088, 11447128.125, 11447332.8125, 11447340.625, 11447353.125, 11447375.941917026, 11447396.107201766, 11447451.5625, 11447511.57342388, 11447552.58380527, 11447584.375, 11447587.995641561, 11447589.0625, 11447597.266490655, 11448010.940019105, 11448494.330329701, 11448506.25, 11710816.61874608, 11713549.04538004, 11714401.5625, 11714435.734435465, 11730343.384231346, 11746267.966708465, 11780426.661580306, 11780926.18706503, 13724996.00509938, 13726846.875, 13754921.00949832, 13762601.5625, 13768062.997230932, 13771275.016532991, 13792214.0625, 13801031.134139651, 13801468.75, 13802711.512941476, 13803081.655404417, 13804774.400335073, 13804782.340129334, 13804983.167949324, 13805951.325504327, 13806529.218389781, 13806795.021445438, 13807598.231705148, 13808215.625, 13810050.453737855, 13810701.190622294, 13810865.625, 13810901.181443278, 13811126.590936054, 13811216.87558172, 13811326.306067297, 13811336.757785909, 13811652.89747758, 13811796.124090934, 13811936.937831666, 13811946.875, 13811960.172369123, 13812028.125, 13812752.594399177, 13812987.173939781, 13815941.421098094, 13816365.625, 13816631.599312708, 13816821.821186103, 13816996.176864345, 13818092.762535386, 13818379.65963208, 13819000.0, 13820051.138324806, 13820441.555373793, 13820615.850039897, 13821312.156815426, 13821586.172790162, 13821769.881510034, 13823648.4375, 13824035.358088024, 13825214.798555456, 14485867.1875, 14492500.0, 14493129.352886913, 14493379.6875, 14494601.5625, 14495985.329818103, 14496827.993364064, 14499025.0, 14499255.327548087, 14499323.4375, 14499393.75, 14499560.9375, 14499574.189555805, 14499712.415253263, 14499741.274360621, 14500417.1875, 14501259.375, 14501491.101854064, 14502004.6875, 14502267.723730767, 14502681.661145387, 14503335.9375, 14503648.4375, 14504225.27840076, 14504289.541002782, 14504335.254409593, 14504979.61410399, 14505591.586475471, 14505749.94087443, 14506058.513708333, 14506966.89173253, 14507631.25, 14507682.968524897, 14508537.002239123, 14510028.598871375, 14510091.506644001, 14510374.70021433, 14510558.748183133, 14511642.484538352, 14512138.378102923, 14512420.312002828], [7.347295560992391, 8.155591270436783, 17.14759624562754, 72.26426494792628, 61.30982443356447, 73.15955584332555, 31.426467459892173, 13.985217846958248, 60.25522909604897, 6.941138359453439, 53.84954882794964, 16.888608231585444, 18.52726504203989, 108.19741875946764, 30.007770563026895, 58.99675095252624, 7.208564416545151, 5.528235458137968, 34.03952251792684, 7.494919634693362, 43.32423586232473, 13.99320692205159, 94.23408409242194, 16.61318337177656, 46.567122665600095, 63.46961163376803, 26.630647820986567, 12.310080183756735, 114.17905894931286, 10.37605447606832, 38.91923002415414, 132.0142137861193, 106.93151843395, 12.2424687457759, 7.753820234774451, 225.93984648895673, 72.26686645665053, 11.363022139100178, 54.32072205350184, 110.28335480446333, 6.520517093329958, 8.796088458112024, 8.068192910603603, 82.56203029515017, 67.01626452575262, 24.845722176236784, 24.013161543465255, 8.963594086036899, 6.203975541281992, 43.71966684146794, 5.091335485179955, 89.33617787977832, 13.5322713431884, 90.99449938274194, 8.210236361271964, 21.109766530418046, 15.594924636635021, 68.29605613943774, 30.352630705329926, 150.44965106662235, 67.34037883394168, 9.075881099088145, 148.41041113428514, 17.970339905636298, 104.22581264889115, 110.80733855600128, 19.806450701468695, 13.603308668607676, 56.173366387703076, 27.648175600958005, 48.144632025911136, 48.64428994871422, 97.14290772032307, 37.86589986144454, 14.580931605634847, 18.10344982827344, 110.2069081365405, 37.118274534810624, 27.807328673746596, 34.08517540325323, 24.615814519425978, 55.052865179246695, 21.728737564741152, 104.3823225847459, 52.321574649176, 13.662517858038614, 42.324511620461074, 20.210439226765107, 77.17155528745522, 29.40706199290491, 5.1914437443063575, 11.460176375435598, 71.51678402233152, 45.72572512876208, 12.99009243762336, 37.8485436275223, 13.990893057038198, 7.926957327383294, 39.81040805373851, 18.003232332306066, 8.631667903308546, 74.92853880335427, 120.05457196638575, 86.20931096226532, 40.902101914314756, 56.49279276817975, 15.454576412217357, 40.88350289257361, 66.8030943623321, 57.477657359167196, 114.28709451742031, 29.23198252467918, 67.56612975068279, 48.75494613730183, 25.393089809063127, 22.546482036819476, 83.38071336818504, 27.615326996413067, 48.297387766265686, 32.83403711377177, 18.463935111748974, 20.38468841335033, 14.02151099626284, 28.848725193655888, 22.63999815362437, 92.45847410203007, 37.56060491969693, 17.622086017787872, 7.961289327994554, 23.34422665121206, 6.252392881612734, 6.117253994137737, 26.420655609540837, 15.571474244693093, 21.492758651371155, 14.368408444385253, 97.5193981388888, 57.66810475958583, 21.16550948654626, 23.707224710847516, 13.466523105021716, 33.2439817140666, 102.21937185416573, 12.987686458136931, 10.994539036099772, 30.77745012369718, 29.36388867621468, 32.294928651847066, 7.465672348949046, 11.493799706964625, 34.21785876806908, 120.85836008693933, 13.256032913427322, 74.18628378441886, 118.47483975271113, 20.029835787065124, 10.29949228129394, 14.608641124266986, 9.385744294273525, 76.1396540853285, 10.072153766327338, 18.064147044946672, 5.879224521891801, 34.167834546445356, 29.033705968144336, 11.69941851323578, 83.0979611402375, 10.415754918518978, 67.97311680124773, 27.161473011960716, 60.49295596803614, 10.317550861159818, 25.323596362254015, 13.318820731892234, 42.49652466029068, 9.135719085118124, 19.61994033582354, 44.7051774914401, 54.59074412752957, 104.84091382356314, 83.41455558504823, 22.66749045932176, 30.61242889492475, 101.36236827695845, 30.277509697670673, 40.76034981391404, 27.996148997847584, 99.57682367572568, 6.441906417168382, 63.967049184374915, 5.905355753691943, 41.89091967616774, 8.926738726307262, 10.89679211957779, 17.54052691728345, 24.92665643658602, 85.75283904570789, 17.34309105196871, 11.65959732352815, 35.14447136152484, 44.53890959910781, 25.667339317709473, 10.420710072680322, 18.586718422726726, 24.16785511619703, 81.95005417670303, 43.952980053352064, 54.038927160448516, 6.136696708230347, 5.854518551084587, 17.40889489419827, 19.182613606122974, 17.28012185893428, 9.447229649756078, 93.33563340517841, 20.137594821323564, 54.970656869938686, 112.59796498970071, 11.351214321048074, 70.7983636810983, 8.756573242026638, 23.69959427430532, 6.039290200107718, 21.30025227357076, 8.027544292923556, 8.170961834218716, 26.675947344364506, 117.02245887727913, 24.15624909478717, 7.944359191617698, 7.944431774528463, 27.294496151281688, 83.65709015972743, 44.84278616130845, 7.228386576124179, 58.03780737368473, 5.706925250488892, 5.483490295776018, 41.355077771385695, 11.725437748932773, 5.155902030696243, 6.104380305427115, 7.455157644653359, 34.82397801532626, 9.242875297124835, 98.08227445136555, 23.976268279113167, 6.654207249285541, 92.59124041653834, 115.202922022989, 13.19579478641726, 63.882610623079145, 11.077501329700738, 30.024714164298683, 16.535068958063132, 83.25275171496577, 17.068982550114313, 23.4334698218483, 31.776166732202416, 55.19814277519515, 7.896731880642961, 146.92551860271152, 22.74190979161343, 51.37764136175477, 56.8176871007872, 9.865942368246678, 5.960138310825025, 56.46050325496443, 27.155409974126748, 5.317982143430457, 23.517672357440407, 11.744426545027236, 87.5781478065177, 12.450497837943889, 29.378048164472002, 66.70755620954817, 115.48547609473877, 74.39883348113257, 12.39789334642025, 8.756861216235293, 62.98540500768753, 79.16371263466968, 60.56795846498426, 81.51759871455934, 7.7929108763924475, 63.242893712296464, 7.228311200906827, 11.131646609312396, 6.582080905307526, 50.5215164536163, 13.141608529087472, 17.906166397094232, 70.67031062509756, 54.45026724969145, 81.5446714168206, 5.572132074046488, 7.147742722100942, 22.832727464967693, 9.994815541945913, 52.972614734612264, 60.10914697193614, 70.31163869354376, 84.68145354243262, 106.50858479160718, 56.24042630184604, 10.95131332687161, 31.205839628818065, 27.760052520028232, 11.826590150629048, 10.304067711313598, 10.461761891809234, 9.651197803746395, 27.243433702546525, 25.18949451106912, 5.688481563913891, 41.30650833158451, 37.490964126109645, 17.007927689532412, 16.992739957648926, 82.19271628493924, 13.664051957210015, 57.08977631122008, 56.79862189303643, 14.046586873215881, 26.614738968283593, 39.40517785339584, 7.925755638415095, 97.30443725242962, 49.49514175342056, 48.00162460895908, 44.13556866424448, 8.919726985714354, 10.653630621861707, 19.19202556886405, 92.38339457134447, 21.84744491358193, 7.583889390155773, 6.631698273477332, 50.593935717719496, 73.17610349593625, 62.12668886551231, 32.026069044201776, 7.3895623735131215, 41.312235942936326, 5.447226977731393, 7.184707053505483, 50.409244959859876, 98.50754847080253, 8.88523868161163, 136.44318666351182, 46.23994826602826, 76.67121604271013, 37.31221227099809, 46.54720940170638, 38.28074198495992, 158.7360654776128, 26.16927090369958, 127.38079498777742, 8.656764509772191, 57.31563188205357, 43.084266854261486, 41.94936748492635, 18.869773280965923, 14.62804224829878, 24.643184900662646, 99.81132413692951, 45.63811389936757, 100.20994295365864, 53.071200841535926, 8.592075523314882, 112.4263083541243, 55.779979264050354, 75.49436090099024, 16.12062306672916, 17.14413718729791, 10.205050181231115, 52.7138298282063, 10.302427227212231, 37.82320735694315, 38.96431735347823, 5.688189632141488, 100.29867433776519, 15.571532465851039, 6.996476935004705, 53.24311465816339, 11.357390731864317, 116.12615277750105, 20.314909300865384, 5.474661844271683, 5.500761641798024, 54.48443210644228])
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)