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 = 48317
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);
([5266789.014087882, 5448956.153261248, 5484162.3418673165, 5484183.685830499, 5489210.256918538, 5503534.375, 5525691.56261229, 5526190.625, 5527055.65140665, 5527245.3125, 5550333.917621741, 5552603.521413353, 5553030.3165905215, 5557518.520371938, 5557687.009862233, 5560217.1875, 5596015.625, 5628848.381594032, 5640529.380847271, 5654511.896530242, 5678610.037516226, 5704266.109438104, 5719521.89974543, 5721673.8226904655, 5736281.25, 5740809.375, 5753371.150567055, 5756161.966602288, 5760133.018818939, 5761110.685967798, 5768763.42232761, 5771170.3125, 5780064.0625, 5780498.0725906985, 5780959.436830491, 5786331.25, 5788817.1875, 5791862.910408598, 5813751.482633051, 5834353.125, 5835935.9375, 5843460.764696717, 5909576.438824628, 5914464.302737573, 5916114.0625, 5950689.0625, 5950695.1774283135, 5957054.657770772, 5983733.41900022, 5983739.54688278, 6004774.24864852, 6010756.892374878, 6010867.639046273, 6012853.125, 6026764.0625, 6044312.01663398, 6065788.093964422, 6070319.116984184, 6131380.221063606, 6133794.758387903, 6135221.713620765, 6149783.840409783, 6169573.170465548, 6171838.191370404, 6216807.622797789, 6217935.479507339, 6218076.5625, 6218106.169146603, 6224499.604410871, 6271298.976168944, 6285321.585836169, 6291272.609178579, 6291685.597482758, 6292202.88196074, 6292527.294766786, 6293224.439845326, 6293409.375, 6293730.863021276, 6293883.179137281, 6294109.357372113, 6294559.4427738115, 6294808.741217569, 6295120.3125, 6296908.13021343, 6301913.901592804, 6302444.9682591725, 6302869.955148142, 6309506.895703204, 6317099.92044155, 6317976.5625, 6318888.672939357, 6319690.625, 6320312.026673444, 6324882.081197648, 6332878.629920198, 6333087.5, 6333250.877742199, 6334694.63018432, 6344578.125, 6348152.844323023, 6403653.125, 6404630.855347248, 6408853.051563735, 6417489.0625, 6418275.935439896, 6419718.618696684, 6419743.355014712, 6420223.9259701865, 6421707.276080382, 6422307.8125, 6422367.491943501, 6422469.045973724, 6422551.411605952, 6423370.721377611, 6423373.4375, 6423638.583286863, 6423648.659761524, 6423681.25, 6423698.4375, 6423714.422833077, 6424000.0, 6424044.260325279, 6424393.745864749, 6426107.50321702, 6426228.177658515, 6426230.743221894, 6426325.068389491, 6426548.4375, 6426603.338279849, 6428197.625005339, 6429296.778120006, 6430579.532490978, 6431351.5625, 6434498.302195158, 6434500.0, 6435916.566926649, 6435941.369490112, 6436136.356212855, 6437771.847426072, 6437980.757588168, 6438276.921558462, 6438436.513113643, 6439518.441302235, 6439523.4375, 6439643.358543117, 6440521.058220567, 6443365.454042256, 6446970.3125, 6530817.373146222, 6878859.009053316, 6909023.891275455, 7172494.68692277, 7234214.148588954, 7319931.25, 7733073.396332201, 8129424.747450505, 8358940.628394746, 8451622.025111642, 8767132.724807745, 8790168.4422312, 8792180.291919244, 8815056.25, 9022864.0625, 9023342.1875, 9055993.15512806, 9068395.3125, 9127025.0, 9127035.141798347, 9145954.799774261, 9173321.875, 9218070.075649139, 9285337.188752875, 9337688.631470287, 9401107.8125, 9405203.125, 9429397.38854377, 9448478.920874892, 9533502.585521499, 9537040.642678699, 9544623.735704737, 9581633.560224557, 9608601.380569838, 9608912.697401352, 9712496.63186929, 9724494.628501628, 9760960.734743215, 9763287.5, 9770526.763380902, 9795450.283583337, 9795559.121797277, 9820052.556632474, 9820056.25, 9820685.911023667, 9821307.8125, 9821324.245517248, 9831687.729605298, 9832188.356543085, 9864834.911272345, 9877769.27534916, 9891242.1875, 10075936.90027107, 10079926.5625, 10085789.916942466, 10094162.5, 10094259.885159725, 10094622.436109744, 10095945.3125, 10097386.056198062, 10101320.3125, 10102107.880065046, 10140326.5625, 10151574.689553944, 10151595.266288137, 10152698.468391428, 10154173.4375, 10154300.0, 10154828.705746574, 10155259.146545755, 10155262.5, 10155942.16466799, 10156348.37956718, 10201557.8125, 10458881.25, 10463695.404235687, 10470575.0, 10482912.5, 10493462.259243578, 10799038.400558757, 10831807.094254367, 10835028.716907118, 10846923.539481357, 11275976.335130256, 11654299.36840706, 11657095.3125, 11658210.152899781, 11661242.070770957, 11668551.5625, 11668598.222314259, 11673023.656622084, 11682830.419090087, 11694461.821811428, 11733054.677970737, 11873745.3125, 11892197.921830079, 11940831.226311527, 11989603.125, 12061749.272235595, 12064123.517059604, 12064299.905726004, 12066133.766603567, 12066973.22217428, 12083742.892073765, 12091142.27303791, 12177831.859864146, 12181652.41669274, 12376542.1875, 12393917.385134228, 12441834.562957287, 12710404.93476159, 12767194.27754448, 14233520.30394699, 16986193.75, 16988707.521314975, 17147875.0, 17363898.00417803, 20032564.454234783, 21344543.75, 22120392.634701014, 22229097.984788418, 22239224.594407246, 22239682.697635345, 22241406.25, 22244624.93582797, 22248282.64625287, 22248434.677119527, 22248591.324825004, 22248602.339190714, 22248642.21685922, 22248762.5, 22248801.172915462, 22248971.905960992, 22248993.849844966, 22249243.23339428, 22249279.636725966, 22249687.36400135, 22249699.319252342, 22249769.481027476, 22249786.7684294, 22250054.2356645, 22250275.0, 22250279.43047896, 22250375.645214837, 22250385.56196367, 22250443.957801912, 22250468.54927446, 22250522.21151433, 22250645.04457735, 22250747.18887743, 22251085.9375, 22251099.453008972, 22251477.009155884, 22251743.75, 22251940.130421046, 22251990.27019044, 22252015.851073366, 22252190.06198709, 22252314.0625, 22252403.580418717, 22252510.351886597, 22252540.625, 22252729.53806448, 22252934.346265014, 22253319.10765546, 22253464.0625, 22253655.106681045, 22254314.0625, 22254385.9375, 22254388.188690737, 22254440.7778163, 22254634.643754266, 22254946.875, 22256604.6875, 22257901.389563054, 22258556.25, 22258801.83846751, 22258870.201766305, 22259331.25, 22259773.38200325, 22259943.731512215, 22260119.60159792, 22261136.07411456, 22261640.625, 22264371.350207414, 22265221.58132488, 22265290.625, 22266635.625620503, 22266799.992340636, 22266821.590608675, 22266897.457320422, 22268109.593601543, 22270467.278072186, 22271154.6875, 22271851.038482517, 22272115.101409562, 22272328.597544223, 22272363.074548304, 22272527.602215808, 22272785.9375, 22272840.666427948, 22272991.59892829, 22273278.125, 22273712.5, 22273864.0625, 22274270.934714366, 22274278.395805832, 22274815.625, 22274817.472473655, 22275748.382433143, 22275976.5625, 22276923.416181266, 22277162.816060483, 22277670.47201032, 22278246.875, 22278341.199588213, 22278812.82680032, 22279206.41195431, 22279480.393891737, 22279502.430393852, 22280183.712646987, 22280487.18976547, 22281712.426630795], [65.60210745862963, 101.99886128229679, 45.918954807073845, 6.951354349203493, 48.77312017814985, 48.246701521813904, 20.331618766975627, 61.80518853266804, 72.20139260842262, 57.64138966108309, 21.929079185536224, 32.20012517709793, 5.310923163033023, 14.1330005247094, 66.32733226832637, 84.8118915503473, 65.08125490877438, 72.57710182853111, 86.0559369641302, 10.299479101509197, 60.27910790054756, 8.560522214192469, 18.79534887149217, 5.73171908049003, 48.11107948897411, 70.7518175532158, 19.51269205896042, 13.235498868745545, 11.466273594148653, 62.96858368071828, 10.255575564605188, 70.04625032063791, 59.01891868659276, 22.955574346052515, 71.01287183654807, 46.195032855291316, 59.7931480738499, 16.77645410072583, 8.244789142911998, 110.13194951962045, 85.24839326223778, 53.153806098009326, 14.490178263829279, 19.853827302758738, 53.43507072544453, 87.63995504802739, 14.450514926957329, 27.949761963716988, 12.229505292510613, 17.176909023904862, 8.76777959730104, 6.592735453463248, 5.736111167269817, 63.18747136074856, 85.58715803945688, 29.464572865112007, 17.81987933973671, 11.75424647063641, 174.00095981904212, 115.3676068793689, 93.42904269666273, 27.175917607773005, 8.150238894239592, 37.78514529465638, 25.269887653980188, 8.972008041155084, 61.59889763932184, 33.70915606958395, 102.04047714137135, 6.574983105182073, 111.44419897997058, 18.742922100623435, 13.786650963779067, 70.44032223320471, 78.55415999097768, 42.22930336765772, 73.48728844420184, 33.872990471640534, 16.55104995137045, 106.00784070306517, 8.322745400325617, 33.7540077683213, 55.29575878903956, 127.71494590924706, 7.546058907079507, 10.629137445847952, 60.266324831447804, 6.352377238335556, 91.38276706093265, 56.81258718282811, 6.2192036191911315, 132.32046513477022, 29.925609889766122, 19.459261759051767, 17.292700881769626, 73.0381669600677, 12.847002216919993, 64.05496339382476, 92.97766303422587, 22.085133576897483, 86.4176417375846, 9.018599398367423, 109.7376715837552, 59.47524097388899, 6.025230798702103, 14.463595897166236, 11.954544647490486, 22.154462305703348, 6.201723813186121, 92.53878236842945, 11.639427581189468, 9.594865760644259, 25.862538921165534, 53.191888922119446, 29.688795023841653, 5.3804648064389875, 37.92857010158283, 29.999882711620472, 54.794579549092745, 28.834339286399306, 124.29671871658789, 9.80371385595244, 46.68024438091187, 81.04586548309977, 9.376329393749675, 8.936749917862969, 15.208746686812889, 52.81846297282135, 12.210522952325796, 17.99755393455174, 89.08047288175011, 25.798112204766454, 32.48053904710384, 26.11016250364257, 128.68531269253725, 13.007524430096964, 25.51128495143491, 7.762040581633715, 11.084878779548793, 149.11549541812252, 11.739496200025041, 17.707754772980646, 15.472810831481858, 72.17463415362104, 59.76518112099241, 287.1534734655212, 17.058871803063443, 62.55773143891466, 8.387252185030214, 22.94339443667149, 70.19567438302145, 50.5698891146519, 59.905521079615035, 82.44339506770586, 27.735572329755286, 30.568444111199824, 6.764184492346492, 35.8186944643824, 39.631100745606375, 23.65201067130899, 12.225114017171968, 72.92870580912975, 31.93318954259314, 34.72517991534966, 102.22725226944613, 75.38696162316492, 41.519338017652906, 30.7347044124607, 6.50483641802556, 52.65118989417044, 103.29429407456622, 9.081398378053724, 7.454442188715465, 34.28813249706228, 49.574515462069954, 50.450260975399566, 8.757638228771624, 13.21920869256267, 16.41625807205511, 25.28395496902956, 21.609332775273437, 25.385949202805, 25.344130173306436, 6.715919092528845, 12.848866758816714, 25.077795027099935, 53.26150094085243, 77.3070760556651, 55.9971577794999, 9.126105473524758, 16.706404683791593, 33.10412734249854, 5.812023837676233, 63.990478220446406, 19.281708552442502, 15.03456837047682, 19.65829006060525, 9.83012577784107, 45.29163685373797, 56.649392688710826, 110.51053027191988, 36.43699270410829, 7.944563588965666, 70.50126424065155, 12.03120462610463, 17.620445691216744, 47.845472729249416, 15.414091488164967, 212.4946246040046, 9.389194212573965, 31.27234575477868, 13.877007074601861, 27.642350799395196, 11.9972395302267, 40.958893734705796, 69.90897430971496, 7.282965465214394, 30.731763317325786, 72.59147099010572, 9.312171751505293, 27.428572794579217, 136.10527689087195, 74.76509063311319, 18.296965587056444, 50.04565025826464, 58.54496215936877, 24.538190355696457, 27.265410372757707, 19.561141228986507, 28.141826856039962, 5.821564745966944, 10.789986352391397, 12.979535794999515, 77.49832458089273, 7.342141379092521, 23.138914976216604, 81.7367632862822, 30.35221751201479, 72.52569093709027, 43.677551062984634, 60.47937519435261, 11.11284454937459, 82.4028403492098, 19.01496732108883, 14.851982272082621, 65.10070176094764, 47.54528587984994, 109.74572631809596, 17.821574458041567, 20.47589777962111, 61.39386413166481, 13.529308871595287, 15.277880842199727, 12.306655944885424, 17.294324102748153, 44.66588805087277, 39.5150483464181, 22.39925523800142, 15.975875763246181, 5.6439114085382, 59.046959664901856, 29.172838635051455, 42.702513823502166, 61.37557676803678, 42.11004825044533, 50.44582402935548, 34.52619109645911, 50.012309478783145, 13.457451000446024, 63.78303747208258, 93.73422472993954, 80.15385241743377, 33.977586043291936, 25.624109964871657, 96.46820702556586, 169.64813810523785, 6.616150414313822, 5.463028082008713, 54.46481415935528, 5.5928489286996985, 15.06084613719313, 86.93006014368322, 18.170243399152458, 86.03793250795748, 47.67363180060592, 72.76466555882564, 5.494042942060244, 10.149004275101454, 21.9874097485219, 34.46946072512272, 24.315714547344495, 69.25009154503988, 9.032845534262364, 13.858069905976953, 83.24554820573104, 5.549638623268174, 9.114688314205674, 77.64871171260515, 32.53886563239064, 32.32322624434038, 7.244031591214742, 69.98253120306686, 72.65323083050724, 23.07499408810476, 5.4071875066882935, 20.88672905970734, 90.40604684291107, 17.017080881866537, 44.516096320187984, 38.008704134582864, 7.082715952806618, 64.12830951726882, 16.505803582627557, 72.62352318526231, 7.762226790771411, 67.07854693859016, 38.10838947081736, 12.406941415259968, 11.375275903776977, 23.808038477153474, 40.25474671582772, 63.354372811544955, 14.3209266777864, 85.04650296876883, 7.195935211846284, 111.69127598889885, 51.05071073649662, 52.6699140740584, 28.164115469902974, 5.57588979216413, 15.489107139594376, 42.16004975958706, 14.961679992384962, 23.83187085038817, 40.34453482953765, 13.87258729425716, 104.73951455104708, 13.958062505624039, 33.46232348020942, 15.845759807542825, 126.02460675865132, 70.68947313044109, 45.70153453737221, 10.39731851809578, 17.111097699151397, 17.70130271993654, 20.531846560589592, 67.69225715715659, 40.70129465400121, 10.317486483808565, 72.83222752510942, 43.28861961697633, 82.32543092526426, 121.2970270210581, 80.4135333798155, 29.548165090513645, 67.48520422290896, 27.480481915176632, 124.76338830917908, 81.17790996173991, 20.304907445591144, 78.46697307854811, 88.44027305982621, 7.825174800005466, 7.725872841572434, 15.596954988915465, 18.550092353342187, 19.749131880870497, 12.902355910395466, 155.08302533264984, 44.40702947611301])
caption, xmean,count, xle, Etot = energy_spectrum(E_tot)
hist_file(E_hist, xmean, count, caption);
([5266789.014087882, 5448956.153261248, 5484162.3418673165, 5484183.685830499, 5489210.256918538, 5503534.375, 5525691.56261229, 5526190.625, 5527055.65140665, 5527245.3125, 5550333.917621741, 5552603.521413353, 5553030.3165905215, 5557518.520371938, 5557687.009862233, 5560217.1875, 5596015.625, 5628848.381594032, 5640529.380847271, 5654511.896530242, 5678610.037516226, 5704266.109438104, 5719521.89974543, 5721673.8226904655, 5736281.25, 5740809.375, 5753371.150567055, 5756161.966602288, 5760133.018818939, 5761110.685967798, 5768763.42232761, 5771170.3125, 5780064.0625, 5780498.0725906985, 5780959.436830491, 5786331.25, 5788817.1875, 5791862.910408598, 5813751.482633051, 5834353.125, 5835935.9375, 5843460.764696717, 5909576.438824628, 5914464.302737573, 5916114.0625, 5950689.0625, 5950695.1774283135, 5957054.657770772, 5983733.41900022, 5983739.54688278, 6004774.24864852, 6010756.892374878, 6010867.639046273, 6012853.125, 6026764.0625, 6044312.01663398, 6065788.093964422, 6070319.116984184, 6131380.221063606, 6133794.758387903, 6135221.713620765, 6149783.840409783, 6169573.170465548, 6171838.191370404, 6216807.622797789, 6217935.479507339, 6218076.5625, 6218106.169146603, 6224499.604410871, 6271298.976168944, 6285321.585836169, 6291272.609178579, 6291685.597482758, 6292202.88196074, 6292527.294766786, 6293224.439845326, 6293409.375, 6293730.863021276, 6293883.179137281, 6294109.357372113, 6294559.4427738115, 6294808.741217569, 6295120.3125, 6296908.13021343, 6301913.901592804, 6302444.9682591725, 6302869.955148142, 6309506.895703204, 6317099.92044155, 6317976.5625, 6318888.672939357, 6319690.625, 6320312.026673444, 6324882.081197648, 6332878.629920198, 6333087.5, 6333250.877742199, 6334694.63018432, 6344578.125, 6348152.844323023, 6403653.125, 6404630.855347248, 6408853.051563735, 6417489.0625, 6418275.935439896, 6419718.618696684, 6419743.355014712, 6420223.9259701865, 6421707.276080382, 6422307.8125, 6422367.491943501, 6422469.045973724, 6422551.411605952, 6423370.721377611, 6423373.4375, 6423638.583286863, 6423648.659761524, 6423681.25, 6423698.4375, 6423714.422833077, 6424000.0, 6424044.260325279, 6424393.745864749, 6426107.50321702, 6426228.177658515, 6426230.743221894, 6426325.068389491, 6426548.4375, 6426603.338279849, 6428197.625005339, 6429296.778120006, 6430579.532490978, 6431351.5625, 6434498.302195158, 6434500.0, 6435916.566926649, 6435941.369490112, 6436136.356212855, 6437771.847426072, 6437980.757588168, 6438276.921558462, 6438436.513113643, 6439518.441302235, 6439523.4375, 6439643.358543117, 6440521.058220567, 6443365.454042256, 6446970.3125, 6530817.373146222, 6878859.009053316, 6909023.891275455, 7172494.68692277, 7234214.148588954, 7319931.25, 7733073.396332201, 8129424.747450505, 8358940.628394746, 8451622.025111642, 8767132.724807745, 8790168.4422312, 8792180.291919244, 8815056.25, 9022864.0625, 9023342.1875, 9055993.15512806, 9068395.3125, 9127025.0, 9127035.141798347, 9145954.799774261, 9173321.875, 9218070.075649139, 9285337.188752875, 9337688.631470287, 9401107.8125, 9405203.125, 9429397.38854377, 9448478.920874892, 9533502.585521499, 9537040.642678699, 9544623.735704737, 9581633.560224557, 9608601.380569838, 9608912.697401352, 9712496.63186929, 9724494.628501628, 9760960.734743215, 9763287.5, 9770526.763380902, 9795450.283583337, 9795559.121797277, 9820052.556632474, 9820056.25, 9820685.911023667, 9821307.8125, 9821324.245517248, 9831687.729605298, 9832188.356543085, 9864834.911272345, 9877769.27534916, 9891242.1875, 10075936.90027107, 10079926.5625, 10085789.916942466, 10094162.5, 10094259.885159725, 10094622.436109744, 10095945.3125, 10097386.056198062, 10101320.3125, 10102107.880065046, 10140326.5625, 10151574.689553944, 10151595.266288137, 10152698.468391428, 10154173.4375, 10154300.0, 10154828.705746574, 10155259.146545755, 10155262.5, 10155942.16466799, 10156348.37956718, 10201557.8125, 10458881.25, 10463695.404235687, 10470575.0, 10482912.5, 10493462.259243578, 10799038.400558757, 10831807.094254367, 10835028.716907118, 10846923.539481357, 11275976.335130256, 11654299.36840706, 11657095.3125, 11658210.152899781, 11661242.070770957, 11668551.5625, 11668598.222314259, 11673023.656622084, 11682830.419090087, 11694461.821811428, 11733054.677970737, 11873745.3125, 11892197.921830079, 11940831.226311527, 11989603.125, 12061749.272235595, 12064123.517059604, 12064299.905726004, 12066133.766603567, 12066973.22217428, 12083742.892073765, 12091142.27303791, 12177831.859864146, 12181652.41669274, 12376542.1875, 12393917.385134228, 12441834.562957287, 12710404.93476159, 12767194.27754448, 14233520.30394699, 16986193.75, 16988707.521314975, 17147875.0, 17363898.00417803, 20032564.454234783, 21344543.75, 22120392.634701014, 22229097.984788418, 22239224.594407246, 22239682.697635345, 22241406.25, 22244624.93582797, 22248282.64625287, 22248434.677119527, 22248591.324825004, 22248602.339190714, 22248642.21685922, 22248762.5, 22248801.172915462, 22248971.905960992, 22248993.849844966, 22249243.23339428, 22249279.636725966, 22249687.36400135, 22249699.319252342, 22249769.481027476, 22249786.7684294, 22250054.2356645, 22250275.0, 22250279.43047896, 22250375.645214837, 22250385.56196367, 22250443.957801912, 22250468.54927446, 22250522.21151433, 22250645.04457735, 22250747.18887743, 22251085.9375, 22251099.453008972, 22251477.009155884, 22251743.75, 22251940.130421046, 22251990.27019044, 22252015.851073366, 22252190.06198709, 22252314.0625, 22252403.580418717, 22252510.351886597, 22252540.625, 22252729.53806448, 22252934.346265014, 22253319.10765546, 22253464.0625, 22253655.106681045, 22254314.0625, 22254385.9375, 22254388.188690737, 22254440.7778163, 22254634.643754266, 22254946.875, 22256604.6875, 22257901.389563054, 22258556.25, 22258801.83846751, 22258870.201766305, 22259331.25, 22259773.38200325, 22259943.731512215, 22260119.60159792, 22261136.07411456, 22261640.625, 22264371.350207414, 22265221.58132488, 22265290.625, 22266635.625620503, 22266799.992340636, 22266821.590608675, 22266897.457320422, 22268109.593601543, 22270467.278072186, 22271154.6875, 22271851.038482517, 22272115.101409562, 22272328.597544223, 22272363.074548304, 22272527.602215808, 22272785.9375, 22272840.666427948, 22272991.59892829, 22273278.125, 22273712.5, 22273864.0625, 22274270.934714366, 22274278.395805832, 22274815.625, 22274817.472473655, 22275748.382433143, 22275976.5625, 22276923.416181266, 22277162.816060483, 22277670.47201032, 22278246.875, 22278341.199588213, 22278812.82680032, 22279206.41195431, 22279480.393891737, 22279502.430393852, 22280183.712646987, 22280487.18976547, 22281712.426630795], [65.60210745862963, 101.99886128229679, 45.918954807073845, 6.951354349203493, 48.77312017814985, 48.246701521813904, 20.331618766975627, 61.80518853266804, 72.20139260842262, 57.64138966108309, 21.929079185536224, 32.20012517709793, 5.310923163033023, 14.1330005247094, 66.32733226832637, 84.8118915503473, 65.08125490877438, 72.57710182853111, 86.0559369641302, 10.299479101509197, 60.27910790054756, 8.560522214192469, 18.79534887149217, 5.73171908049003, 48.11107948897411, 70.7518175532158, 19.51269205896042, 13.235498868745545, 11.466273594148653, 62.96858368071828, 10.255575564605188, 70.04625032063791, 59.01891868659276, 22.955574346052515, 71.01287183654807, 46.195032855291316, 59.7931480738499, 16.77645410072583, 8.244789142911998, 110.13194951962045, 85.24839326223778, 53.153806098009326, 14.490178263829279, 19.853827302758738, 53.43507072544453, 87.63995504802739, 14.450514926957329, 27.949761963716988, 12.229505292510613, 17.176909023904862, 8.76777959730104, 6.592735453463248, 5.736111167269817, 63.18747136074856, 85.58715803945688, 29.464572865112007, 17.81987933973671, 11.75424647063641, 174.00095981904212, 115.3676068793689, 93.42904269666273, 27.175917607773005, 8.150238894239592, 37.78514529465638, 25.269887653980188, 8.972008041155084, 61.59889763932184, 33.70915606958395, 102.04047714137135, 6.574983105182073, 111.44419897997058, 18.742922100623435, 13.786650963779067, 70.44032223320471, 78.55415999097768, 42.22930336765772, 73.48728844420184, 33.872990471640534, 16.55104995137045, 106.00784070306517, 8.322745400325617, 33.7540077683213, 55.29575878903956, 127.71494590924706, 7.546058907079507, 10.629137445847952, 60.266324831447804, 6.352377238335556, 91.38276706093265, 56.81258718282811, 6.2192036191911315, 132.32046513477022, 29.925609889766122, 19.459261759051767, 17.292700881769626, 73.0381669600677, 12.847002216919993, 64.05496339382476, 92.97766303422587, 22.085133576897483, 86.4176417375846, 9.018599398367423, 109.7376715837552, 59.47524097388899, 6.025230798702103, 14.463595897166236, 11.954544647490486, 22.154462305703348, 6.201723813186121, 92.53878236842945, 11.639427581189468, 9.594865760644259, 25.862538921165534, 53.191888922119446, 29.688795023841653, 5.3804648064389875, 37.92857010158283, 29.999882711620472, 54.794579549092745, 28.834339286399306, 124.29671871658789, 9.80371385595244, 46.68024438091187, 81.04586548309977, 9.376329393749675, 8.936749917862969, 15.208746686812889, 52.81846297282135, 12.210522952325796, 17.99755393455174, 89.08047288175011, 25.798112204766454, 32.48053904710384, 26.11016250364257, 128.68531269253725, 13.007524430096964, 25.51128495143491, 7.762040581633715, 11.084878779548793, 149.11549541812252, 11.739496200025041, 17.707754772980646, 15.472810831481858, 72.17463415362104, 59.76518112099241, 287.1534734655212, 17.058871803063443, 62.55773143891466, 8.387252185030214, 22.94339443667149, 70.19567438302145, 50.5698891146519, 59.905521079615035, 82.44339506770586, 27.735572329755286, 30.568444111199824, 6.764184492346492, 35.8186944643824, 39.631100745606375, 23.65201067130899, 12.225114017171968, 72.92870580912975, 31.93318954259314, 34.72517991534966, 102.22725226944613, 75.38696162316492, 41.519338017652906, 30.7347044124607, 6.50483641802556, 52.65118989417044, 103.29429407456622, 9.081398378053724, 7.454442188715465, 34.28813249706228, 49.574515462069954, 50.450260975399566, 8.757638228771624, 13.21920869256267, 16.41625807205511, 25.28395496902956, 21.609332775273437, 25.385949202805, 25.344130173306436, 6.715919092528845, 12.848866758816714, 25.077795027099935, 53.26150094085243, 77.3070760556651, 55.9971577794999, 9.126105473524758, 16.706404683791593, 33.10412734249854, 5.812023837676233, 63.990478220446406, 19.281708552442502, 15.03456837047682, 19.65829006060525, 9.83012577784107, 45.29163685373797, 56.649392688710826, 110.51053027191988, 36.43699270410829, 7.944563588965666, 70.50126424065155, 12.03120462610463, 17.620445691216744, 47.845472729249416, 15.414091488164967, 212.4946246040046, 9.389194212573965, 31.27234575477868, 13.877007074601861, 27.642350799395196, 11.9972395302267, 40.958893734705796, 69.90897430971496, 7.282965465214394, 30.731763317325786, 72.59147099010572, 9.312171751505293, 27.428572794579217, 136.10527689087195, 74.76509063311319, 18.296965587056444, 50.04565025826464, 58.54496215936877, 24.538190355696457, 27.265410372757707, 19.561141228986507, 28.141826856039962, 5.821564745966944, 10.789986352391397, 12.979535794999515, 77.49832458089273, 7.342141379092521, 23.138914976216604, 81.7367632862822, 30.35221751201479, 72.52569093709027, 43.677551062984634, 60.47937519435261, 11.11284454937459, 82.4028403492098, 19.01496732108883, 14.851982272082621, 65.10070176094764, 47.54528587984994, 109.74572631809596, 17.821574458041567, 20.47589777962111, 61.39386413166481, 13.529308871595287, 15.277880842199727, 12.306655944885424, 17.294324102748153, 44.66588805087277, 39.5150483464181, 22.39925523800142, 15.975875763246181, 5.6439114085382, 59.046959664901856, 29.172838635051455, 42.702513823502166, 61.37557676803678, 42.11004825044533, 50.44582402935548, 34.52619109645911, 50.012309478783145, 13.457451000446024, 63.78303747208258, 93.73422472993954, 80.15385241743377, 33.977586043291936, 25.624109964871657, 96.46820702556586, 169.64813810523785, 6.616150414313822, 5.463028082008713, 54.46481415935528, 5.5928489286996985, 15.06084613719313, 86.93006014368322, 18.170243399152458, 86.03793250795748, 47.67363180060592, 72.76466555882564, 5.494042942060244, 10.149004275101454, 21.9874097485219, 34.46946072512272, 24.315714547344495, 69.25009154503988, 9.032845534262364, 13.858069905976953, 83.24554820573104, 5.549638623268174, 9.114688314205674, 77.64871171260515, 32.53886563239064, 32.32322624434038, 7.244031591214742, 69.98253120306686, 72.65323083050724, 23.07499408810476, 5.4071875066882935, 20.88672905970734, 90.40604684291107, 17.017080881866537, 44.516096320187984, 38.008704134582864, 7.082715952806618, 64.12830951726882, 16.505803582627557, 72.62352318526231, 7.762226790771411, 67.07854693859016, 38.10838947081736, 12.406941415259968, 11.375275903776977, 23.808038477153474, 40.25474671582772, 63.354372811544955, 14.3209266777864, 85.04650296876883, 7.195935211846284, 111.69127598889885, 51.05071073649662, 52.6699140740584, 28.164115469902974, 5.57588979216413, 15.489107139594376, 42.16004975958706, 14.961679992384962, 23.83187085038817, 40.34453482953765, 13.87258729425716, 104.73951455104708, 13.958062505624039, 33.46232348020942, 15.845759807542825, 126.02460675865132, 70.68947313044109, 45.70153453737221, 10.39731851809578, 17.111097699151397, 17.70130271993654, 20.531846560589592, 67.69225715715659, 40.70129465400121, 10.317486483808565, 72.83222752510942, 43.28861961697633, 82.32543092526426, 121.2970270210581, 80.4135333798155, 29.548165090513645, 67.48520422290896, 27.480481915176632, 124.76338830917908, 81.17790996173991, 20.304907445591144, 78.46697307854811, 88.44027305982621, 7.825174800005466, 7.725872841572434, 15.596954988915465, 18.550092353342187, 19.749131880870497, 12.902355910395466, 155.08302533264984, 44.40702947611301])
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);
([5266789.014087882, 5448956.153261248, 5484162.3418673165, 5484183.685830499, 5489210.256918538, 5503534.375, 5525691.56261229, 5526190.625, 5527055.65140665, 5527245.3125, 5550333.917621741, 5552603.521413353, 5553030.3165905215, 5557518.520371938, 5557687.009862233, 5560217.1875, 5596015.625, 5628848.381594032, 5640529.380847271, 5654511.896530242, 5678610.037516226, 5704266.109438104, 5719521.89974543, 5721673.8226904655, 5736281.25, 5740809.375, 5753371.150567055, 5756161.966602288, 5760133.018818939, 5761110.685967798, 5768763.42232761, 5771170.3125, 5780064.0625, 5780498.0725906985, 5780959.436830491, 5786331.25, 5788817.1875, 5791862.910408598, 5813751.482633051, 5834353.125, 5835935.9375, 5843460.764696717, 5909576.438824628, 5914464.302737573, 5916114.0625, 5950689.0625, 5950695.1774283135, 5957054.657770772, 5983733.41900022, 5983739.54688278, 6004774.24864852, 6010756.892374878, 6010867.639046273, 6012853.125, 6026764.0625, 6044312.01663398, 6065788.093964422, 6070319.116984184, 6131380.221063606, 6133794.758387903, 6135221.713620765, 6149783.840409783, 6169573.170465548, 6171838.191370404, 6216807.622797789, 6217935.479507339, 6218076.5625, 6218106.169146603, 6224499.604410871, 6271298.976168944, 6285321.585836169, 6291272.609178579, 6291685.597482758, 6292202.88196074, 6292527.294766786, 6293224.439845326, 6293409.375, 6293730.863021276, 6293883.179137281, 6294109.357372113, 6294559.4427738115, 6294808.741217569, 6295120.3125, 6296908.13021343, 6301913.901592804, 6302444.9682591725, 6302869.955148142, 6309506.895703204, 6317099.92044155, 6317976.5625, 6318888.672939357, 6319690.625, 6320312.026673444, 6324882.081197648, 6332878.629920198, 6333087.5, 6333250.877742199, 6334694.63018432, 6344578.125, 6348152.844323023, 6403653.125, 6404630.855347248, 6408853.051563735, 6417489.0625, 6418275.935439896, 6419718.618696684, 6419743.355014712, 6420223.9259701865, 6421707.276080382, 6422307.8125, 6422367.491943501, 6422469.045973724, 6422551.411605952, 6423370.721377611, 6423373.4375, 6423638.583286863, 6423648.659761524, 6423681.25, 6423698.4375, 6423714.422833077, 6424000.0, 6424044.260325279, 6424393.745864749, 6426107.50321702, 6426228.177658515, 6426230.743221894, 6426325.068389491, 6426548.4375, 6426603.338279849, 6428197.625005339, 6429296.778120006, 6430579.532490978, 6431351.5625, 6434498.302195158, 6434500.0, 6435916.566926649, 6435941.369490112, 6436136.356212855, 6437771.847426072, 6437980.757588168, 6438276.921558462, 6438436.513113643, 6439518.441302235, 6439523.4375, 6439643.358543117, 6440521.058220567, 6443365.454042256, 6446970.3125, 6530817.373146222, 6878859.009053316, 6909023.891275455, 7172494.68692277, 7234214.148588954, 7319931.25, 7733073.396332201, 8129424.747450505, 8358940.628394746, 8451622.025111642, 8767132.724807745, 8790168.4422312, 8792180.291919244, 8815056.25, 9022864.0625, 9023342.1875, 9055993.15512806, 9068395.3125, 9127025.0, 9127035.141798347, 9145954.799774261, 9173321.875, 9218070.075649139, 9285337.188752875, 9337688.631470287, 9401107.8125, 9405203.125, 9429397.38854377, 9448478.920874892, 9533502.585521499, 9537040.642678699, 9544623.735704737, 9581633.560224557, 9608601.380569838, 9608912.697401352, 9712496.63186929, 9724494.628501628, 9760960.734743215, 9763287.5, 9770526.763380902, 9795450.283583337, 9795559.121797277, 9820052.556632474, 9820056.25, 9820685.911023667, 9821307.8125, 9821324.245517248, 9831687.729605298, 9832188.356543085, 9864834.911272345, 9877769.27534916, 9891242.1875, 10075936.90027107, 10079926.5625, 10085789.916942466, 10094162.5, 10094259.885159725, 10094622.436109744, 10095945.3125, 10097386.056198062, 10101320.3125, 10102107.880065046, 10140326.5625, 10151574.689553944, 10151595.266288137, 10152698.468391428, 10154173.4375, 10154300.0, 10154828.705746574, 10155259.146545755, 10155262.5, 10155942.16466799, 10156348.37956718, 10201557.8125, 10458881.25, 10463695.404235687, 10470575.0, 10482912.5, 10493462.259243578, 10799038.400558757, 10831807.094254367, 10835028.716907118, 10846923.539481357, 11275976.335130256, 11654299.36840706, 11657095.3125, 11658210.152899781, 11661242.070770957, 11668551.5625, 11668598.222314259, 11673023.656622084, 11682830.419090087, 11694461.821811428, 11733054.677970737, 11873745.3125, 11892197.921830079, 11940831.226311527, 11989603.125, 12061749.272235595, 12064123.517059604, 12064299.905726004, 12066133.766603567, 12066973.22217428, 12083742.892073765, 12091142.27303791, 12177831.859864146, 12181652.41669274, 12376542.1875, 12393917.385134228, 12441834.562957287, 12710404.93476159, 12767194.27754448, 14233520.30394699, 16986193.75, 16988707.521314975, 17147875.0, 17363898.00417803, 20032564.454234783, 21344543.75, 22120392.634701014, 22229097.984788418, 22239224.594407246, 22239682.697635345, 22241406.25, 22244624.93582797, 22248282.64625287, 22248434.677119527, 22248591.324825004, 22248602.339190714, 22248642.21685922, 22248762.5, 22248801.172915462, 22248971.905960992, 22248993.849844966, 22249243.23339428, 22249279.636725966, 22249687.36400135, 22249699.319252342, 22249769.481027476, 22249786.7684294, 22250054.2356645, 22250275.0, 22250279.43047896, 22250375.645214837, 22250385.56196367, 22250443.957801912, 22250468.54927446, 22250522.21151433, 22250645.04457735, 22250747.18887743, 22251085.9375, 22251099.453008972, 22251477.009155884, 22251743.75, 22251940.130421046, 22251990.27019044, 22252015.851073366, 22252190.06198709, 22252314.0625, 22252403.580418717, 22252510.351886597, 22252540.625, 22252729.53806448, 22252934.346265014, 22253319.10765546, 22253464.0625, 22253655.106681045, 22254314.0625, 22254385.9375, 22254388.188690737, 22254440.7778163, 22254634.643754266, 22254946.875, 22256604.6875, 22257901.389563054, 22258556.25, 22258801.83846751, 22258870.201766305, 22259331.25, 22259773.38200325, 22259943.731512215, 22260119.60159792, 22261136.07411456, 22261640.625, 22264371.350207414, 22265221.58132488, 22265290.625, 22266635.625620503, 22266799.992340636, 22266821.590608675, 22266897.457320422, 22268109.593601543, 22270467.278072186, 22271154.6875, 22271851.038482517, 22272115.101409562, 22272328.597544223, 22272363.074548304, 22272527.602215808, 22272785.9375, 22272840.666427948, 22272991.59892829, 22273278.125, 22273712.5, 22273864.0625, 22274270.934714366, 22274278.395805832, 22274815.625, 22274817.472473655, 22275748.382433143, 22275976.5625, 22276923.416181266, 22277162.816060483, 22277670.47201032, 22278246.875, 22278341.199588213, 22278812.82680032, 22279206.41195431, 22279480.393891737, 22279502.430393852, 22280183.712646987, 22280487.18976547, 22281712.426630795], [65.60210745862963, 101.99886128229679, 45.918954807073845, 6.951354349203493, 48.77312017814985, 48.246701521813904, 20.331618766975627, 61.80518853266804, 72.20139260842262, 57.64138966108309, 21.929079185536224, 32.20012517709793, 5.310923163033023, 14.1330005247094, 66.32733226832637, 84.8118915503473, 65.08125490877438, 72.57710182853111, 86.0559369641302, 10.299479101509197, 60.27910790054756, 8.560522214192469, 18.79534887149217, 5.73171908049003, 48.11107948897411, 70.7518175532158, 19.51269205896042, 13.235498868745545, 11.466273594148653, 62.96858368071828, 10.255575564605188, 70.04625032063791, 59.01891868659276, 22.955574346052515, 71.01287183654807, 46.195032855291316, 59.7931480738499, 16.77645410072583, 8.244789142911998, 110.13194951962045, 85.24839326223778, 53.153806098009326, 14.490178263829279, 19.853827302758738, 53.43507072544453, 87.63995504802739, 14.450514926957329, 27.949761963716988, 12.229505292510613, 17.176909023904862, 8.76777959730104, 6.592735453463248, 5.736111167269817, 63.18747136074856, 85.58715803945688, 29.464572865112007, 17.81987933973671, 11.75424647063641, 174.00095981904212, 115.3676068793689, 93.42904269666273, 27.175917607773005, 8.150238894239592, 37.78514529465638, 25.269887653980188, 8.972008041155084, 61.59889763932184, 33.70915606958395, 102.04047714137135, 6.574983105182073, 111.44419897997058, 18.742922100623435, 13.786650963779067, 70.44032223320471, 78.55415999097768, 42.22930336765772, 73.48728844420184, 33.872990471640534, 16.55104995137045, 106.00784070306517, 8.322745400325617, 33.7540077683213, 55.29575878903956, 127.71494590924706, 7.546058907079507, 10.629137445847952, 60.266324831447804, 6.352377238335556, 91.38276706093265, 56.81258718282811, 6.2192036191911315, 132.32046513477022, 29.925609889766122, 19.459261759051767, 17.292700881769626, 73.0381669600677, 12.847002216919993, 64.05496339382476, 92.97766303422587, 22.085133576897483, 86.4176417375846, 9.018599398367423, 109.7376715837552, 59.47524097388899, 6.025230798702103, 14.463595897166236, 11.954544647490486, 22.154462305703348, 6.201723813186121, 92.53878236842945, 11.639427581189468, 9.594865760644259, 25.862538921165534, 53.191888922119446, 29.688795023841653, 5.3804648064389875, 37.92857010158283, 29.999882711620472, 54.794579549092745, 28.834339286399306, 124.29671871658789, 9.80371385595244, 46.68024438091187, 81.04586548309977, 9.376329393749675, 8.936749917862969, 15.208746686812889, 52.81846297282135, 12.210522952325796, 17.99755393455174, 89.08047288175011, 25.798112204766454, 32.48053904710384, 26.11016250364257, 128.68531269253725, 13.007524430096964, 25.51128495143491, 7.762040581633715, 11.084878779548793, 149.11549541812252, 11.739496200025041, 17.707754772980646, 15.472810831481858, 72.17463415362104, 59.76518112099241, 287.1534734655212, 17.058871803063443, 62.55773143891466, 8.387252185030214, 22.94339443667149, 70.19567438302145, 50.5698891146519, 59.905521079615035, 82.44339506770586, 27.735572329755286, 30.568444111199824, 6.764184492346492, 35.8186944643824, 39.631100745606375, 23.65201067130899, 12.225114017171968, 72.92870580912975, 31.93318954259314, 34.72517991534966, 102.22725226944613, 75.38696162316492, 41.519338017652906, 30.7347044124607, 6.50483641802556, 52.65118989417044, 103.29429407456622, 9.081398378053724, 7.454442188715465, 34.28813249706228, 49.574515462069954, 50.450260975399566, 8.757638228771624, 13.21920869256267, 16.41625807205511, 25.28395496902956, 21.609332775273437, 25.385949202805, 25.344130173306436, 6.715919092528845, 12.848866758816714, 25.077795027099935, 53.26150094085243, 77.3070760556651, 55.9971577794999, 9.126105473524758, 16.706404683791593, 33.10412734249854, 5.812023837676233, 63.990478220446406, 19.281708552442502, 15.03456837047682, 19.65829006060525, 9.83012577784107, 45.29163685373797, 56.649392688710826, 110.51053027191988, 36.43699270410829, 7.944563588965666, 70.50126424065155, 12.03120462610463, 17.620445691216744, 47.845472729249416, 15.414091488164967, 212.4946246040046, 9.389194212573965, 31.27234575477868, 13.877007074601861, 27.642350799395196, 11.9972395302267, 40.958893734705796, 69.90897430971496, 7.282965465214394, 30.731763317325786, 72.59147099010572, 9.312171751505293, 27.428572794579217, 136.10527689087195, 74.76509063311319, 18.296965587056444, 50.04565025826464, 58.54496215936877, 24.538190355696457, 27.265410372757707, 19.561141228986507, 28.141826856039962, 5.821564745966944, 10.789986352391397, 12.979535794999515, 77.49832458089273, 7.342141379092521, 23.138914976216604, 81.7367632862822, 30.35221751201479, 72.52569093709027, 43.677551062984634, 60.47937519435261, 11.11284454937459, 82.4028403492098, 19.01496732108883, 14.851982272082621, 65.10070176094764, 47.54528587984994, 109.74572631809596, 17.821574458041567, 20.47589777962111, 61.39386413166481, 13.529308871595287, 15.277880842199727, 12.306655944885424, 17.294324102748153, 44.66588805087277, 39.5150483464181, 22.39925523800142, 15.975875763246181, 5.6439114085382, 59.046959664901856, 29.172838635051455, 42.702513823502166, 61.37557676803678, 42.11004825044533, 50.44582402935548, 34.52619109645911, 50.012309478783145, 13.457451000446024, 63.78303747208258, 93.73422472993954, 80.15385241743377, 33.977586043291936, 25.624109964871657, 96.46820702556586, 169.64813810523785, 6.616150414313822, 5.463028082008713, 54.46481415935528, 5.5928489286996985, 15.06084613719313, 86.93006014368322, 18.170243399152458, 86.03793250795748, 47.67363180060592, 72.76466555882564, 5.494042942060244, 10.149004275101454, 21.9874097485219, 34.46946072512272, 24.315714547344495, 69.25009154503988, 9.032845534262364, 13.858069905976953, 83.24554820573104, 5.549638623268174, 9.114688314205674, 77.64871171260515, 32.53886563239064, 32.32322624434038, 7.244031591214742, 69.98253120306686, 72.65323083050724, 23.07499408810476, 5.4071875066882935, 20.88672905970734, 90.40604684291107, 17.017080881866537, 44.516096320187984, 38.008704134582864, 7.082715952806618, 64.12830951726882, 16.505803582627557, 72.62352318526231, 7.762226790771411, 67.07854693859016, 38.10838947081736, 12.406941415259968, 11.375275903776977, 23.808038477153474, 40.25474671582772, 63.354372811544955, 14.3209266777864, 85.04650296876883, 7.195935211846284, 111.69127598889885, 51.05071073649662, 52.6699140740584, 28.164115469902974, 5.57588979216413, 15.489107139594376, 42.16004975958706, 14.961679992384962, 23.83187085038817, 40.34453482953765, 13.87258729425716, 104.73951455104708, 13.958062505624039, 33.46232348020942, 15.845759807542825, 126.02460675865132, 70.68947313044109, 45.70153453737221, 10.39731851809578, 17.111097699151397, 17.70130271993654, 20.531846560589592, 67.69225715715659, 40.70129465400121, 10.317486483808565, 72.83222752510942, 43.28861961697633, 82.32543092526426, 121.2970270210581, 80.4135333798155, 29.548165090513645, 67.48520422290896, 27.480481915176632, 124.76338830917908, 81.17790996173991, 20.304907445591144, 78.46697307854811, 88.44027305982621, 7.825174800005466, 7.725872841572434, 15.596954988915465, 18.550092353342187, 19.749131880870497, 12.902355910395466, 155.08302533264984, 44.40702947611301])
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)