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 = 44860
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);
([6839347.967619059, 6840342.950282113, 7033710.9375, 7045525.541283519, 7065073.073860006, 7066473.4375, 7141461.074493618, 7170710.9375, 7292557.247984216, 7387199.876789671, 7397151.482065327, 7417002.32229932, 7513947.680205927, 7515421.531499076, 7515576.5625, 7605868.459980935, 7633517.685921, 7674715.585376661, 7715218.726415073, 7768784.408453865, 7834548.602606596, 7888707.8125, 7931364.8173172325, 7971195.94500709, 8038504.274787783, 8075344.972277917, 8082924.378393253, 8082944.3602117635, 8116021.600183041, 8121909.509853436, 8121932.562492854, 8126484.375, 8131885.765491231, 8140094.902744395, 8148835.507420694, 8150900.0, 8151719.633086512, 8152865.625, 8185506.645206327, 8224225.117330045, 8235867.332208351, 8246248.068456024, 8246251.5625, 8324010.559159663, 8355450.436788945, 8371157.4186022235, 8377682.342342103, 8379845.922587328, 8382760.175625377, 8392219.358662535, 8421641.74173885, 8639040.47092198, 8777962.123030664, 8780760.9375, 8783012.5, 8809465.625, 8812892.415119383, 8897476.463347616, 8907355.028830126, 8979817.329540864, 9063111.672330242, 9063122.908663418, 9063172.457820144, 9099254.283785492, 9141483.273088524, 9149936.545851158, 9150156.904413348, 9168083.321370538, 9169514.67325224, 9213137.067923388, 9249432.8125, 9269768.800453665, 9273415.662758112, 9297148.263578804, 9321447.988506932, 9321477.608745849, 9322605.45835429, 9323523.4375, 9326262.094717702, 9326344.396106951, 9328024.075278632, 9328300.75897874, 9333260.575945843, 9345416.800433455, 9346870.095934555, 9347507.689364731, 9347605.128733788, 9349522.716749182, 9349800.331791222, 9350226.416449796, 9350253.125, 9354630.91599646, 9355423.4375, 9374329.297781492, 9376961.670885818, 9379346.976461923, 9379798.091615641, 9379858.12456952, 9380075.526910609, 9380113.193959815, 9380332.644981964, 9380504.52121222, 9380623.169852743, 9380625.609784678, 9381048.4375, 9381202.808628256, 9381206.664680552, 9381405.144646306, 9381421.729693051, 9381465.983579697, 9381663.34567558, 9381737.5, 9382304.061944343, 9382357.8125, 9382538.469985005, 9382672.346417699, 9382802.006845538, 9382928.125, 9382960.9375, 9383148.91170736, 9383157.343499966, 9383207.793435145, 9383377.609450385, 9383422.355272487, 9383544.154596811, 9383582.036082253, 9383849.8674706, 9384020.464797594, 9384053.133000594, 9384059.375, 9384066.246511413, 9384089.596185502, 9384206.923197493, 9384281.40203955, 9384542.1875, 9384692.14287776, 9385099.962775411, 9385702.078107331, 9385845.630429327, 9385928.59839734, 9386454.6875, 9387439.842055043, 9387542.423876518, 9387857.00151029, 9387924.565159475, 9388304.308891762, 9389587.5, 9389657.985763798, 9390482.113811994, 9391267.1875, 9411266.731819876, 9416586.822475495, 9419989.78350668, 9420093.23125771, 9420278.811663164, 9420437.5, 9420647.721542614, 9420913.247822134, 9420946.374813268, 9421013.647394419, 9421079.663332732, 9421082.555939702, 9421126.015444474, 9421281.389987495, 9421318.913632018, 9421573.463317927, 9421580.70621105, 9421690.39608668, 9422202.897369934, 9422243.75, 9422244.836484158, 9422349.07810995, 9422360.987823568, 9423667.063865688, 9424243.75, 9424976.198407574, 9425655.530045658, 9425973.410166722, 9426265.020463469, 9426410.669887131, 9456131.25, 9508810.139718032, 9516301.057548955, 9516974.85665978, 9518344.245442621, 9518730.943708545, 9519269.679317687, 9519828.125, 9521421.875, 9535426.44391324, 9535531.25, 9537696.131995786, 9537750.906092508, 9537864.0625, 9547616.714683158, 9547715.863285642, 9563734.344797947, 9565271.024708206, 9567623.4375, 9567774.509209858, 9568217.1875, 9568330.46551889, 9568616.420907333, 9570229.184848769, 9612261.474133037, 9639761.155511925, 9653749.227836128, 9676733.916169977, 9676794.972862624, 9680988.789898576, 9748976.5625, 9756479.20610783, 9762897.578172501, 9770746.409327086, 9778032.8125, 9780385.042304654, 9889812.009114746, 9929855.326018639, 9933027.00909884, 9959989.232304374, 9963802.569300404, 10009717.1875, 10053414.537364352, 10066585.74697985, 10072595.3125, 10097157.077503413, 10161545.846347854, 10161581.25, 10305190.625, 10308817.1875, 10309337.574073337, 10434440.753452951, 10441929.6875, 10470292.1875, 10497615.86229532, 10863651.808028927, 10863763.491227867, 10864339.454325309, 10864359.265793387, 10864928.035347492, 10865019.391742509, 10865229.765062025, 10865470.011005364, 10865816.509081256, 10865931.495687613, 10866483.309031226, 10866537.516480263, 10866801.691802245, 10866865.027426355, 10867567.069068603, 10869642.1875, 10869815.625, 10869839.390871767, 10869904.774192013, 10870443.655112786, 10870605.52109377, 10871325.0, 10871830.107988345, 10871986.433741456, 10872343.540669937, 10872695.257574474, 10872707.420272436, 10873106.25, 10873616.685315814, 10874115.503282566, 10874407.303404666, 10874556.179774141, 10874618.75, 10875048.265847705, 10875618.401741706, 10875715.91381709, 10875989.836130697, 10876029.6875, 10876283.022170888, 10876478.15574502, 10876557.806890426, 10877249.991094768, 10877378.362638498, 10877563.599524101, 10878409.844222633, 10878602.925132489, 10879180.340503734, 10880300.815082358, 10880925.0, 10881164.537547212, 10881262.53217643, 10881363.82820742, 10882100.0, 10882491.558862148, 10883011.813885173, 10883460.610584766, 10883785.740765106, 10883839.0625, 10883842.85696324, 10886248.909476811, 10886403.125, 10887878.57861986, 10888351.200680163, 10888947.430643348, 10888989.0625, 10889732.27001199, 10889833.912082661, 10890895.3125, 10892058.538921366, 10894165.625, 10895482.8125, 10896195.099715216, 10896233.971227728, 10896449.58410415, 10896450.0, 10897053.440122575, 10897300.335808525, 10897795.3125, 10900726.5625, 10900858.142668022, 10901591.169410786, 10902148.153740425, 10902392.1875, 10903523.073807195, 10903928.936868828, 10905457.8125, 10905490.430809356, 10906024.227807408, 10906662.5, 10909240.093157582, 10911371.366450956, 10918339.564640723, 10919005.143854145, 10919068.75, 10919779.637254136, 10919836.98280336, 10920066.48590592, 10933557.8125, 10935571.875, 10940367.1875], [27.246224193900094, 36.691453810822914, 67.99597959393337, 24.012307924385937, 80.57623117616764, 85.9015361696651, 15.490705203363865, 72.08865841003296, 133.5835514815862, 26.306235165019903, 73.37898012616563, 12.567017644186627, 6.935661847855659, 23.21053890640051, 37.894513548549995, 13.940438383434573, 61.01612076471693, 59.25879096889454, 85.07941698140807, 9.359851409094036, 82.8033549738182, 37.18795967046617, 24.945973354438678, 18.061609925975883, 5.382927383943415, 60.095156028500924, 10.277702610128738, 143.01675296443392, 30.394523110096948, 8.35920115003714, 26.310440466468634, 70.26414121135174, 6.729645437086051, 109.11308326524222, 10.516013817212896, 34.28121883775359, 12.860140907244546, 85.39896591069075, 6.550880761832429, 15.408405104775722, 47.75245404350643, 6.050544651900954, 38.16568469720288, 13.672068339872283, 6.853957813423787, 18.971040753174908, 30.172679216212416, 25.754882837111335, 6.934613472529923, 39.991629770585206, 22.05178045596288, 104.32640814287375, 30.949032753483237, 65.87855192392094, 62.2878420704893, 44.7915351796068, 27.51443546581019, 80.16453413599051, 49.9092363371529, 15.512027698334956, 64.55978475855598, 29.804661074052103, 12.179822455173055, 26.996914243500783, 170.60605968502372, 24.264312918026917, 22.23477965861965, 17.315213164921243, 25.850294079919074, 7.454097287828985, 33.18214713578227, 51.09751841978339, 5.942700488234561, 25.506902804695155, 13.467947101614794, 23.727542723920685, 13.369746106106376, 47.03999503080834, 44.42764948211135, 18.148986970894356, 23.42041342215318, 12.565134183693887, 5.787704081321446, 74.61869799571039, 7.065663531258293, 8.222517319405402, 8.534556876593946, 90.59999537267805, 24.028161597383118, 25.938874719166183, 50.186538496785666, 50.244467223174624, 37.33632813906292, 54.36924580547674, 7.891931353764808, 22.71214208090471, 54.196705463393684, 7.205974850318028, 29.16408057069944, 18.46548113779935, 23.9498473481309, 49.812280698609726, 6.445937998300447, 85.31525521204847, 87.8410019953613, 7.492683729862178, 8.518756447292562, 63.8666454153285, 45.44885792206942, 64.52757551995825, 83.66080160517625, 34.73421772086926, 61.37323382512086, 42.12270928478382, 20.617323212260285, 26.952038690462274, 50.985161461673826, 39.91751031998087, 72.68166010541707, 18.73401181547839, 8.964005681577701, 14.86933764210661, 67.44544915368007, 5.258788941318716, 5.414169965517307, 61.69145866479614, 26.154847089233115, 15.555610211000825, 11.140235316533625, 36.535470956107886, 103.46242563728529, 17.152732869484048, 12.37288641076718, 8.368648836669212, 47.39175413408393, 16.66734814405217, 11.0700166354585, 31.902333872551043, 23.00134695462531, 117.58107184921761, 31.51979315034406, 19.292582096764008, 8.415661924317437, 38.42100791912786, 13.508116837759854, 120.74832378049487, 114.9931788189287, 28.17184843010046, 54.673344847679715, 32.89594951455956, 21.94690890595842, 26.62934779854115, 19.590930632316113, 13.275006748029794, 7.314463795136772, 47.56587091259177, 31.928611318625393, 12.539611947136718, 30.47859229403772, 13.564724975419404, 28.05533407987062, 24.32194936706622, 6.404623733593968, 6.791779537643539, 6.513051601192382, 77.0729193803065, 21.06712756580735, 8.169123492340063, 37.62723103302138, 66.10981436305751, 13.39221650392067, 20.36907502485708, 27.69950744609821, 16.499745845407876, 53.30592971017385, 30.00322837777401, 29.570684061029716, 11.085250223478305, 42.901429486088944, 19.177171452376093, 29.73362426396481, 41.63168369925142, 8.938060697683179, 5.455647667380685, 24.709786458405212, 37.62908326664318, 40.35885474920763, 54.61420962113564, 62.441364865462035, 72.91287701352925, 45.70514501943948, 11.421963438732792, 5.373959397757979, 48.96570645852032, 16.819528748025007, 21.305683708581547, 27.940830524816498, 8.702898661927644, 34.66116012972748, 6.99814962011397, 34.542346360054516, 21.08075088899844, 19.19059898735643, 36.64296370496267, 39.78644488699609, 20.9461767069901, 12.63772640800286, 21.913864844072727, 23.848000361370104, 24.10714532714571, 41.380130563936625, 69.6983016227242, 5.2217145823270945, 34.79359858164768, 38.85502029694536, 5.999704389857003, 29.369084500707547, 24.434782540196128, 7.77316687528204, 34.21265248583899, 29.22115354494951, 92.68196239677644, 5.482524185887314, 25.257747603846422, 31.114427346705128, 34.029748663467956, 8.590613454917003, 28.998354750452865, 35.97536152455839, 55.20564115842078, 75.4008327771988, 20.823362725214935, 38.861613485940815, 52.467352870178935, 63.39553161099333, 15.967926016947604, 13.13499680077795, 5.732156999724991, 37.57267122176637, 26.869230315254523, 5.220085799518185, 5.344586492494138, 69.40775027487813, 8.816853993313996, 11.534749146301875, 64.89549564528166, 7.125790566420885, 11.336013671217927, 5.889001519113574, 26.38468658362252, 72.48541492764471, 64.61233341737888, 70.5112805038315, 11.26597072968764, 71.60310425459055, 5.371321032253112, 85.86339612171508, 75.90363990955849, 38.91929223121084, 8.178897622909192, 68.07943612693374, 13.63122964781389, 29.192009190227385, 75.02166448949757, 26.791913288627345, 5.033067849664257, 14.680430830758777, 64.42633627971519, 25.40568689042459, 17.35322231688381, 16.169849243263148, 19.02586860488159, 55.71089953463638, 66.6038813780363, 19.01471586961262, 14.920171374544058, 51.3848543335305, 20.04220512135212, 26.181141004266532, 81.65351537192699, 45.71103573243414, 7.857823489569259, 19.335381363546436, 75.51124432857904, 85.09569212959272, 17.110198174286857, 24.627988044482752, 41.16562972316005, 20.29916876673091, 19.81779662792289, 48.099649222635904, 14.241167511195522, 56.07428717096841, 15.301872839665936, 24.674930922871482, 97.01940367015956, 9.74686730420844, 33.91878232087587, 17.58783475907725, 90.21882732885967, 90.44325851358025, 59.49966218015038, 80.46304903046766, 19.427773479014427, 46.72071645451054, 40.30346748484514, 5.522841780883175, 22.014154536021778, 22.3752207186559, 43.932253426096466, 59.537320308090266, 13.24325200947274, 73.07532794912566, 43.66371752861445, 7.727184553709154, 76.95240088447521, 70.62821943521942, 68.19963265737167, 5.446370000847022, 65.06541093491084, 34.77986852736485, 60.22023594508158, 82.74499866836926, 54.205113056789905, 10.387062707242464, 59.19754837317255, 9.795435276871123, 9.74958125526088, 50.67034578998978, 14.753392842033158, 58.11749997340475, 7.367772908687972, 83.17670962677244, 55.46491862670133, 29.62252728724479])
caption, xmean,count, xle, Etot = energy_spectrum(E_tot)
hist_file(E_hist, xmean, count, caption);
([6839347.967619059, 6840342.950282113, 7033710.9375, 7045525.541283519, 7065073.073860006, 7066473.4375, 7141461.074493618, 7170710.9375, 7292557.247984216, 7387199.876789671, 7397151.482065327, 7417002.32229932, 7513947.680205927, 7515421.531499076, 7515576.5625, 7605868.459980935, 7633517.685921, 7674715.585376661, 7715218.726415073, 7768784.408453865, 7834548.602606596, 7888707.8125, 7931364.8173172325, 7971195.94500709, 8038504.274787783, 8075344.972277917, 8082924.378393253, 8082944.3602117635, 8116021.600183041, 8121909.509853436, 8121932.562492854, 8126484.375, 8131885.765491231, 8140094.902744395, 8148835.507420694, 8150900.0, 8151719.633086512, 8152865.625, 8185506.645206327, 8224225.117330045, 8235867.332208351, 8246248.068456024, 8246251.5625, 8324010.559159663, 8355450.436788945, 8371157.4186022235, 8377682.342342103, 8379845.922587328, 8382760.175625377, 8392219.358662535, 8421641.74173885, 8639040.47092198, 8777962.123030664, 8780760.9375, 8783012.5, 8809465.625, 8812892.415119383, 8897476.463347616, 8907355.028830126, 8979817.329540864, 9063111.672330242, 9063122.908663418, 9063172.457820144, 9099254.283785492, 9141483.273088524, 9149936.545851158, 9150156.904413348, 9168083.321370538, 9169514.67325224, 9213137.067923388, 9249432.8125, 9269768.800453665, 9273415.662758112, 9297148.263578804, 9321447.988506932, 9321477.608745849, 9322605.45835429, 9323523.4375, 9326262.094717702, 9326344.396106951, 9328024.075278632, 9328300.75897874, 9333260.575945843, 9345416.800433455, 9346870.095934555, 9347507.689364731, 9347605.128733788, 9349522.716749182, 9349800.331791222, 9350226.416449796, 9350253.125, 9354630.91599646, 9355423.4375, 9374329.297781492, 9376961.670885818, 9379346.976461923, 9379798.091615641, 9379858.12456952, 9380075.526910609, 9380113.193959815, 9380332.644981964, 9380504.52121222, 9380623.169852743, 9380625.609784678, 9381048.4375, 9381202.808628256, 9381206.664680552, 9381405.144646306, 9381421.729693051, 9381465.983579697, 9381663.34567558, 9381737.5, 9382304.061944343, 9382357.8125, 9382538.469985005, 9382672.346417699, 9382802.006845538, 9382928.125, 9382960.9375, 9383148.91170736, 9383157.343499966, 9383207.793435145, 9383377.609450385, 9383422.355272487, 9383544.154596811, 9383582.036082253, 9383849.8674706, 9384020.464797594, 9384053.133000594, 9384059.375, 9384066.246511413, 9384089.596185502, 9384206.923197493, 9384281.40203955, 9384542.1875, 9384692.14287776, 9385099.962775411, 9385702.078107331, 9385845.630429327, 9385928.59839734, 9386454.6875, 9387439.842055043, 9387542.423876518, 9387857.00151029, 9387924.565159475, 9388304.308891762, 9389587.5, 9389657.985763798, 9390482.113811994, 9391267.1875, 9411266.731819876, 9416586.822475495, 9419989.78350668, 9420093.23125771, 9420278.811663164, 9420437.5, 9420647.721542614, 9420913.247822134, 9420946.374813268, 9421013.647394419, 9421079.663332732, 9421082.555939702, 9421126.015444474, 9421281.389987495, 9421318.913632018, 9421573.463317927, 9421580.70621105, 9421690.39608668, 9422202.897369934, 9422243.75, 9422244.836484158, 9422349.07810995, 9422360.987823568, 9423667.063865688, 9424243.75, 9424976.198407574, 9425655.530045658, 9425973.410166722, 9426265.020463469, 9426410.669887131, 9456131.25, 9508810.139718032, 9516301.057548955, 9516974.85665978, 9518344.245442621, 9518730.943708545, 9519269.679317687, 9519828.125, 9521421.875, 9535426.44391324, 9535531.25, 9537696.131995786, 9537750.906092508, 9537864.0625, 9547616.714683158, 9547715.863285642, 9563734.344797947, 9565271.024708206, 9567623.4375, 9567774.509209858, 9568217.1875, 9568330.46551889, 9568616.420907333, 9570229.184848769, 9612261.474133037, 9639761.155511925, 9653749.227836128, 9676733.916169977, 9676794.972862624, 9680988.789898576, 9748976.5625, 9756479.20610783, 9762897.578172501, 9770746.409327086, 9778032.8125, 9780385.042304654, 9889812.009114746, 9929855.326018639, 9933027.00909884, 9959989.232304374, 9963802.569300404, 10009717.1875, 10053414.537364352, 10066585.74697985, 10072595.3125, 10097157.077503413, 10161545.846347854, 10161581.25, 10305190.625, 10308817.1875, 10309337.574073337, 10434440.753452951, 10441929.6875, 10470292.1875, 10497615.86229532, 10863651.808028927, 10863763.491227867, 10864339.454325309, 10864359.265793387, 10864928.035347492, 10865019.391742509, 10865229.765062025, 10865470.011005364, 10865816.509081256, 10865931.495687613, 10866483.309031226, 10866537.516480263, 10866801.691802245, 10866865.027426355, 10867567.069068603, 10869642.1875, 10869815.625, 10869839.390871767, 10869904.774192013, 10870443.655112786, 10870605.52109377, 10871325.0, 10871830.107988345, 10871986.433741456, 10872343.540669937, 10872695.257574474, 10872707.420272436, 10873106.25, 10873616.685315814, 10874115.503282566, 10874407.303404666, 10874556.179774141, 10874618.75, 10875048.265847705, 10875618.401741706, 10875715.91381709, 10875989.836130697, 10876029.6875, 10876283.022170888, 10876478.15574502, 10876557.806890426, 10877249.991094768, 10877378.362638498, 10877563.599524101, 10878409.844222633, 10878602.925132489, 10879180.340503734, 10880300.815082358, 10880925.0, 10881164.537547212, 10881262.53217643, 10881363.82820742, 10882100.0, 10882491.558862148, 10883011.813885173, 10883460.610584766, 10883785.740765106, 10883839.0625, 10883842.85696324, 10886248.909476811, 10886403.125, 10887878.57861986, 10888351.200680163, 10888947.430643348, 10888989.0625, 10889732.27001199, 10889833.912082661, 10890895.3125, 10892058.538921366, 10894165.625, 10895482.8125, 10896195.099715216, 10896233.971227728, 10896449.58410415, 10896450.0, 10897053.440122575, 10897300.335808525, 10897795.3125, 10900726.5625, 10900858.142668022, 10901591.169410786, 10902148.153740425, 10902392.1875, 10903523.073807195, 10903928.936868828, 10905457.8125, 10905490.430809356, 10906024.227807408, 10906662.5, 10909240.093157582, 10911371.366450956, 10918339.564640723, 10919005.143854145, 10919068.75, 10919779.637254136, 10919836.98280336, 10920066.48590592, 10933557.8125, 10935571.875, 10940367.1875], [27.246224193900094, 36.691453810822914, 67.99597959393337, 24.012307924385937, 80.57623117616764, 85.9015361696651, 15.490705203363865, 72.08865841003296, 133.5835514815862, 26.306235165019903, 73.37898012616563, 12.567017644186627, 6.935661847855659, 23.21053890640051, 37.894513548549995, 13.940438383434573, 61.01612076471693, 59.25879096889454, 85.07941698140807, 9.359851409094036, 82.8033549738182, 37.18795967046617, 24.945973354438678, 18.061609925975883, 5.382927383943415, 60.095156028500924, 10.277702610128738, 143.01675296443392, 30.394523110096948, 8.35920115003714, 26.310440466468634, 70.26414121135174, 6.729645437086051, 109.11308326524222, 10.516013817212896, 34.28121883775359, 12.860140907244546, 85.39896591069075, 6.550880761832429, 15.408405104775722, 47.75245404350643, 6.050544651900954, 38.16568469720288, 13.672068339872283, 6.853957813423787, 18.971040753174908, 30.172679216212416, 25.754882837111335, 6.934613472529923, 39.991629770585206, 22.05178045596288, 104.32640814287375, 30.949032753483237, 65.87855192392094, 62.2878420704893, 44.7915351796068, 27.51443546581019, 80.16453413599051, 49.9092363371529, 15.512027698334956, 64.55978475855598, 29.804661074052103, 12.179822455173055, 26.996914243500783, 170.60605968502372, 24.264312918026917, 22.23477965861965, 17.315213164921243, 25.850294079919074, 7.454097287828985, 33.18214713578227, 51.09751841978339, 5.942700488234561, 25.506902804695155, 13.467947101614794, 23.727542723920685, 13.369746106106376, 47.03999503080834, 44.42764948211135, 18.148986970894356, 23.42041342215318, 12.565134183693887, 5.787704081321446, 74.61869799571039, 7.065663531258293, 8.222517319405402, 8.534556876593946, 90.59999537267805, 24.028161597383118, 25.938874719166183, 50.186538496785666, 50.244467223174624, 37.33632813906292, 54.36924580547674, 7.891931353764808, 22.71214208090471, 54.196705463393684, 7.205974850318028, 29.16408057069944, 18.46548113779935, 23.9498473481309, 49.812280698609726, 6.445937998300447, 85.31525521204847, 87.8410019953613, 7.492683729862178, 8.518756447292562, 63.8666454153285, 45.44885792206942, 64.52757551995825, 83.66080160517625, 34.73421772086926, 61.37323382512086, 42.12270928478382, 20.617323212260285, 26.952038690462274, 50.985161461673826, 39.91751031998087, 72.68166010541707, 18.73401181547839, 8.964005681577701, 14.86933764210661, 67.44544915368007, 5.258788941318716, 5.414169965517307, 61.69145866479614, 26.154847089233115, 15.555610211000825, 11.140235316533625, 36.535470956107886, 103.46242563728529, 17.152732869484048, 12.37288641076718, 8.368648836669212, 47.39175413408393, 16.66734814405217, 11.0700166354585, 31.902333872551043, 23.00134695462531, 117.58107184921761, 31.51979315034406, 19.292582096764008, 8.415661924317437, 38.42100791912786, 13.508116837759854, 120.74832378049487, 114.9931788189287, 28.17184843010046, 54.673344847679715, 32.89594951455956, 21.94690890595842, 26.62934779854115, 19.590930632316113, 13.275006748029794, 7.314463795136772, 47.56587091259177, 31.928611318625393, 12.539611947136718, 30.47859229403772, 13.564724975419404, 28.05533407987062, 24.32194936706622, 6.404623733593968, 6.791779537643539, 6.513051601192382, 77.0729193803065, 21.06712756580735, 8.169123492340063, 37.62723103302138, 66.10981436305751, 13.39221650392067, 20.36907502485708, 27.69950744609821, 16.499745845407876, 53.30592971017385, 30.00322837777401, 29.570684061029716, 11.085250223478305, 42.901429486088944, 19.177171452376093, 29.73362426396481, 41.63168369925142, 8.938060697683179, 5.455647667380685, 24.709786458405212, 37.62908326664318, 40.35885474920763, 54.61420962113564, 62.441364865462035, 72.91287701352925, 45.70514501943948, 11.421963438732792, 5.373959397757979, 48.96570645852032, 16.819528748025007, 21.305683708581547, 27.940830524816498, 8.702898661927644, 34.66116012972748, 6.99814962011397, 34.542346360054516, 21.08075088899844, 19.19059898735643, 36.64296370496267, 39.78644488699609, 20.9461767069901, 12.63772640800286, 21.913864844072727, 23.848000361370104, 24.10714532714571, 41.380130563936625, 69.6983016227242, 5.2217145823270945, 34.79359858164768, 38.85502029694536, 5.999704389857003, 29.369084500707547, 24.434782540196128, 7.77316687528204, 34.21265248583899, 29.22115354494951, 92.68196239677644, 5.482524185887314, 25.257747603846422, 31.114427346705128, 34.029748663467956, 8.590613454917003, 28.998354750452865, 35.97536152455839, 55.20564115842078, 75.4008327771988, 20.823362725214935, 38.861613485940815, 52.467352870178935, 63.39553161099333, 15.967926016947604, 13.13499680077795, 5.732156999724991, 37.57267122176637, 26.869230315254523, 5.220085799518185, 5.344586492494138, 69.40775027487813, 8.816853993313996, 11.534749146301875, 64.89549564528166, 7.125790566420885, 11.336013671217927, 5.889001519113574, 26.38468658362252, 72.48541492764471, 64.61233341737888, 70.5112805038315, 11.26597072968764, 71.60310425459055, 5.371321032253112, 85.86339612171508, 75.90363990955849, 38.91929223121084, 8.178897622909192, 68.07943612693374, 13.63122964781389, 29.192009190227385, 75.02166448949757, 26.791913288627345, 5.033067849664257, 14.680430830758777, 64.42633627971519, 25.40568689042459, 17.35322231688381, 16.169849243263148, 19.02586860488159, 55.71089953463638, 66.6038813780363, 19.01471586961262, 14.920171374544058, 51.3848543335305, 20.04220512135212, 26.181141004266532, 81.65351537192699, 45.71103573243414, 7.857823489569259, 19.335381363546436, 75.51124432857904, 85.09569212959272, 17.110198174286857, 24.627988044482752, 41.16562972316005, 20.29916876673091, 19.81779662792289, 48.099649222635904, 14.241167511195522, 56.07428717096841, 15.301872839665936, 24.674930922871482, 97.01940367015956, 9.74686730420844, 33.91878232087587, 17.58783475907725, 90.21882732885967, 90.44325851358025, 59.49966218015038, 80.46304903046766, 19.427773479014427, 46.72071645451054, 40.30346748484514, 5.522841780883175, 22.014154536021778, 22.3752207186559, 43.932253426096466, 59.537320308090266, 13.24325200947274, 73.07532794912566, 43.66371752861445, 7.727184553709154, 76.95240088447521, 70.62821943521942, 68.19963265737167, 5.446370000847022, 65.06541093491084, 34.77986852736485, 60.22023594508158, 82.74499866836926, 54.205113056789905, 10.387062707242464, 59.19754837317255, 9.795435276871123, 9.74958125526088, 50.67034578998978, 14.753392842033158, 58.11749997340475, 7.367772908687972, 83.17670962677244, 55.46491862670133, 29.62252728724479])
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);
([6839347.967619059, 6840342.950282113, 7033710.9375, 7045525.541283519, 7065073.073860006, 7066473.4375, 7141461.074493618, 7170710.9375, 7292557.247984216, 7387199.876789671, 7397151.482065327, 7417002.32229932, 7513947.680205927, 7515421.531499076, 7515576.5625, 7605868.459980935, 7633517.685921, 7674715.585376661, 7715218.726415073, 7768784.408453865, 7834548.602606596, 7888707.8125, 7931364.8173172325, 7971195.94500709, 8038504.274787783, 8075344.972277917, 8082924.378393253, 8082944.3602117635, 8116021.600183041, 8121909.509853436, 8121932.562492854, 8126484.375, 8131885.765491231, 8140094.902744395, 8148835.507420694, 8150900.0, 8151719.633086512, 8152865.625, 8185506.645206327, 8224225.117330045, 8235867.332208351, 8246248.068456024, 8246251.5625, 8324010.559159663, 8355450.436788945, 8371157.4186022235, 8377682.342342103, 8379845.922587328, 8382760.175625377, 8392219.358662535, 8421641.74173885, 8639040.47092198, 8777962.123030664, 8780760.9375, 8783012.5, 8809465.625, 8812892.415119383, 8897476.463347616, 8907355.028830126, 8979817.329540864, 9063111.672330242, 9063122.908663418, 9063172.457820144, 9099254.283785492, 9141483.273088524, 9149936.545851158, 9150156.904413348, 9168083.321370538, 9169514.67325224, 9213137.067923388, 9249432.8125, 9269768.800453665, 9273415.662758112, 9297148.263578804, 9321447.988506932, 9321477.608745849, 9322605.45835429, 9323523.4375, 9326262.094717702, 9326344.396106951, 9328024.075278632, 9328300.75897874, 9333260.575945843, 9345416.800433455, 9346870.095934555, 9347507.689364731, 9347605.128733788, 9349522.716749182, 9349800.331791222, 9350226.416449796, 9350253.125, 9354630.91599646, 9355423.4375, 9374329.297781492, 9376961.670885818, 9379346.976461923, 9379798.091615641, 9379858.12456952, 9380075.526910609, 9380113.193959815, 9380332.644981964, 9380504.52121222, 9380623.169852743, 9380625.609784678, 9381048.4375, 9381202.808628256, 9381206.664680552, 9381405.144646306, 9381421.729693051, 9381465.983579697, 9381663.34567558, 9381737.5, 9382304.061944343, 9382357.8125, 9382538.469985005, 9382672.346417699, 9382802.006845538, 9382928.125, 9382960.9375, 9383148.91170736, 9383157.343499966, 9383207.793435145, 9383377.609450385, 9383422.355272487, 9383544.154596811, 9383582.036082253, 9383849.8674706, 9384020.464797594, 9384053.133000594, 9384059.375, 9384066.246511413, 9384089.596185502, 9384206.923197493, 9384281.40203955, 9384542.1875, 9384692.14287776, 9385099.962775411, 9385702.078107331, 9385845.630429327, 9385928.59839734, 9386454.6875, 9387439.842055043, 9387542.423876518, 9387857.00151029, 9387924.565159475, 9388304.308891762, 9389587.5, 9389657.985763798, 9390482.113811994, 9391267.1875, 9411266.731819876, 9416586.822475495, 9419989.78350668, 9420093.23125771, 9420278.811663164, 9420437.5, 9420647.721542614, 9420913.247822134, 9420946.374813268, 9421013.647394419, 9421079.663332732, 9421082.555939702, 9421126.015444474, 9421281.389987495, 9421318.913632018, 9421573.463317927, 9421580.70621105, 9421690.39608668, 9422202.897369934, 9422243.75, 9422244.836484158, 9422349.07810995, 9422360.987823568, 9423667.063865688, 9424243.75, 9424976.198407574, 9425655.530045658, 9425973.410166722, 9426265.020463469, 9426410.669887131, 9456131.25, 9508810.139718032, 9516301.057548955, 9516974.85665978, 9518344.245442621, 9518730.943708545, 9519269.679317687, 9519828.125, 9521421.875, 9535426.44391324, 9535531.25, 9537696.131995786, 9537750.906092508, 9537864.0625, 9547616.714683158, 9547715.863285642, 9563734.344797947, 9565271.024708206, 9567623.4375, 9567774.509209858, 9568217.1875, 9568330.46551889, 9568616.420907333, 9570229.184848769, 9612261.474133037, 9639761.155511925, 9653749.227836128, 9676733.916169977, 9676794.972862624, 9680988.789898576, 9748976.5625, 9756479.20610783, 9762897.578172501, 9770746.409327086, 9778032.8125, 9780385.042304654, 9889812.009114746, 9929855.326018639, 9933027.00909884, 9959989.232304374, 9963802.569300404, 10009717.1875, 10053414.537364352, 10066585.74697985, 10072595.3125, 10097157.077503413, 10161545.846347854, 10161581.25, 10305190.625, 10308817.1875, 10309337.574073337, 10434440.753452951, 10441929.6875, 10470292.1875, 10497615.86229532, 10863651.808028927, 10863763.491227867, 10864339.454325309, 10864359.265793387, 10864928.035347492, 10865019.391742509, 10865229.765062025, 10865470.011005364, 10865816.509081256, 10865931.495687613, 10866483.309031226, 10866537.516480263, 10866801.691802245, 10866865.027426355, 10867567.069068603, 10869642.1875, 10869815.625, 10869839.390871767, 10869904.774192013, 10870443.655112786, 10870605.52109377, 10871325.0, 10871830.107988345, 10871986.433741456, 10872343.540669937, 10872695.257574474, 10872707.420272436, 10873106.25, 10873616.685315814, 10874115.503282566, 10874407.303404666, 10874556.179774141, 10874618.75, 10875048.265847705, 10875618.401741706, 10875715.91381709, 10875989.836130697, 10876029.6875, 10876283.022170888, 10876478.15574502, 10876557.806890426, 10877249.991094768, 10877378.362638498, 10877563.599524101, 10878409.844222633, 10878602.925132489, 10879180.340503734, 10880300.815082358, 10880925.0, 10881164.537547212, 10881262.53217643, 10881363.82820742, 10882100.0, 10882491.558862148, 10883011.813885173, 10883460.610584766, 10883785.740765106, 10883839.0625, 10883842.85696324, 10886248.909476811, 10886403.125, 10887878.57861986, 10888351.200680163, 10888947.430643348, 10888989.0625, 10889732.27001199, 10889833.912082661, 10890895.3125, 10892058.538921366, 10894165.625, 10895482.8125, 10896195.099715216, 10896233.971227728, 10896449.58410415, 10896450.0, 10897053.440122575, 10897300.335808525, 10897795.3125, 10900726.5625, 10900858.142668022, 10901591.169410786, 10902148.153740425, 10902392.1875, 10903523.073807195, 10903928.936868828, 10905457.8125, 10905490.430809356, 10906024.227807408, 10906662.5, 10909240.093157582, 10911371.366450956, 10918339.564640723, 10919005.143854145, 10919068.75, 10919779.637254136, 10919836.98280336, 10920066.48590592, 10933557.8125, 10935571.875, 10940367.1875], [27.246224193900094, 36.691453810822914, 67.99597959393337, 24.012307924385937, 80.57623117616764, 85.9015361696651, 15.490705203363865, 72.08865841003296, 133.5835514815862, 26.306235165019903, 73.37898012616563, 12.567017644186627, 6.935661847855659, 23.21053890640051, 37.894513548549995, 13.940438383434573, 61.01612076471693, 59.25879096889454, 85.07941698140807, 9.359851409094036, 82.8033549738182, 37.18795967046617, 24.945973354438678, 18.061609925975883, 5.382927383943415, 60.095156028500924, 10.277702610128738, 143.01675296443392, 30.394523110096948, 8.35920115003714, 26.310440466468634, 70.26414121135174, 6.729645437086051, 109.11308326524222, 10.516013817212896, 34.28121883775359, 12.860140907244546, 85.39896591069075, 6.550880761832429, 15.408405104775722, 47.75245404350643, 6.050544651900954, 38.16568469720288, 13.672068339872283, 6.853957813423787, 18.971040753174908, 30.172679216212416, 25.754882837111335, 6.934613472529923, 39.991629770585206, 22.05178045596288, 104.32640814287375, 30.949032753483237, 65.87855192392094, 62.2878420704893, 44.7915351796068, 27.51443546581019, 80.16453413599051, 49.9092363371529, 15.512027698334956, 64.55978475855598, 29.804661074052103, 12.179822455173055, 26.996914243500783, 170.60605968502372, 24.264312918026917, 22.23477965861965, 17.315213164921243, 25.850294079919074, 7.454097287828985, 33.18214713578227, 51.09751841978339, 5.942700488234561, 25.506902804695155, 13.467947101614794, 23.727542723920685, 13.369746106106376, 47.03999503080834, 44.42764948211135, 18.148986970894356, 23.42041342215318, 12.565134183693887, 5.787704081321446, 74.61869799571039, 7.065663531258293, 8.222517319405402, 8.534556876593946, 90.59999537267805, 24.028161597383118, 25.938874719166183, 50.186538496785666, 50.244467223174624, 37.33632813906292, 54.36924580547674, 7.891931353764808, 22.71214208090471, 54.196705463393684, 7.205974850318028, 29.16408057069944, 18.46548113779935, 23.9498473481309, 49.812280698609726, 6.445937998300447, 85.31525521204847, 87.8410019953613, 7.492683729862178, 8.518756447292562, 63.8666454153285, 45.44885792206942, 64.52757551995825, 83.66080160517625, 34.73421772086926, 61.37323382512086, 42.12270928478382, 20.617323212260285, 26.952038690462274, 50.985161461673826, 39.91751031998087, 72.68166010541707, 18.73401181547839, 8.964005681577701, 14.86933764210661, 67.44544915368007, 5.258788941318716, 5.414169965517307, 61.69145866479614, 26.154847089233115, 15.555610211000825, 11.140235316533625, 36.535470956107886, 103.46242563728529, 17.152732869484048, 12.37288641076718, 8.368648836669212, 47.39175413408393, 16.66734814405217, 11.0700166354585, 31.902333872551043, 23.00134695462531, 117.58107184921761, 31.51979315034406, 19.292582096764008, 8.415661924317437, 38.42100791912786, 13.508116837759854, 120.74832378049487, 114.9931788189287, 28.17184843010046, 54.673344847679715, 32.89594951455956, 21.94690890595842, 26.62934779854115, 19.590930632316113, 13.275006748029794, 7.314463795136772, 47.56587091259177, 31.928611318625393, 12.539611947136718, 30.47859229403772, 13.564724975419404, 28.05533407987062, 24.32194936706622, 6.404623733593968, 6.791779537643539, 6.513051601192382, 77.0729193803065, 21.06712756580735, 8.169123492340063, 37.62723103302138, 66.10981436305751, 13.39221650392067, 20.36907502485708, 27.69950744609821, 16.499745845407876, 53.30592971017385, 30.00322837777401, 29.570684061029716, 11.085250223478305, 42.901429486088944, 19.177171452376093, 29.73362426396481, 41.63168369925142, 8.938060697683179, 5.455647667380685, 24.709786458405212, 37.62908326664318, 40.35885474920763, 54.61420962113564, 62.441364865462035, 72.91287701352925, 45.70514501943948, 11.421963438732792, 5.373959397757979, 48.96570645852032, 16.819528748025007, 21.305683708581547, 27.940830524816498, 8.702898661927644, 34.66116012972748, 6.99814962011397, 34.542346360054516, 21.08075088899844, 19.19059898735643, 36.64296370496267, 39.78644488699609, 20.9461767069901, 12.63772640800286, 21.913864844072727, 23.848000361370104, 24.10714532714571, 41.380130563936625, 69.6983016227242, 5.2217145823270945, 34.79359858164768, 38.85502029694536, 5.999704389857003, 29.369084500707547, 24.434782540196128, 7.77316687528204, 34.21265248583899, 29.22115354494951, 92.68196239677644, 5.482524185887314, 25.257747603846422, 31.114427346705128, 34.029748663467956, 8.590613454917003, 28.998354750452865, 35.97536152455839, 55.20564115842078, 75.4008327771988, 20.823362725214935, 38.861613485940815, 52.467352870178935, 63.39553161099333, 15.967926016947604, 13.13499680077795, 5.732156999724991, 37.57267122176637, 26.869230315254523, 5.220085799518185, 5.344586492494138, 69.40775027487813, 8.816853993313996, 11.534749146301875, 64.89549564528166, 7.125790566420885, 11.336013671217927, 5.889001519113574, 26.38468658362252, 72.48541492764471, 64.61233341737888, 70.5112805038315, 11.26597072968764, 71.60310425459055, 5.371321032253112, 85.86339612171508, 75.90363990955849, 38.91929223121084, 8.178897622909192, 68.07943612693374, 13.63122964781389, 29.192009190227385, 75.02166448949757, 26.791913288627345, 5.033067849664257, 14.680430830758777, 64.42633627971519, 25.40568689042459, 17.35322231688381, 16.169849243263148, 19.02586860488159, 55.71089953463638, 66.6038813780363, 19.01471586961262, 14.920171374544058, 51.3848543335305, 20.04220512135212, 26.181141004266532, 81.65351537192699, 45.71103573243414, 7.857823489569259, 19.335381363546436, 75.51124432857904, 85.09569212959272, 17.110198174286857, 24.627988044482752, 41.16562972316005, 20.29916876673091, 19.81779662792289, 48.099649222635904, 14.241167511195522, 56.07428717096841, 15.301872839665936, 24.674930922871482, 97.01940367015956, 9.74686730420844, 33.91878232087587, 17.58783475907725, 90.21882732885967, 90.44325851358025, 59.49966218015038, 80.46304903046766, 19.427773479014427, 46.72071645451054, 40.30346748484514, 5.522841780883175, 22.014154536021778, 22.3752207186559, 43.932253426096466, 59.537320308090266, 13.24325200947274, 73.07532794912566, 43.66371752861445, 7.727184553709154, 76.95240088447521, 70.62821943521942, 68.19963265737167, 5.446370000847022, 65.06541093491084, 34.77986852736485, 60.22023594508158, 82.74499866836926, 54.205113056789905, 10.387062707242464, 59.19754837317255, 9.795435276871123, 9.74958125526088, 50.67034578998978, 14.753392842033158, 58.11749997340475, 7.367772908687972, 83.17670962677244, 55.46491862670133, 29.62252728724479])
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)