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 = 44873
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);
([3423825.655310054, 3512851.1143960883, 3527057.476294607, 3583197.378958128, 3600982.86702648, 3614034.688258421, 3634150.7031151126, 3636792.1875, 3670043.525482561, 3678028.4523541396, 3678566.7866861103, 3684021.5444763736, 3686006.25, 3686414.0625, 3687095.034471114, 3688067.1875, 3688211.285229547, 3691164.2325459532, 3691609.481038228, 3694076.892633016, 3702533.841776207, 3705078.715853206, 3711835.9375, 3712630.012503944, 3727654.409209532, 3729115.354709888, 3732573.8621922275, 3736979.3822929906, 3743883.965953902, 3744453.0216147723, 3745115.103877556, 3746633.5476669134, 3747062.5, 3749484.8831387283, 3750998.4375, 3751474.3287783368, 3752625.0, 3754248.832588277, 3754686.505656803, 3754710.9375, 3754884.1027644803, 3758374.5457126116, 3758460.6371448277, 3758782.7407498606, 3761767.228676372, 3764495.3125, 3764599.3145108675, 3764885.9375, 3765265.0236755544, 3772713.530029902, 3778699.5765744657, 3780468.1575722033, 3781613.5485951877, 3786684.2355330517, 3787121.831340723, 3789385.6346798907, 3790564.0625, 3790990.625, 3791124.1645057974, 3792467.344042467, 3793363.1817105217, 3793573.4375, 3794610.4568687235, 3795125.7537642294, 3795541.8875696915, 3795789.0625, 3796446.825613263, 3796554.7091617202, 3796732.8125, 3796748.749070825, 3798045.3125, 3798313.7213675794, 3798315.982262534, 3798332.6469614627, 3798701.943239229, 3798835.9375, 3799010.849424219, 3799985.5561041366, 3800796.2670630235, 3801395.579874372, 3801814.0600414993, 3802182.8125, 3802558.343881909, 3802650.406281269, 3802661.293485566, 3803054.443052386, 3804602.784140184, 3806716.0382159953, 3809090.331536898, 3809972.60901094, 3810400.0, 3828962.4354232266, 3840132.8125, 3840143.3926450475, 3844248.370259514, 3844258.355007207, 3844564.8921270375, 3845526.2939996975, 3890805.7968615047, 3906926.5625, 3909917.95844806, 3915763.1329258312, 3915763.728178944, 3917285.934274924, 3919457.8125, 3919987.9591986854, 3926840.625, 3931893.000115567, 3936278.7390425247, 3938307.9096708163, 3945445.127450414, 3950817.3787396597, 3954690.3251717906, 3955137.092837586, 3955808.1922438205, 3957461.9016231704, 3971762.898816198, 3974838.257239361, 3976015.6213044724, 3976503.09930122, 3978996.875, 3980735.441824747, 3982032.520673065, 3990449.845570513, 4000390.0594365196, 4002464.884739965, 4016381.8226408097, 4021150.9597207364, 4034493.75, 4037464.0625, 4045270.5996735874, 4053418.7073021806, 4058096.2344469232, 4058400.0, 4060175.1815510294, 4065612.6857527588, 4104141.056538072, 4106124.158136826, 4121878.2967566755, 4163621.456194461, 4188391.79352852, 4204246.535771122, 4215433.934728599, 4222932.724220274, 4227536.861759891, 4240198.4375, 4252348.664790546, 4259617.446267676, 4263553.233132185, 4269550.0, 4274256.038277505, 4277759.375, 4277766.319878077, 4323015.894818865, 4336153.925916908, 4363376.5625, 4367465.264958749, 4375785.600447624, 4376979.497155065, 4378240.625, 4405606.6885017315, 4410303.9940784145, 4414482.8125, 4415022.574633227, 4438498.712085107, 4440223.185105941, 4445252.0070839515, 4449064.538397403, 4449686.813351891, 4453962.5, 4456498.764212057, 4459215.625, 4463892.705372154, 4474084.375, 4475395.066801042, 4488548.183973759, 4491659.612177804, 4493809.397660404, 4497325.956285946, 4500139.257224315, 4500467.1875, 4508919.451821708, 4512400.973863796, 4512550.091132508, 4516912.459214389, 4516923.63541896, 4517337.848978416, 4521140.119071523, 4522519.956542673, 4534435.9375, 4534515.367955014, 4537859.375, 4546464.7047402095, 4547666.162473294, 4549035.700333285, 4549372.420303228, 4554468.665967163, 4555473.4375, 4562532.255588068, 4569282.8125, 4581453.569647008, 4598715.473536904, 4601162.31792589, 4603703.380645158, 4613590.342347251, 4616146.435752251, 4625865.625, 4627231.3180494895, 4628987.156694485, 4644034.9138133265, 4644412.96613629, 4652875.0, 4661169.544845721, 4680154.6875, 4689981.25, 4692982.431515479, 4698384.375, 4717362.309436961, 4717962.159597585, 4718020.217188574, 4726504.254056284, 4726781.22132105, 4738875.36348702, 4744597.198475061, 4744606.776859743, 4745035.38904725, 4745904.303902554, 4748390.510731576, 4755322.555886627, 4763438.317596745, 4772636.110696847, 4772639.978666936, 4774592.5254163155, 4778246.71505538, 4779912.5, 4789705.223628016, 4792888.00313262, 4794146.875, 4796917.145049452, 4802625.459030635, 4804321.159947123, 4807245.1320742415, 4818130.896063417, 4820485.656516178, 4827997.47378156, 4835545.229786261, 4835745.063706477, 4836798.278407797, 4881960.649958579, 4934434.5118074, 4966563.112221708, 4994446.524239504, 5028303.125, 5130896.875, 5245382.8125, 5263193.168134341, 5471055.620715022, 5476234.886638941, 5519891.778654542, 5545864.211225235, 5561587.078098944, 5561596.579311819, 5573359.974805254, 5575844.526701043, 5588050.802025781, 5594246.687552045, 5649084.3862531325, 5649196.879305982, 5670952.104054189, 5672170.67717337, 5673485.9375, 5675980.872784605, 5724268.75, 5724272.096491898, 5728621.660581145, 5730022.097836239, 5745676.0791058475, 5747029.6875, 5748331.0196372075, 5749341.527249295, 5752934.284792681, 5754099.559895784, 5755065.137325095, 5755754.03321823, 5755784.375, 5756140.10625721, 5805519.124535449, 5812006.25, 5816292.381580021, 5841674.832101965, 5842864.7594168605, 5845724.553930084, 5877616.065321439, 5877668.467643336, 5904968.75, 5980248.4375, 6002675.0, 6004864.971294179, 6013386.1580964, 6018016.728069781, 6018628.138685367, 6020190.080393176, 6024123.249933639, 6039708.801383523, 6069648.190160369, 6070021.365418659, 6070056.2219861355, 6076751.35448522, 6079059.375, 6098020.516809431, 6121317.736058394, 6122830.147849178, 6122880.177998705, 6123428.322193885, 6124456.640303077, 6125116.822729053, 6133571.976974285, 6168410.870983532, 6177733.288954712, 6192302.038069587, 6193319.30966479, 6194103.1799635235, 6213452.643732038, 6214162.5, 6216641.825306084, 6226482.8125, 6230528.125, 6232171.556094143, 6238838.182588835, 6243815.541665893, 6244131.071388671, 6248513.607571742, 6249429.53138275, 6249764.97785072, 6252656.25, 6259581.25, 6259621.018403893, 6273451.5625, 6274037.8043128615, 6275985.028206447, 6284629.133151643, 6287914.707294667, 6293584.375, 6296842.796603899, 6298698.8017650405, 6309953.125, 6313842.944602281, 6317795.487529804, 6323853.9440395525, 6332029.6875, 6343109.642942075, 6361317.1875, 6367528.521302312, 6371781.25, 6385321.5948171895, 6389331.51835623, 6390913.984041867, 6392614.0625, 6392808.850360084, 6397339.0625, 6397804.254974213, 6403712.173416758, 6413204.8434958095, 6413424.913906725, 6427720.911694804, 6431015.755409402, 6438390.183337927, 6463245.733982833, 6472155.014277106, 6474931.074228022, 6479182.645953152, 6481253.125, 6535053.439741934, 6567157.802873408, 6571510.436087029, 6629346.875, 6637946.875, 6637977.49127584, 6644238.830544936, 6644889.0625, 6668053.115674006, 6704310.9375, 6711617.674968107, 6717116.34997589, 6766366.299049632, 6793052.044334033, 6898516.753198051, 6929099.776423289, 6953068.607301505, 7061044.9278682005, 7601714.8542302055, 7634375.0, 7892059.142594023, 8035582.8180771675, 8472845.3125, 8475289.0625, 8481529.6875, 8487329.390825558, 8601751.80872755, 8615272.559574638, 8617925.0, 8618487.319475956, 8619640.957409255, 70162111.8395287], [34.30671143777756, 75.88011321557275, 6.435648692137478, 27.208421568597657, 5.343793583436032, 75.85694144233297, 52.75824448563484, 72.82253760726746, 10.794014818173526, 6.122815828788872, 7.464429772476207, 41.73447989441262, 34.741069456148466, 36.37434922383508, 5.387950564073266, 47.60052289427916, 16.456189628364395, 8.378595180691793, 36.79111154400632, 16.36922179486843, 13.235965669205292, 55.30499229191648, 94.77584470806181, 5.137509418181374, 5.387940761315623, 16.979972540998723, 16.85182006092991, 60.89741564662784, 83.50316644412062, 7.5662681664604, 39.01653145941831, 28.76293206323563, 59.89173555084089, 7.261754925905824, 40.02448439863733, 16.27482194415581, 67.42110759623027, 25.779190393316235, 74.51513476575138, 50.77859317958875, 36.55440663762877, 121.04018195300546, 29.252397050436883, 23.575543979468183, 15.100811982016324, 29.75823033893986, 25.311100920684712, 50.365481933133076, 15.434006722990949, 8.918396592142658, 10.524636978745733, 10.312815178048048, 7.427373049173378, 69.27912331327524, 47.29485645889519, 17.460861176339066, 58.95344695630381, 57.323853097061615, 71.42756338727645, 15.573746985078246, 27.699230933707817, 45.12077898972755, 45.948613883945214, 12.55318555192543, 104.87370610103872, 54.934947722268745, 7.585472478895447, 6.0903547454356, 75.06310389775368, 7.205835687681166, 65.86713493649658, 40.09330888116382, 41.13118294178043, 9.19524642766447, 5.731425439709875, 34.06404514288531, 10.992773940914443, 30.27341884342618, 20.47995475641779, 11.573034634702182, 28.476583380017725, 49.136579141679555, 16.667644477865448, 68.88318216273824, 16.497428337633398, 22.493396811357023, 22.638921271237518, 80.13342078455159, 13.929684672151026, 28.801175431779715, 57.04018322290224, 7.58004716636988, 54.89353575092628, 6.432494762567275, 14.691267658046133, 76.19120836970706, 6.625512733571885, 89.74411786632174, 61.36510723038269, 29.456219004917713, 10.081126614672668, 8.652263838404409, 7.486635337836353, 5.706552785745017, 51.07598161016228, 18.339461910477937, 85.00694740322223, 19.316597686066356, 12.245462128477273, 7.147231347022542, 67.8059719644545, 17.872801244161593, 23.752936295229993, 98.09174773225553, 16.61768178424524, 20.564835475183816, 23.773802542852472, 18.90697298981828, 28.45217778558543, 28.026170217123376, 66.60068135661776, 13.337906124279868, 98.08269398916971, 8.20656654618601, 32.456043454465124, 8.775173292876351, 19.394949351088098, 42.677031682928515, 97.97488541263787, 31.255123462586866, 15.554861247327768, 35.139372415383555, 7.386902500927166, 49.24890402264706, 35.798033999617346, 5.469796139768267, 16.888266048759593, 22.3948901976825, 15.639236189547479, 62.992192546997565, 22.62028057610663, 5.685503430490089, 7.4514001513646235, 5.163310692987906, 93.14718488077399, 47.66361566466132, 65.26635186470352, 6.52843510584056, 7.642821126914306, 74.00428101305731, 35.931759762693346, 58.800648801857406, 5.653678994074466, 40.810737184190366, 17.094560560348075, 61.03537969933106, 57.77586231094027, 47.242581221786935, 10.842672504017415, 59.99000226889895, 6.854325772884503, 28.31787305095535, 52.95288212586542, 18.857280979191813, 23.606144998980817, 9.126734276079315, 7.243438065997984, 89.4622615955839, 19.81346626193903, 60.739048648722864, 16.35245899903416, 78.10643367622079, 7.801935559045876, 36.83531039553483, 49.179993165055535, 79.20517903658089, 15.929761478237118, 6.270065597255406, 72.36569350943564, 15.739558627226264, 81.84528225388402, 12.43603079858798, 28.304606861322245, 61.704821742749374, 37.41886130955298, 7.676425291420145, 7.216312015561937, 11.697209334582443, 9.047526543278687, 61.75723936808699, 24.31539063594356, 28.55012201433061, 12.305694237041061, 5.260441260750034, 24.58796129769873, 17.526584453383645, 17.302739575944937, 37.40622025441331, 6.982367315597984, 90.10607609314872, 6.325059808148495, 25.85360649297262, 6.2444654577553935, 17.853420570378923, 33.3288402940022, 49.542051800431594, 31.530854671860556, 5.293193896779947, 13.776709124339336, 8.593661222393113, 119.6723197897362, 45.2536136799189, 7.347338855632768, 52.703360578273006, 51.09718040939989, 55.45692615494847, 98.77147413631474, 14.261729936162014, 47.23612153462966, 5.608792955025111, 17.681983655657568, 116.18361994689793, 6.545621675095246, 17.550011173591756, 12.064861781493457, 6.984375950737999, 5.682772150353772, 34.429582718175546, 18.37758535367823, 33.715630436503396, 52.07641493450476, 12.94237865039065, 111.15493974561379, 29.73571263204856, 69.07792569711276, 9.829978157197134, 26.29587747308446, 32.055822040249545, 47.67332943201697, 102.13362958012539, 12.367432618179013, 25.40856357537295, 78.99529720596908, 23.99672463955296, 8.630817091536315, 7.573593005738466, 8.159251884867027, 7.546692706217612, 13.948189538895594, 7.653479564757811, 165.22119479595085, 9.051438733061827, 54.117020195069735, 57.5828265524115, 89.88973462242465, 29.109764717863175, 33.4940677240196, 8.577035037706608, 13.582827918716298, 9.46040656595476, 56.122015666527346, 7.045834595011466, 7.835607802622805, 8.744972716891446, 19.488471122115662, 5.800239697381304, 11.969384369517723, 6.487766443010937, 7.271478350192475, 8.489320447282745, 93.90871983776465, 66.39518064822897, 50.346051097900435, 6.111439321197691, 13.80731690621051, 15.864801764990903, 23.74444043825508, 82.44439142938204, 7.521991504197008, 156.81616325520534, 26.85968785839911, 5.381911632653776, 21.616937076113736, 6.022603625301497, 51.800340735277686, 23.763948787329547, 11.768354635833488, 38.51734666782194, 15.73672008581854, 40.429950653845644, 7.876375259604067, 8.063980643550446, 74.1404721204852, 6.232171791291054, 47.447027646866474, 33.66127205246097, 113.28916606853197, 61.00130644810686, 11.490955888187548, 8.970961366093505, 80.66111271108439, 43.487404162578486, 25.30165499000142, 20.788879567149927, 30.637986610807403, 8.934740256568954, 7.114107084214529, 6.066731379134887, 106.58309825435849, 49.65493258943446, 92.74392262874578, 9.753551475992532, 26.640225156245904, 24.409311629245746, 35.993432941728344, 13.71232049222138, 7.640541192959431, 66.21014865566939, 5.215732893621101, 44.0697119279307, 26.722555329831636, 47.40434876558347, 76.23827915716085, 32.867379823815895, 22.987531311086133, 66.73810557948592, 106.83461122704762, 13.850981798385517, 5.221168149162378, 26.978476829271667, 34.36888474664616, 21.95481473924273, 90.24984395386973, 12.94033045388611, 47.20890439539954, 40.990156460313514, 6.603750076435335, 79.77926179770871, 7.717139970458368, 5.565645399836474, 13.179623093421933, 8.6597691680932, 53.697052461850305, 82.96984206334866, 16.539067008916582, 46.577881344848855, 12.56083042879766, 9.483919663341178, 44.865420716738996, 77.10640239135157, 16.07160706722774, 31.641920533235417, 47.27061763315605, 43.02812901980528, 116.07752929857406, 16.073540306082403, 27.06351035813456, 30.919361183750418, 44.20510712050128, 52.629654491459014, 10.512849263958664, 9.069725202042202, 5.295930302420025, 26.93064021043423, 23.661081991859948, 18.1139756119013, 31.2184821043149, 72.06251831326489, 16.352777305795055, 5.924243029661849, 25.619507957322597, 92.32885584286213, 152.36622226445073, 108.81383327470056, 46.18778233669684, 103.41989118696019, 72.42973172388122, 39.04916451551292, 10.783520782852912, 51.66216634186797, 80.4336071071133, 30.3595643776816, 17.194172093999335, 78.80307229768053, 23.724275783304794, 23.078284048677858, 33.857702360988775, 64.6140780932358, 25.992013131279556, 13.653522424471104, 19.15942927908738, 36.648200942461074, 24.654347994847672, 14.962809667396842, 64.14773826159285, 35.90712851542309, 39.103357069592775, 57.88116099155752, 9.548657933308418, 88.19778227872037, 46.48200744785012, 91.54739459098451, 5.301466777908692, 208.7705842034558])
caption, xmean,count, xle, Etot = energy_spectrum(E_tot)
hist_file(E_hist, xmean, count, caption);
([3423825.655310054, 3512851.1143960883, 3527057.476294607, 3583197.378958128, 3600982.86702648, 3614034.688258421, 3634150.7031151126, 3636792.1875, 3670043.525482561, 3678028.4523541396, 3678566.7866861103, 3684021.5444763736, 3686006.25, 3686414.0625, 3687095.034471114, 3688067.1875, 3688211.285229547, 3691164.2325459532, 3691609.481038228, 3694076.892633016, 3702533.841776207, 3705078.715853206, 3711835.9375, 3712630.012503944, 3727654.409209532, 3729115.354709888, 3732573.8621922275, 3736979.3822929906, 3743883.965953902, 3744453.0216147723, 3745115.103877556, 3746633.5476669134, 3747062.5, 3749484.8831387283, 3750998.4375, 3751474.3287783368, 3752625.0, 3754248.832588277, 3754686.505656803, 3754710.9375, 3754884.1027644803, 3758374.5457126116, 3758460.6371448277, 3758782.7407498606, 3761767.228676372, 3764495.3125, 3764599.3145108675, 3764885.9375, 3765265.0236755544, 3772713.530029902, 3778699.5765744657, 3780468.1575722033, 3781613.5485951877, 3786684.2355330517, 3787121.831340723, 3789385.6346798907, 3790564.0625, 3790990.625, 3791124.1645057974, 3792467.344042467, 3793363.1817105217, 3793573.4375, 3794610.4568687235, 3795125.7537642294, 3795541.8875696915, 3795789.0625, 3796446.825613263, 3796554.7091617202, 3796732.8125, 3796748.749070825, 3798045.3125, 3798313.7213675794, 3798315.982262534, 3798332.6469614627, 3798701.943239229, 3798835.9375, 3799010.849424219, 3799985.5561041366, 3800796.2670630235, 3801395.579874372, 3801814.0600414993, 3802182.8125, 3802558.343881909, 3802650.406281269, 3802661.293485566, 3803054.443052386, 3804602.784140184, 3806716.0382159953, 3809090.331536898, 3809972.60901094, 3810400.0, 3828962.4354232266, 3840132.8125, 3840143.3926450475, 3844248.370259514, 3844258.355007207, 3844564.8921270375, 3845526.2939996975, 3890805.7968615047, 3906926.5625, 3909917.95844806, 3915763.1329258312, 3915763.728178944, 3917285.934274924, 3919457.8125, 3919987.9591986854, 3926840.625, 3931893.000115567, 3936278.7390425247, 3938307.9096708163, 3945445.127450414, 3950817.3787396597, 3954690.3251717906, 3955137.092837586, 3955808.1922438205, 3957461.9016231704, 3971762.898816198, 3974838.257239361, 3976015.6213044724, 3976503.09930122, 3978996.875, 3980735.441824747, 3982032.520673065, 3990449.845570513, 4000390.0594365196, 4002464.884739965, 4016381.8226408097, 4021150.9597207364, 4034493.75, 4037464.0625, 4045270.5996735874, 4053418.7073021806, 4058096.2344469232, 4058400.0, 4060175.1815510294, 4065612.6857527588, 4104141.056538072, 4106124.158136826, 4121878.2967566755, 4163621.456194461, 4188391.79352852, 4204246.535771122, 4215433.934728599, 4222932.724220274, 4227536.861759891, 4240198.4375, 4252348.664790546, 4259617.446267676, 4263553.233132185, 4269550.0, 4274256.038277505, 4277759.375, 4277766.319878077, 4323015.894818865, 4336153.925916908, 4363376.5625, 4367465.264958749, 4375785.600447624, 4376979.497155065, 4378240.625, 4405606.6885017315, 4410303.9940784145, 4414482.8125, 4415022.574633227, 4438498.712085107, 4440223.185105941, 4445252.0070839515, 4449064.538397403, 4449686.813351891, 4453962.5, 4456498.764212057, 4459215.625, 4463892.705372154, 4474084.375, 4475395.066801042, 4488548.183973759, 4491659.612177804, 4493809.397660404, 4497325.956285946, 4500139.257224315, 4500467.1875, 4508919.451821708, 4512400.973863796, 4512550.091132508, 4516912.459214389, 4516923.63541896, 4517337.848978416, 4521140.119071523, 4522519.956542673, 4534435.9375, 4534515.367955014, 4537859.375, 4546464.7047402095, 4547666.162473294, 4549035.700333285, 4549372.420303228, 4554468.665967163, 4555473.4375, 4562532.255588068, 4569282.8125, 4581453.569647008, 4598715.473536904, 4601162.31792589, 4603703.380645158, 4613590.342347251, 4616146.435752251, 4625865.625, 4627231.3180494895, 4628987.156694485, 4644034.9138133265, 4644412.96613629, 4652875.0, 4661169.544845721, 4680154.6875, 4689981.25, 4692982.431515479, 4698384.375, 4717362.309436961, 4717962.159597585, 4718020.217188574, 4726504.254056284, 4726781.22132105, 4738875.36348702, 4744597.198475061, 4744606.776859743, 4745035.38904725, 4745904.303902554, 4748390.510731576, 4755322.555886627, 4763438.317596745, 4772636.110696847, 4772639.978666936, 4774592.5254163155, 4778246.71505538, 4779912.5, 4789705.223628016, 4792888.00313262, 4794146.875, 4796917.145049452, 4802625.459030635, 4804321.159947123, 4807245.1320742415, 4818130.896063417, 4820485.656516178, 4827997.47378156, 4835545.229786261, 4835745.063706477, 4836798.278407797, 4881960.649958579, 4934434.5118074, 4966563.112221708, 4994446.524239504, 5028303.125, 5130896.875, 5245382.8125, 5263193.168134341, 5471055.620715022, 5476234.886638941, 5519891.778654542, 5545864.211225235, 5561587.078098944, 5561596.579311819, 5573359.974805254, 5575844.526701043, 5588050.802025781, 5594246.687552045, 5649084.3862531325, 5649196.879305982, 5670952.104054189, 5672170.67717337, 5673485.9375, 5675980.872784605, 5724268.75, 5724272.096491898, 5728621.660581145, 5730022.097836239, 5745676.0791058475, 5747029.6875, 5748331.0196372075, 5749341.527249295, 5752934.284792681, 5754099.559895784, 5755065.137325095, 5755754.03321823, 5755784.375, 5756140.10625721, 5805519.124535449, 5812006.25, 5816292.381580021, 5841674.832101965, 5842864.7594168605, 5845724.553930084, 5877616.065321439, 5877668.467643336, 5904968.75, 5980248.4375, 6002675.0, 6004864.971294179, 6013386.1580964, 6018016.728069781, 6018628.138685367, 6020190.080393176, 6024123.249933639, 6039708.801383523, 6069648.190160369, 6070021.365418659, 6070056.2219861355, 6076751.35448522, 6079059.375, 6098020.516809431, 6121317.736058394, 6122830.147849178, 6122880.177998705, 6123428.322193885, 6124456.640303077, 6125116.822729053, 6133571.976974285, 6168410.870983532, 6177733.288954712, 6192302.038069587, 6193319.30966479, 6194103.1799635235, 6213452.643732038, 6214162.5, 6216641.825306084, 6226482.8125, 6230528.125, 6232171.556094143, 6238838.182588835, 6243815.541665893, 6244131.071388671, 6248513.607571742, 6249429.53138275, 6249764.97785072, 6252656.25, 6259581.25, 6259621.018403893, 6273451.5625, 6274037.8043128615, 6275985.028206447, 6284629.133151643, 6287914.707294667, 6293584.375, 6296842.796603899, 6298698.8017650405, 6309953.125, 6313842.944602281, 6317795.487529804, 6323853.9440395525, 6332029.6875, 6343109.642942075, 6361317.1875, 6367528.521302312, 6371781.25, 6385321.5948171895, 6389331.51835623, 6390913.984041867, 6392614.0625, 6392808.850360084, 6397339.0625, 6397804.254974213, 6403712.173416758, 6413204.8434958095, 6413424.913906725, 6427720.911694804, 6431015.755409402, 6438390.183337927, 6463245.733982833, 6472155.014277106, 6474931.074228022, 6479182.645953152, 6481253.125, 6535053.439741934, 6567157.802873408, 6571510.436087029, 6629346.875, 6637946.875, 6637977.49127584, 6644238.830544936, 6644889.0625, 6668053.115674006, 6704310.9375, 6711617.674968107, 6717116.34997589, 6766366.299049632, 6793052.044334033, 6898516.753198051, 6929099.776423289, 6953068.607301505, 7061044.9278682005, 7601714.8542302055, 7634375.0, 7892059.142594023, 8035582.8180771675, 8472845.3125, 8475289.0625, 8481529.6875, 8487329.390825558, 8601751.80872755, 8615272.559574638, 8617925.0, 8618487.319475956, 8619640.957409255, 70162111.8395287], [34.30671143777756, 75.88011321557275, 6.435648692137478, 27.208421568597657, 5.343793583436032, 75.85694144233297, 52.75824448563484, 72.82253760726746, 10.794014818173526, 6.122815828788872, 7.464429772476207, 41.73447989441262, 34.741069456148466, 36.37434922383508, 5.387950564073266, 47.60052289427916, 16.456189628364395, 8.378595180691793, 36.79111154400632, 16.36922179486843, 13.235965669205292, 55.30499229191648, 94.77584470806181, 5.137509418181374, 5.387940761315623, 16.979972540998723, 16.85182006092991, 60.89741564662784, 83.50316644412062, 7.5662681664604, 39.01653145941831, 28.76293206323563, 59.89173555084089, 7.261754925905824, 40.02448439863733, 16.27482194415581, 67.42110759623027, 25.779190393316235, 74.51513476575138, 50.77859317958875, 36.55440663762877, 121.04018195300546, 29.252397050436883, 23.575543979468183, 15.100811982016324, 29.75823033893986, 25.311100920684712, 50.365481933133076, 15.434006722990949, 8.918396592142658, 10.524636978745733, 10.312815178048048, 7.427373049173378, 69.27912331327524, 47.29485645889519, 17.460861176339066, 58.95344695630381, 57.323853097061615, 71.42756338727645, 15.573746985078246, 27.699230933707817, 45.12077898972755, 45.948613883945214, 12.55318555192543, 104.87370610103872, 54.934947722268745, 7.585472478895447, 6.0903547454356, 75.06310389775368, 7.205835687681166, 65.86713493649658, 40.09330888116382, 41.13118294178043, 9.19524642766447, 5.731425439709875, 34.06404514288531, 10.992773940914443, 30.27341884342618, 20.47995475641779, 11.573034634702182, 28.476583380017725, 49.136579141679555, 16.667644477865448, 68.88318216273824, 16.497428337633398, 22.493396811357023, 22.638921271237518, 80.13342078455159, 13.929684672151026, 28.801175431779715, 57.04018322290224, 7.58004716636988, 54.89353575092628, 6.432494762567275, 14.691267658046133, 76.19120836970706, 6.625512733571885, 89.74411786632174, 61.36510723038269, 29.456219004917713, 10.081126614672668, 8.652263838404409, 7.486635337836353, 5.706552785745017, 51.07598161016228, 18.339461910477937, 85.00694740322223, 19.316597686066356, 12.245462128477273, 7.147231347022542, 67.8059719644545, 17.872801244161593, 23.752936295229993, 98.09174773225553, 16.61768178424524, 20.564835475183816, 23.773802542852472, 18.90697298981828, 28.45217778558543, 28.026170217123376, 66.60068135661776, 13.337906124279868, 98.08269398916971, 8.20656654618601, 32.456043454465124, 8.775173292876351, 19.394949351088098, 42.677031682928515, 97.97488541263787, 31.255123462586866, 15.554861247327768, 35.139372415383555, 7.386902500927166, 49.24890402264706, 35.798033999617346, 5.469796139768267, 16.888266048759593, 22.3948901976825, 15.639236189547479, 62.992192546997565, 22.62028057610663, 5.685503430490089, 7.4514001513646235, 5.163310692987906, 93.14718488077399, 47.66361566466132, 65.26635186470352, 6.52843510584056, 7.642821126914306, 74.00428101305731, 35.931759762693346, 58.800648801857406, 5.653678994074466, 40.810737184190366, 17.094560560348075, 61.03537969933106, 57.77586231094027, 47.242581221786935, 10.842672504017415, 59.99000226889895, 6.854325772884503, 28.31787305095535, 52.95288212586542, 18.857280979191813, 23.606144998980817, 9.126734276079315, 7.243438065997984, 89.4622615955839, 19.81346626193903, 60.739048648722864, 16.35245899903416, 78.10643367622079, 7.801935559045876, 36.83531039553483, 49.179993165055535, 79.20517903658089, 15.929761478237118, 6.270065597255406, 72.36569350943564, 15.739558627226264, 81.84528225388402, 12.43603079858798, 28.304606861322245, 61.704821742749374, 37.41886130955298, 7.676425291420145, 7.216312015561937, 11.697209334582443, 9.047526543278687, 61.75723936808699, 24.31539063594356, 28.55012201433061, 12.305694237041061, 5.260441260750034, 24.58796129769873, 17.526584453383645, 17.302739575944937, 37.40622025441331, 6.982367315597984, 90.10607609314872, 6.325059808148495, 25.85360649297262, 6.2444654577553935, 17.853420570378923, 33.3288402940022, 49.542051800431594, 31.530854671860556, 5.293193896779947, 13.776709124339336, 8.593661222393113, 119.6723197897362, 45.2536136799189, 7.347338855632768, 52.703360578273006, 51.09718040939989, 55.45692615494847, 98.77147413631474, 14.261729936162014, 47.23612153462966, 5.608792955025111, 17.681983655657568, 116.18361994689793, 6.545621675095246, 17.550011173591756, 12.064861781493457, 6.984375950737999, 5.682772150353772, 34.429582718175546, 18.37758535367823, 33.715630436503396, 52.07641493450476, 12.94237865039065, 111.15493974561379, 29.73571263204856, 69.07792569711276, 9.829978157197134, 26.29587747308446, 32.055822040249545, 47.67332943201697, 102.13362958012539, 12.367432618179013, 25.40856357537295, 78.99529720596908, 23.99672463955296, 8.630817091536315, 7.573593005738466, 8.159251884867027, 7.546692706217612, 13.948189538895594, 7.653479564757811, 165.22119479595085, 9.051438733061827, 54.117020195069735, 57.5828265524115, 89.88973462242465, 29.109764717863175, 33.4940677240196, 8.577035037706608, 13.582827918716298, 9.46040656595476, 56.122015666527346, 7.045834595011466, 7.835607802622805, 8.744972716891446, 19.488471122115662, 5.800239697381304, 11.969384369517723, 6.487766443010937, 7.271478350192475, 8.489320447282745, 93.90871983776465, 66.39518064822897, 50.346051097900435, 6.111439321197691, 13.80731690621051, 15.864801764990903, 23.74444043825508, 82.44439142938204, 7.521991504197008, 156.81616325520534, 26.85968785839911, 5.381911632653776, 21.616937076113736, 6.022603625301497, 51.800340735277686, 23.763948787329547, 11.768354635833488, 38.51734666782194, 15.73672008581854, 40.429950653845644, 7.876375259604067, 8.063980643550446, 74.1404721204852, 6.232171791291054, 47.447027646866474, 33.66127205246097, 113.28916606853197, 61.00130644810686, 11.490955888187548, 8.970961366093505, 80.66111271108439, 43.487404162578486, 25.30165499000142, 20.788879567149927, 30.637986610807403, 8.934740256568954, 7.114107084214529, 6.066731379134887, 106.58309825435849, 49.65493258943446, 92.74392262874578, 9.753551475992532, 26.640225156245904, 24.409311629245746, 35.993432941728344, 13.71232049222138, 7.640541192959431, 66.21014865566939, 5.215732893621101, 44.0697119279307, 26.722555329831636, 47.40434876558347, 76.23827915716085, 32.867379823815895, 22.987531311086133, 66.73810557948592, 106.83461122704762, 13.850981798385517, 5.221168149162378, 26.978476829271667, 34.36888474664616, 21.95481473924273, 90.24984395386973, 12.94033045388611, 47.20890439539954, 40.990156460313514, 6.603750076435335, 79.77926179770871, 7.717139970458368, 5.565645399836474, 13.179623093421933, 8.6597691680932, 53.697052461850305, 82.96984206334866, 16.539067008916582, 46.577881344848855, 12.56083042879766, 9.483919663341178, 44.865420716738996, 77.10640239135157, 16.07160706722774, 31.641920533235417, 47.27061763315605, 43.02812901980528, 116.07752929857406, 16.073540306082403, 27.06351035813456, 30.919361183750418, 44.20510712050128, 52.629654491459014, 10.512849263958664, 9.069725202042202, 5.295930302420025, 26.93064021043423, 23.661081991859948, 18.1139756119013, 31.2184821043149, 72.06251831326489, 16.352777305795055, 5.924243029661849, 25.619507957322597, 92.32885584286213, 152.36622226445073, 108.81383327470056, 46.18778233669684, 103.41989118696019, 72.42973172388122, 39.04916451551292, 10.783520782852912, 51.66216634186797, 80.4336071071133, 30.3595643776816, 17.194172093999335, 78.80307229768053, 23.724275783304794, 23.078284048677858, 33.857702360988775, 64.6140780932358, 25.992013131279556, 13.653522424471104, 19.15942927908738, 36.648200942461074, 24.654347994847672, 14.962809667396842, 64.14773826159285, 35.90712851542309, 39.103357069592775, 57.88116099155752, 9.548657933308418, 88.19778227872037, 46.48200744785012, 91.54739459098451, 5.301466777908692, 208.7705842034558])
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);
([3423825.655310054, 3512851.1143960883, 3527057.476294607, 3583197.378958128, 3600982.86702648, 3614034.688258421, 3634150.7031151126, 3636792.1875, 3670043.525482561, 3678028.4523541396, 3678566.7866861103, 3684021.5444763736, 3686006.25, 3686414.0625, 3687095.034471114, 3688067.1875, 3688211.285229547, 3691164.2325459532, 3691609.481038228, 3694076.892633016, 3702533.841776207, 3705078.715853206, 3711835.9375, 3712630.012503944, 3727654.409209532, 3729115.354709888, 3732573.8621922275, 3736979.3822929906, 3743883.965953902, 3744453.0216147723, 3745115.103877556, 3746633.5476669134, 3747062.5, 3749484.8831387283, 3750998.4375, 3751474.3287783368, 3752625.0, 3754248.832588277, 3754686.505656803, 3754710.9375, 3754884.1027644803, 3758374.5457126116, 3758460.6371448277, 3758782.7407498606, 3761767.228676372, 3764495.3125, 3764599.3145108675, 3764885.9375, 3765265.0236755544, 3772713.530029902, 3778699.5765744657, 3780468.1575722033, 3781613.5485951877, 3786684.2355330517, 3787121.831340723, 3789385.6346798907, 3790564.0625, 3790990.625, 3791124.1645057974, 3792467.344042467, 3793363.1817105217, 3793573.4375, 3794610.4568687235, 3795125.7537642294, 3795541.8875696915, 3795789.0625, 3796446.825613263, 3796554.7091617202, 3796732.8125, 3796748.749070825, 3798045.3125, 3798313.7213675794, 3798315.982262534, 3798332.6469614627, 3798701.943239229, 3798835.9375, 3799010.849424219, 3799985.5561041366, 3800796.2670630235, 3801395.579874372, 3801814.0600414993, 3802182.8125, 3802558.343881909, 3802650.406281269, 3802661.293485566, 3803054.443052386, 3804602.784140184, 3806716.0382159953, 3809090.331536898, 3809972.60901094, 3810400.0, 3828962.4354232266, 3840132.8125, 3840143.3926450475, 3844248.370259514, 3844258.355007207, 3844564.8921270375, 3845526.2939996975, 3890805.7968615047, 3906926.5625, 3909917.95844806, 3915763.1329258312, 3915763.728178944, 3917285.934274924, 3919457.8125, 3919987.9591986854, 3926840.625, 3931893.000115567, 3936278.7390425247, 3938307.9096708163, 3945445.127450414, 3950817.3787396597, 3954690.3251717906, 3955137.092837586, 3955808.1922438205, 3957461.9016231704, 3971762.898816198, 3974838.257239361, 3976015.6213044724, 3976503.09930122, 3978996.875, 3980735.441824747, 3982032.520673065, 3990449.845570513, 4000390.0594365196, 4002464.884739965, 4016381.8226408097, 4021150.9597207364, 4034493.75, 4037464.0625, 4045270.5996735874, 4053418.7073021806, 4058096.2344469232, 4058400.0, 4060175.1815510294, 4065612.6857527588, 4104141.056538072, 4106124.158136826, 4121878.2967566755, 4163621.456194461, 4188391.79352852, 4204246.535771122, 4215433.934728599, 4222932.724220274, 4227536.861759891, 4240198.4375, 4252348.664790546, 4259617.446267676, 4263553.233132185, 4269550.0, 4274256.038277505, 4277759.375, 4277766.319878077, 4323015.894818865, 4336153.925916908, 4363376.5625, 4367465.264958749, 4375785.600447624, 4376979.497155065, 4378240.625, 4405606.6885017315, 4410303.9940784145, 4414482.8125, 4415022.574633227, 4438498.712085107, 4440223.185105941, 4445252.0070839515, 4449064.538397403, 4449686.813351891, 4453962.5, 4456498.764212057, 4459215.625, 4463892.705372154, 4474084.375, 4475395.066801042, 4488548.183973759, 4491659.612177804, 4493809.397660404, 4497325.956285946, 4500139.257224315, 4500467.1875, 4508919.451821708, 4512400.973863796, 4512550.091132508, 4516912.459214389, 4516923.63541896, 4517337.848978416, 4521140.119071523, 4522519.956542673, 4534435.9375, 4534515.367955014, 4537859.375, 4546464.7047402095, 4547666.162473294, 4549035.700333285, 4549372.420303228, 4554468.665967163, 4555473.4375, 4562532.255588068, 4569282.8125, 4581453.569647008, 4598715.473536904, 4601162.31792589, 4603703.380645158, 4613590.342347251, 4616146.435752251, 4625865.625, 4627231.3180494895, 4628987.156694485, 4644034.9138133265, 4644412.96613629, 4652875.0, 4661169.544845721, 4680154.6875, 4689981.25, 4692982.431515479, 4698384.375, 4717362.309436961, 4717962.159597585, 4718020.217188574, 4726504.254056284, 4726781.22132105, 4738875.36348702, 4744597.198475061, 4744606.776859743, 4745035.38904725, 4745904.303902554, 4748390.510731576, 4755322.555886627, 4763438.317596745, 4772636.110696847, 4772639.978666936, 4774592.5254163155, 4778246.71505538, 4779912.5, 4789705.223628016, 4792888.00313262, 4794146.875, 4796917.145049452, 4802625.459030635, 4804321.159947123, 4807245.1320742415, 4818130.896063417, 4820485.656516178, 4827997.47378156, 4835545.229786261, 4835745.063706477, 4836798.278407797, 4881960.649958579, 4934434.5118074, 4966563.112221708, 4994446.524239504, 5028303.125, 5130896.875, 5245382.8125, 5263193.168134341, 5471055.620715022, 5476234.886638941, 5519891.778654542, 5545864.211225235, 5561587.078098944, 5561596.579311819, 5573359.974805254, 5575844.526701043, 5588050.802025781, 5594246.687552045, 5649084.3862531325, 5649196.879305982, 5670952.104054189, 5672170.67717337, 5673485.9375, 5675980.872784605, 5724268.75, 5724272.096491898, 5728621.660581145, 5730022.097836239, 5745676.0791058475, 5747029.6875, 5748331.0196372075, 5749341.527249295, 5752934.284792681, 5754099.559895784, 5755065.137325095, 5755754.03321823, 5755784.375, 5756140.10625721, 5805519.124535449, 5812006.25, 5816292.381580021, 5841674.832101965, 5842864.7594168605, 5845724.553930084, 5877616.065321439, 5877668.467643336, 5904968.75, 5980248.4375, 6002675.0, 6004864.971294179, 6013386.1580964, 6018016.728069781, 6018628.138685367, 6020190.080393176, 6024123.249933639, 6039708.801383523, 6069648.190160369, 6070021.365418659, 6070056.2219861355, 6076751.35448522, 6079059.375, 6098020.516809431, 6121317.736058394, 6122830.147849178, 6122880.177998705, 6123428.322193885, 6124456.640303077, 6125116.822729053, 6133571.976974285, 6168410.870983532, 6177733.288954712, 6192302.038069587, 6193319.30966479, 6194103.1799635235, 6213452.643732038, 6214162.5, 6216641.825306084, 6226482.8125, 6230528.125, 6232171.556094143, 6238838.182588835, 6243815.541665893, 6244131.071388671, 6248513.607571742, 6249429.53138275, 6249764.97785072, 6252656.25, 6259581.25, 6259621.018403893, 6273451.5625, 6274037.8043128615, 6275985.028206447, 6284629.133151643, 6287914.707294667, 6293584.375, 6296842.796603899, 6298698.8017650405, 6309953.125, 6313842.944602281, 6317795.487529804, 6323853.9440395525, 6332029.6875, 6343109.642942075, 6361317.1875, 6367528.521302312, 6371781.25, 6385321.5948171895, 6389331.51835623, 6390913.984041867, 6392614.0625, 6392808.850360084, 6397339.0625, 6397804.254974213, 6403712.173416758, 6413204.8434958095, 6413424.913906725, 6427720.911694804, 6431015.755409402, 6438390.183337927, 6463245.733982833, 6472155.014277106, 6474931.074228022, 6479182.645953152, 6481253.125, 6535053.439741934, 6567157.802873408, 6571510.436087029, 6629346.875, 6637946.875, 6637977.49127584, 6644238.830544936, 6644889.0625, 6668053.115674006, 6704310.9375, 6711617.674968107, 6717116.34997589, 6766366.299049632, 6793052.044334033, 6898516.753198051, 6929099.776423289, 6953068.607301505, 7061044.9278682005, 7601714.8542302055, 7634375.0, 7892059.142594023, 8035582.8180771675, 8472845.3125, 8475289.0625, 8481529.6875, 8487329.390825558, 8601751.80872755, 8615272.559574638, 8617925.0, 8618487.319475956, 8619640.957409255, 70162111.8395287], [34.30671143777756, 75.88011321557275, 6.435648692137478, 27.208421568597657, 5.343793583436032, 75.85694144233297, 52.75824448563484, 72.82253760726746, 10.794014818173526, 6.122815828788872, 7.464429772476207, 41.73447989441262, 34.741069456148466, 36.37434922383508, 5.387950564073266, 47.60052289427916, 16.456189628364395, 8.378595180691793, 36.79111154400632, 16.36922179486843, 13.235965669205292, 55.30499229191648, 94.77584470806181, 5.137509418181374, 5.387940761315623, 16.979972540998723, 16.85182006092991, 60.89741564662784, 83.50316644412062, 7.5662681664604, 39.01653145941831, 28.76293206323563, 59.89173555084089, 7.261754925905824, 40.02448439863733, 16.27482194415581, 67.42110759623027, 25.779190393316235, 74.51513476575138, 50.77859317958875, 36.55440663762877, 121.04018195300546, 29.252397050436883, 23.575543979468183, 15.100811982016324, 29.75823033893986, 25.311100920684712, 50.365481933133076, 15.434006722990949, 8.918396592142658, 10.524636978745733, 10.312815178048048, 7.427373049173378, 69.27912331327524, 47.29485645889519, 17.460861176339066, 58.95344695630381, 57.323853097061615, 71.42756338727645, 15.573746985078246, 27.699230933707817, 45.12077898972755, 45.948613883945214, 12.55318555192543, 104.87370610103872, 54.934947722268745, 7.585472478895447, 6.0903547454356, 75.06310389775368, 7.205835687681166, 65.86713493649658, 40.09330888116382, 41.13118294178043, 9.19524642766447, 5.731425439709875, 34.06404514288531, 10.992773940914443, 30.27341884342618, 20.47995475641779, 11.573034634702182, 28.476583380017725, 49.136579141679555, 16.667644477865448, 68.88318216273824, 16.497428337633398, 22.493396811357023, 22.638921271237518, 80.13342078455159, 13.929684672151026, 28.801175431779715, 57.04018322290224, 7.58004716636988, 54.89353575092628, 6.432494762567275, 14.691267658046133, 76.19120836970706, 6.625512733571885, 89.74411786632174, 61.36510723038269, 29.456219004917713, 10.081126614672668, 8.652263838404409, 7.486635337836353, 5.706552785745017, 51.07598161016228, 18.339461910477937, 85.00694740322223, 19.316597686066356, 12.245462128477273, 7.147231347022542, 67.8059719644545, 17.872801244161593, 23.752936295229993, 98.09174773225553, 16.61768178424524, 20.564835475183816, 23.773802542852472, 18.90697298981828, 28.45217778558543, 28.026170217123376, 66.60068135661776, 13.337906124279868, 98.08269398916971, 8.20656654618601, 32.456043454465124, 8.775173292876351, 19.394949351088098, 42.677031682928515, 97.97488541263787, 31.255123462586866, 15.554861247327768, 35.139372415383555, 7.386902500927166, 49.24890402264706, 35.798033999617346, 5.469796139768267, 16.888266048759593, 22.3948901976825, 15.639236189547479, 62.992192546997565, 22.62028057610663, 5.685503430490089, 7.4514001513646235, 5.163310692987906, 93.14718488077399, 47.66361566466132, 65.26635186470352, 6.52843510584056, 7.642821126914306, 74.00428101305731, 35.931759762693346, 58.800648801857406, 5.653678994074466, 40.810737184190366, 17.094560560348075, 61.03537969933106, 57.77586231094027, 47.242581221786935, 10.842672504017415, 59.99000226889895, 6.854325772884503, 28.31787305095535, 52.95288212586542, 18.857280979191813, 23.606144998980817, 9.126734276079315, 7.243438065997984, 89.4622615955839, 19.81346626193903, 60.739048648722864, 16.35245899903416, 78.10643367622079, 7.801935559045876, 36.83531039553483, 49.179993165055535, 79.20517903658089, 15.929761478237118, 6.270065597255406, 72.36569350943564, 15.739558627226264, 81.84528225388402, 12.43603079858798, 28.304606861322245, 61.704821742749374, 37.41886130955298, 7.676425291420145, 7.216312015561937, 11.697209334582443, 9.047526543278687, 61.75723936808699, 24.31539063594356, 28.55012201433061, 12.305694237041061, 5.260441260750034, 24.58796129769873, 17.526584453383645, 17.302739575944937, 37.40622025441331, 6.982367315597984, 90.10607609314872, 6.325059808148495, 25.85360649297262, 6.2444654577553935, 17.853420570378923, 33.3288402940022, 49.542051800431594, 31.530854671860556, 5.293193896779947, 13.776709124339336, 8.593661222393113, 119.6723197897362, 45.2536136799189, 7.347338855632768, 52.703360578273006, 51.09718040939989, 55.45692615494847, 98.77147413631474, 14.261729936162014, 47.23612153462966, 5.608792955025111, 17.681983655657568, 116.18361994689793, 6.545621675095246, 17.550011173591756, 12.064861781493457, 6.984375950737999, 5.682772150353772, 34.429582718175546, 18.37758535367823, 33.715630436503396, 52.07641493450476, 12.94237865039065, 111.15493974561379, 29.73571263204856, 69.07792569711276, 9.829978157197134, 26.29587747308446, 32.055822040249545, 47.67332943201697, 102.13362958012539, 12.367432618179013, 25.40856357537295, 78.99529720596908, 23.99672463955296, 8.630817091536315, 7.573593005738466, 8.159251884867027, 7.546692706217612, 13.948189538895594, 7.653479564757811, 165.22119479595085, 9.051438733061827, 54.117020195069735, 57.5828265524115, 89.88973462242465, 29.109764717863175, 33.4940677240196, 8.577035037706608, 13.582827918716298, 9.46040656595476, 56.122015666527346, 7.045834595011466, 7.835607802622805, 8.744972716891446, 19.488471122115662, 5.800239697381304, 11.969384369517723, 6.487766443010937, 7.271478350192475, 8.489320447282745, 93.90871983776465, 66.39518064822897, 50.346051097900435, 6.111439321197691, 13.80731690621051, 15.864801764990903, 23.74444043825508, 82.44439142938204, 7.521991504197008, 156.81616325520534, 26.85968785839911, 5.381911632653776, 21.616937076113736, 6.022603625301497, 51.800340735277686, 23.763948787329547, 11.768354635833488, 38.51734666782194, 15.73672008581854, 40.429950653845644, 7.876375259604067, 8.063980643550446, 74.1404721204852, 6.232171791291054, 47.447027646866474, 33.66127205246097, 113.28916606853197, 61.00130644810686, 11.490955888187548, 8.970961366093505, 80.66111271108439, 43.487404162578486, 25.30165499000142, 20.788879567149927, 30.637986610807403, 8.934740256568954, 7.114107084214529, 6.066731379134887, 106.58309825435849, 49.65493258943446, 92.74392262874578, 9.753551475992532, 26.640225156245904, 24.409311629245746, 35.993432941728344, 13.71232049222138, 7.640541192959431, 66.21014865566939, 5.215732893621101, 44.0697119279307, 26.722555329831636, 47.40434876558347, 76.23827915716085, 32.867379823815895, 22.987531311086133, 66.73810557948592, 106.83461122704762, 13.850981798385517, 5.221168149162378, 26.978476829271667, 34.36888474664616, 21.95481473924273, 90.24984395386973, 12.94033045388611, 47.20890439539954, 40.990156460313514, 6.603750076435335, 79.77926179770871, 7.717139970458368, 5.565645399836474, 13.179623093421933, 8.6597691680932, 53.697052461850305, 82.96984206334866, 16.539067008916582, 46.577881344848855, 12.56083042879766, 9.483919663341178, 44.865420716738996, 77.10640239135157, 16.07160706722774, 31.641920533235417, 47.27061763315605, 43.02812901980528, 116.07752929857406, 16.073540306082403, 27.06351035813456, 30.919361183750418, 44.20510712050128, 52.629654491459014, 10.512849263958664, 9.069725202042202, 5.295930302420025, 26.93064021043423, 23.661081991859948, 18.1139756119013, 31.2184821043149, 72.06251831326489, 16.352777305795055, 5.924243029661849, 25.619507957322597, 92.32885584286213, 152.36622226445073, 108.81383327470056, 46.18778233669684, 103.41989118696019, 72.42973172388122, 39.04916451551292, 10.783520782852912, 51.66216634186797, 80.4336071071133, 30.3595643776816, 17.194172093999335, 78.80307229768053, 23.724275783304794, 23.078284048677858, 33.857702360988775, 64.6140780932358, 25.992013131279556, 13.653522424471104, 19.15942927908738, 36.648200942461074, 24.654347994847672, 14.962809667396842, 64.14773826159285, 35.90712851542309, 39.103357069592775, 57.88116099155752, 9.548657933308418, 88.19778227872037, 46.48200744785012, 91.54739459098451, 5.301466777908692, 208.7705842034558])
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)