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 = 45233
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);
([3107329.6875, 3125158.393152776, 3141018.7668980244, 3162889.652052848, 3167255.4676465048, 3178984.0164214284, 3184208.5798834823, 3186407.8125, 3228769.2576153283, 3229403.4617480338, 3238120.1950465934, 3241279.6875, 3246098.4375, 3248584.164262074, 3249754.5631445735, 3252107.5856488226, 3252778.125, 3253804.6875, 3255121.3117518364, 3256696.712525173, 3258326.5625, 3258601.785649584, 3261478.125, 3262517.1875, 3264501.5625, 3265426.5208231066, 3272988.7645438677, 3275120.736850414, 3283826.271597386, 3287864.6246628105, 3294707.787796333, 3295003.8114289856, 3301652.554816296, 3303245.5256199525, 3303528.0307413745, 3304280.8407171397, 3305332.5147486753, 3306118.458159921, 3306550.332468805, 3306834.8232875727, 3306838.894030308, 3308248.2775432654, 3308932.730778166, 3309362.2635627068, 3310486.9337808574, 3312316.893819013, 3314708.745228674, 3315624.9882343416, 3321124.4189796722, 3321839.3826993224, 3326301.2622666955, 3327870.344195232, 3333002.6908684783, 3335573.5784514993, 3341621.561544343, 3352159.375, 3352305.51110315, 3365643.5022354447, 3368667.0436193896, 3372960.474831824, 3378675.4771962366, 3389056.129001577, 3389478.344656627, 3390163.450981857, 3396479.550034871, 3400604.1104716435, 3400706.3995709447, 3438229.6875, 3450303.3004040685, 3486672.7685393468, 3577016.663955689, 3590960.750528405, 3596556.25, 3626190.625, 3629587.17300188, 3674224.4219332994, 3674960.9375, 3683362.932243405, 3689832.775080618, 3690407.566787683, 3690418.5561287217, 3691249.183512621, 3693515.9674154846, 3693564.6373316175, 3701695.088777757, 3701908.409742529, 3714328.125, 3717104.6875, 3719579.6875, 3722108.818474861, 3725806.25, 3729775.712043867, 3738340.702788229, 3738341.8178337044, 3743809.375, 3743820.084736835, 3746621.935186685, 3750428.1469570324, 3761151.249944461, 3772078.553033549, 3776230.841401362, 3784511.669103861, 3789381.862483966, 3800007.043978287, 3803901.4478029087, 3806258.9247535737, 3809722.3095370163, 3822187.549416446, 3822545.5633686827, 3822562.0224481067, 3823682.8125, 3830980.3931159987, 3831045.70008463, 3835014.2558311243, 3835860.0217136582, 3837672.9102422753, 3856517.8202536544, 3861145.1895656046, 3863441.5925142076, 3863793.0771499206, 3870481.25, 3872723.3361144806, 3875155.919176906, 3886676.436289556, 3890858.9619783955, 3900871.751940584, 3901706.1068713916, 3904496.875, 3908842.587711343, 3912890.4432962146, 3925068.4434710285, 3928525.0, 3945253.7857238175, 3956383.67724779, 3960864.0510495775, 3966133.4207934523, 3983418.850595587, 3996469.5420354838, 4003671.4084276822, 4004134.375, 4004173.2608075645, 4005300.8131723013, 4005751.7860170235, 4008093.549072218, 4009684.375, 4010082.858598523, 4013660.7042244333, 4017510.1630586246, 4017531.4932016805, 4020743.75, 4043565.5488436264, 4045688.7777501172, 4046699.9806132633, 4052190.5748950285, 4058254.112606466, 4061243.75, 4065571.6754390174, 4070922.106855205, 4072045.9918064126, 4075398.4375, 4081871.5354979252, 4089605.8576134164, 4090918.75, 4093402.579275425, 4094530.709435368, 4095942.1875, 4106523.2412542133, 4107406.13692919, 4112591.9665315016, 4116116.97010937, 4118000.646375776, 4120227.4582143826, 4126807.8125, 4133145.3125, 4133470.0763723236, 4138384.375, 4138451.580661351, 4140464.265071749, 4142380.7264262126, 4143284.879397022, 4147781.221811356, 4153793.59597076, 4157177.571143602, 4159880.5010737637, 4162957.8948232452, 4163709.3627250884, 4166975.2556300606, 4169871.764090308, 4170050.9248878993, 4170945.3125, 4171974.5736870323, 4172609.0080883363, 4172939.0625, 4174101.2109312774, 4175938.9090507594, 4177646.4869095697, 4177707.0575248306, 4180376.0308369435, 4182101.328509803, 4182796.202687059, 4183515.199542505, 4184969.617704594, 4195853.291256231, 4200814.0625, 4202456.164948572, 4203222.890745074, 4205923.403559781, 4208316.78214368, 4208623.636464817, 4218065.141134797, 4219202.100205539, 4219772.349438062, 4220128.125, 4220880.342882164, 4229161.475483041, 4233272.204929177, 4233582.8125, 4233759.102688033, 4235253.194024816, 4242077.197777614, 4242758.540902953, 4244433.711498806, 4244632.351062406, 4252846.351589247, 4269148.106239568, 4280457.761300022, 4281205.294017945, 4282428.125, 4283822.046270344, 4284035.252306497, 4288123.4375, 4289084.191493793, 4297139.420817729, 4304116.047464145, 4320835.514258292, 4329825.3120877305, 4330975.693899238, 4333911.658346567, 4334963.829167747, 4336665.500874741, 4338532.20248143, 4341171.120391229, 4341726.123631939, 4341960.358322549, 4359329.6875, 4371676.149603213, 4374954.6875, 4376248.4375, 4376444.658270732, 4376446.094667596, 4407577.625174329, 4422430.012967686, 4425820.069346194, 4426134.498630872, 4430955.935836331, 4434046.879501217, 4434557.767538908, 4438806.774661661, 4448800.233300768, 4451283.348293066, 4541971.777574807, 4609130.966541207, 5075358.981781339, 5078631.25, 5266584.375, 5309534.024937367, 5430477.619089356, 5693916.450183831, 5906598.24032176, 5929062.842563689, 6062419.900035021, 6063948.189576217, 6093793.105413478, 6111181.67950833, 6221908.74901652, 6255007.61678317, 6320649.984711036, 6376857.61952184, 6423670.04796829, 6469077.4112435235, 6537594.31640891, 6767550.675188413, 6781947.997297298, 6805882.729059359, 6844202.048473855, 6894561.990977756, 6898294.272374191, 6941799.2637839, 6994003.739595951, 6994056.4383279905, 6995493.295706351, 7010558.194976802, 7013780.103668437, 7018926.407829302, 7072269.902476786, 7088943.172156936, 7114747.186954612, 7125874.198235025, 7126366.917011901, 7126666.397401532, 7141193.51017181, 7152674.468763976, 7157068.32016194, 7215611.960771638, 7246807.361659706, 7281281.120409048, 7288984.375, 7303971.875, 7334034.332551204, 7503268.254269949, 7505685.422820276, 7613912.766534543, 7633761.353528819, 7709844.447181808, 7752096.761797701, 7813354.290708979, 7854412.5, 7878319.260248612, 8152251.880393345, 9197489.020855572, 9385312.191081097, 9395610.954723688, 9410874.281789765, 9496432.893113356, 9496478.386032922, 9514621.875, 9520384.968860649, 9721959.503815144, 10328696.875, 10606887.587733667, 10619896.875, 10637264.934952756, 10639716.638737429, 10780894.822239853, 10800799.552572917, 10801047.00918085, 10802355.944774846, 10802471.482926656, 10802477.860707635, 10803628.300383758, 10804578.746672655, 10804877.03810125, 10808654.708879558, 10809353.093259944, 10814305.413680498, 10821568.75, 10823335.557946429, 10824094.626329074, 10829415.483312324, 10829980.593161702, 10830390.292470483, 10830598.547831072, 10831145.34051913, 10831776.57120265, 10832149.254523417, 10832829.6875, 10833020.844385052, 10833050.0, 10833073.020745283, 10833204.413998595, 10833310.506513055, 10833719.07443924, 10833987.121668877, 10834455.440844355, 10834668.522996709, 10834738.016825927, 10835126.137352897, 10835126.5625, 10835237.5, 10835494.799516693, 10835526.086516265, 10835945.521662267, 10836362.78139419, 10836760.9375, 10845473.118483875, 10879221.518463977, 10880516.594243014, 10881885.68805563], [75.1404703007961, 9.875897748713244, 16.950789814887514, 17.792752964789642, 84.72749247109641, 73.9033013192517, 43.121888621028226, 60.581977566160276, 33.122899526368, 96.4228114554134, 14.478868656166213, 71.45831827331519, 42.800274614340445, 74.5194406119524, 20.810234917415343, 7.52319966516929, 96.70237690871011, 73.27595229096441, 20.88454552229696, 6.461919965535392, 78.11807879490388, 31.7814523038873, 57.18742639918304, 72.88098240999742, 29.90728236901546, 5.935784249787432, 5.913871032050728, 43.49127960107117, 27.335283007298678, 107.21960178477913, 114.04012701394211, 20.73542782920617, 6.19775085147816, 5.625944261606568, 67.32789369941138, 22.44844277534571, 42.05848542915888, 13.274463620486573, 16.38069411909122, 11.909022135713025, 38.19161377795534, 91.53405280085552, 9.26324563325095, 67.19107635672464, 7.410526504238314, 7.500363169483896, 23.084418857858672, 9.321474421194242, 8.001498036268888, 6.122042342050086, 10.68875464953398, 22.531834459747184, 130.24784783095765, 11.355409936915665, 30.146022567434745, 60.54437994290947, 6.9398810561951425, 29.7495852486698, 10.910020824911365, 38.125376848568635, 17.13687793298704, 14.499540188624707, 5.958765572681569, 13.030659779629136, 49.018454441266755, 20.757640380228384, 73.1430385793994, 59.35740285547766, 23.904247603138955, 54.852774388497394, 21.261404968915542, 25.31051835457304, 75.23145793768926, 57.67821668287869, 89.06117657228822, 20.748156830186414, 60.95946254005261, 29.992068310421256, 72.09729909152004, 74.99191518219448, 31.261835024635076, 8.724851446206719, 31.631356027939674, 28.121437713872837, 5.037793843738283, 17.84010706159134, 36.33614629920547, 54.59484313047134, 40.35590609318959, 20.947174097776813, 50.67854385023464, 44.564661011811324, 9.398055184002178, 88.9456211876905, 31.730987170875302, 21.322554580648877, 15.175984900991056, 15.025865033556329, 32.88967028857515, 11.869863982420041, 13.583543126243898, 12.502791551533612, 56.24703657743199, 19.176188177166036, 26.4463803831533, 38.152271671256436, 11.882393258143264, 70.18840325178645, 40.128285904178796, 7.001332043469763, 43.639041574820645, 5.654310772456447, 11.792861571532079, 33.586737025875394, 18.15291089894718, 53.49651846143238, 12.285328190652288, 94.46637899279789, 87.27680452943842, 46.5998229681294, 37.61829614045855, 55.001962034912225, 23.36484528738236, 20.429040372350073, 5.904226458316254, 31.572272377930517, 47.71008542662105, 87.06715190474792, 24.64380764717261, 107.2874286983162, 19.4882516763468, 101.8549546816439, 15.876803375316694, 24.90738908983301, 13.53348959689974, 12.233293298353258, 5.537982762956421, 5.22408138906821, 7.442775212153702, 74.6162380910711, 5.454233466468665, 10.128742963136473, 14.95188381875069, 25.10449541764492, 63.45164442436041, 15.120175544458881, 106.89136562641347, 19.132139783100786, 15.957265296211064, 45.574117936158665, 109.16823472436681, 23.94751516022428, 38.527461796619335, 27.570906913895367, 13.125505967593384, 48.10492351105251, 15.797550763948085, 6.524061328280128, 29.957143527287506, 33.92594188754503, 6.05349149529632, 31.090257040584493, 79.49231754258822, 8.908985271894089, 5.893672918722974, 110.62052570457831, 15.472195902430617, 77.18421976393714, 120.77628964652881, 33.430200436844345, 40.30385868876021, 71.12180924147711, 65.78787045468874, 106.59734556437186, 9.139417866169719, 60.40176714854761, 7.126233921512015, 5.8291224425136186, 21.26111882397367, 103.60788449549467, 17.03200421754554, 20.565535408923996, 20.972166486329648, 94.89862088514788, 15.264853984164459, 83.32271161058489, 11.552250987450144, 35.038510308493805, 20.222046481244462, 60.722612528977436, 7.013721743920445, 27.895979392790785, 58.756673729281935, 83.2239776253827, 15.645744081590419, 22.687152778129118, 6.012956296546086, 8.918970882054955, 7.520744467753998, 19.45450469446439, 13.534944467806003, 110.31331338818109, 89.3750527127962, 74.4803541547939, 26.9486793008053, 47.63563428596153, 26.580197507669855, 13.592948624727113, 20.898014538855612, 5.6766403271795545, 81.19916801949302, 67.89759786986906, 28.631687352749942, 76.63327681815466, 17.48356409782257, 11.685785086431792, 76.4433400894653, 5.4501987446496925, 11.385476307973143, 78.84729440154582, 18.70241200372942, 12.89950169320969, 29.817459239300273, 41.84740193920634, 13.813228933625322, 18.70662532723228, 5.860263089962685, 30.372766785379582, 11.406399104493572, 12.845932854488561, 70.39460027422142, 7.538188197264218, 94.44315019217629, 44.374949623393725, 67.23141220218743, 16.28132285512244, 97.13986358828596, 46.62735545495329, 24.641397336280303, 6.7389763738431, 29.33444297095956, 83.07853097399483, 32.095159062460766, 20.738024078407634, 62.17930933847456, 13.571104241546822, 36.260153614648, 50.432364636222474, 12.922604878801534, 15.744636454055637, 10.427049279170081, 9.622650786818632, 50.01624826715252, 5.071151392049201, 9.079174002749646, 8.288959079695847, 20.16134220791884, 22.59124864991506, 15.9121284599782, 13.612421527459505, 23.386243599521265, 23.964357505419905, 10.564089069545725, 39.26582691558876, 57.05359908985469, 5.909488902801315, 21.434340347928995, 12.71991613004124, 5.922416046592423, 7.732021397223279, 210.48041098426393, 29.911273717249394, 20.24462186667467, 16.87743796691525, 20.32212342784574, 34.197756038630864, 9.318508864379927, 14.253673452355503, 34.183487905570104, 34.87790942677114, 17.652212564885897, 14.789122448872511, 10.502940086474103, 52.80511500160857, 65.99201854265634, 107.49508651996892, 60.529355272295675, 105.06592579998028, 20.18678768728839, 5.828047589349488, 59.62899608597813, 7.225758672926852, 16.806735764788918, 25.803394675124135, 22.440215700028322, 13.117791064324908, 41.03106284735288, 61.985854639277534, 7.508251264404732, 12.596051895494304, 24.551036739574347, 63.52124742953542, 43.65196669143684, 20.346455529735575, 24.155665664909975, 25.26608606854284, 32.76331664288174, 46.93899321308096, 6.261850123860991, 63.772435578721144, 103.56281542627687, 5.962957993279881, 49.695005251119504, 9.999792198614411, 49.65657500189138, 83.17996413298305, 188.25200287216083, 9.80363619191805, 6.308215097332402, 66.70287874837382, 16.14947608925147, 17.012259552390812, 41.56852214967478, 11.256092687426053, 9.562325127630688, 46.491537575794986, 17.819239986290384, 87.71520316455201, 32.71390077435509, 68.80768223614481, 96.54549824353563, 6.019164284719584, 70.8214504791885, 45.31956822783317, 56.16805951286429, 5.206853970301101, 46.318459149973705, 10.56559482614759, 38.452883526327525, 5.134268242899093, 6.155225026830717, 22.925826296641496, 7.610988651193684, 11.078454847363302, 49.37661139300806, 53.6601095874923, 10.582102277007438, 59.08383639049697, 49.03532852320161, 5.666192506358569, 13.80936784964638, 21.091830910851293, 26.797088213774867, 11.1413369072643, 10.13312518165367, 57.77854144712291, 8.589409906232934, 29.137934553198434, 10.533306424712263, 10.725523165941196, 14.455372864630867, 15.516847170773204, 8.096153984055448, 18.879002786168662, 7.523147311584292, 17.360787742034564, 49.40813025339453, 39.03299622985623, 41.121108067741616, 27.736471233335322, 56.872133111738975, 9.51475355123709, 8.441208301237776, 54.822243984816076, 32.47404327915076, 17.501349533269913, 31.1295707230462, 64.46386196058911])
caption, xmean,count, xle, Etot = energy_spectrum(E_tot)
hist_file(E_hist, xmean, count, caption);
([3107329.6875, 3125158.393152776, 3141018.7668980244, 3162889.652052848, 3167255.4676465048, 3178984.0164214284, 3184208.5798834823, 3186407.8125, 3228769.2576153283, 3229403.4617480338, 3238120.1950465934, 3241279.6875, 3246098.4375, 3248584.164262074, 3249754.5631445735, 3252107.5856488226, 3252778.125, 3253804.6875, 3255121.3117518364, 3256696.712525173, 3258326.5625, 3258601.785649584, 3261478.125, 3262517.1875, 3264501.5625, 3265426.5208231066, 3272988.7645438677, 3275120.736850414, 3283826.271597386, 3287864.6246628105, 3294707.787796333, 3295003.8114289856, 3301652.554816296, 3303245.5256199525, 3303528.0307413745, 3304280.8407171397, 3305332.5147486753, 3306118.458159921, 3306550.332468805, 3306834.8232875727, 3306838.894030308, 3308248.2775432654, 3308932.730778166, 3309362.2635627068, 3310486.9337808574, 3312316.893819013, 3314708.745228674, 3315624.9882343416, 3321124.4189796722, 3321839.3826993224, 3326301.2622666955, 3327870.344195232, 3333002.6908684783, 3335573.5784514993, 3341621.561544343, 3352159.375, 3352305.51110315, 3365643.5022354447, 3368667.0436193896, 3372960.474831824, 3378675.4771962366, 3389056.129001577, 3389478.344656627, 3390163.450981857, 3396479.550034871, 3400604.1104716435, 3400706.3995709447, 3438229.6875, 3450303.3004040685, 3486672.7685393468, 3577016.663955689, 3590960.750528405, 3596556.25, 3626190.625, 3629587.17300188, 3674224.4219332994, 3674960.9375, 3683362.932243405, 3689832.775080618, 3690407.566787683, 3690418.5561287217, 3691249.183512621, 3693515.9674154846, 3693564.6373316175, 3701695.088777757, 3701908.409742529, 3714328.125, 3717104.6875, 3719579.6875, 3722108.818474861, 3725806.25, 3729775.712043867, 3738340.702788229, 3738341.8178337044, 3743809.375, 3743820.084736835, 3746621.935186685, 3750428.1469570324, 3761151.249944461, 3772078.553033549, 3776230.841401362, 3784511.669103861, 3789381.862483966, 3800007.043978287, 3803901.4478029087, 3806258.9247535737, 3809722.3095370163, 3822187.549416446, 3822545.5633686827, 3822562.0224481067, 3823682.8125, 3830980.3931159987, 3831045.70008463, 3835014.2558311243, 3835860.0217136582, 3837672.9102422753, 3856517.8202536544, 3861145.1895656046, 3863441.5925142076, 3863793.0771499206, 3870481.25, 3872723.3361144806, 3875155.919176906, 3886676.436289556, 3890858.9619783955, 3900871.751940584, 3901706.1068713916, 3904496.875, 3908842.587711343, 3912890.4432962146, 3925068.4434710285, 3928525.0, 3945253.7857238175, 3956383.67724779, 3960864.0510495775, 3966133.4207934523, 3983418.850595587, 3996469.5420354838, 4003671.4084276822, 4004134.375, 4004173.2608075645, 4005300.8131723013, 4005751.7860170235, 4008093.549072218, 4009684.375, 4010082.858598523, 4013660.7042244333, 4017510.1630586246, 4017531.4932016805, 4020743.75, 4043565.5488436264, 4045688.7777501172, 4046699.9806132633, 4052190.5748950285, 4058254.112606466, 4061243.75, 4065571.6754390174, 4070922.106855205, 4072045.9918064126, 4075398.4375, 4081871.5354979252, 4089605.8576134164, 4090918.75, 4093402.579275425, 4094530.709435368, 4095942.1875, 4106523.2412542133, 4107406.13692919, 4112591.9665315016, 4116116.97010937, 4118000.646375776, 4120227.4582143826, 4126807.8125, 4133145.3125, 4133470.0763723236, 4138384.375, 4138451.580661351, 4140464.265071749, 4142380.7264262126, 4143284.879397022, 4147781.221811356, 4153793.59597076, 4157177.571143602, 4159880.5010737637, 4162957.8948232452, 4163709.3627250884, 4166975.2556300606, 4169871.764090308, 4170050.9248878993, 4170945.3125, 4171974.5736870323, 4172609.0080883363, 4172939.0625, 4174101.2109312774, 4175938.9090507594, 4177646.4869095697, 4177707.0575248306, 4180376.0308369435, 4182101.328509803, 4182796.202687059, 4183515.199542505, 4184969.617704594, 4195853.291256231, 4200814.0625, 4202456.164948572, 4203222.890745074, 4205923.403559781, 4208316.78214368, 4208623.636464817, 4218065.141134797, 4219202.100205539, 4219772.349438062, 4220128.125, 4220880.342882164, 4229161.475483041, 4233272.204929177, 4233582.8125, 4233759.102688033, 4235253.194024816, 4242077.197777614, 4242758.540902953, 4244433.711498806, 4244632.351062406, 4252846.351589247, 4269148.106239568, 4280457.761300022, 4281205.294017945, 4282428.125, 4283822.046270344, 4284035.252306497, 4288123.4375, 4289084.191493793, 4297139.420817729, 4304116.047464145, 4320835.514258292, 4329825.3120877305, 4330975.693899238, 4333911.658346567, 4334963.829167747, 4336665.500874741, 4338532.20248143, 4341171.120391229, 4341726.123631939, 4341960.358322549, 4359329.6875, 4371676.149603213, 4374954.6875, 4376248.4375, 4376444.658270732, 4376446.094667596, 4407577.625174329, 4422430.012967686, 4425820.069346194, 4426134.498630872, 4430955.935836331, 4434046.879501217, 4434557.767538908, 4438806.774661661, 4448800.233300768, 4451283.348293066, 4541971.777574807, 4609130.966541207, 5075358.981781339, 5078631.25, 5266584.375, 5309534.024937367, 5430477.619089356, 5693916.450183831, 5906598.24032176, 5929062.842563689, 6062419.900035021, 6063948.189576217, 6093793.105413478, 6111181.67950833, 6221908.74901652, 6255007.61678317, 6320649.984711036, 6376857.61952184, 6423670.04796829, 6469077.4112435235, 6537594.31640891, 6767550.675188413, 6781947.997297298, 6805882.729059359, 6844202.048473855, 6894561.990977756, 6898294.272374191, 6941799.2637839, 6994003.739595951, 6994056.4383279905, 6995493.295706351, 7010558.194976802, 7013780.103668437, 7018926.407829302, 7072269.902476786, 7088943.172156936, 7114747.186954612, 7125874.198235025, 7126366.917011901, 7126666.397401532, 7141193.51017181, 7152674.468763976, 7157068.32016194, 7215611.960771638, 7246807.361659706, 7281281.120409048, 7288984.375, 7303971.875, 7334034.332551204, 7503268.254269949, 7505685.422820276, 7613912.766534543, 7633761.353528819, 7709844.447181808, 7752096.761797701, 7813354.290708979, 7854412.5, 7878319.260248612, 8152251.880393345, 9197489.020855572, 9385312.191081097, 9395610.954723688, 9410874.281789765, 9496432.893113356, 9496478.386032922, 9514621.875, 9520384.968860649, 9721959.503815144, 10328696.875, 10606887.587733667, 10619896.875, 10637264.934952756, 10639716.638737429, 10780894.822239853, 10800799.552572917, 10801047.00918085, 10802355.944774846, 10802471.482926656, 10802477.860707635, 10803628.300383758, 10804578.746672655, 10804877.03810125, 10808654.708879558, 10809353.093259944, 10814305.413680498, 10821568.75, 10823335.557946429, 10824094.626329074, 10829415.483312324, 10829980.593161702, 10830390.292470483, 10830598.547831072, 10831145.34051913, 10831776.57120265, 10832149.254523417, 10832829.6875, 10833020.844385052, 10833050.0, 10833073.020745283, 10833204.413998595, 10833310.506513055, 10833719.07443924, 10833987.121668877, 10834455.440844355, 10834668.522996709, 10834738.016825927, 10835126.137352897, 10835126.5625, 10835237.5, 10835494.799516693, 10835526.086516265, 10835945.521662267, 10836362.78139419, 10836760.9375, 10845473.118483875, 10879221.518463977, 10880516.594243014, 10881885.68805563], [75.1404703007961, 9.875897748713244, 16.950789814887514, 17.792752964789642, 84.72749247109641, 73.9033013192517, 43.121888621028226, 60.581977566160276, 33.122899526368, 96.4228114554134, 14.478868656166213, 71.45831827331519, 42.800274614340445, 74.5194406119524, 20.810234917415343, 7.52319966516929, 96.70237690871011, 73.27595229096441, 20.88454552229696, 6.461919965535392, 78.11807879490388, 31.7814523038873, 57.18742639918304, 72.88098240999742, 29.90728236901546, 5.935784249787432, 5.913871032050728, 43.49127960107117, 27.335283007298678, 107.21960178477913, 114.04012701394211, 20.73542782920617, 6.19775085147816, 5.625944261606568, 67.32789369941138, 22.44844277534571, 42.05848542915888, 13.274463620486573, 16.38069411909122, 11.909022135713025, 38.19161377795534, 91.53405280085552, 9.26324563325095, 67.19107635672464, 7.410526504238314, 7.500363169483896, 23.084418857858672, 9.321474421194242, 8.001498036268888, 6.122042342050086, 10.68875464953398, 22.531834459747184, 130.24784783095765, 11.355409936915665, 30.146022567434745, 60.54437994290947, 6.9398810561951425, 29.7495852486698, 10.910020824911365, 38.125376848568635, 17.13687793298704, 14.499540188624707, 5.958765572681569, 13.030659779629136, 49.018454441266755, 20.757640380228384, 73.1430385793994, 59.35740285547766, 23.904247603138955, 54.852774388497394, 21.261404968915542, 25.31051835457304, 75.23145793768926, 57.67821668287869, 89.06117657228822, 20.748156830186414, 60.95946254005261, 29.992068310421256, 72.09729909152004, 74.99191518219448, 31.261835024635076, 8.724851446206719, 31.631356027939674, 28.121437713872837, 5.037793843738283, 17.84010706159134, 36.33614629920547, 54.59484313047134, 40.35590609318959, 20.947174097776813, 50.67854385023464, 44.564661011811324, 9.398055184002178, 88.9456211876905, 31.730987170875302, 21.322554580648877, 15.175984900991056, 15.025865033556329, 32.88967028857515, 11.869863982420041, 13.583543126243898, 12.502791551533612, 56.24703657743199, 19.176188177166036, 26.4463803831533, 38.152271671256436, 11.882393258143264, 70.18840325178645, 40.128285904178796, 7.001332043469763, 43.639041574820645, 5.654310772456447, 11.792861571532079, 33.586737025875394, 18.15291089894718, 53.49651846143238, 12.285328190652288, 94.46637899279789, 87.27680452943842, 46.5998229681294, 37.61829614045855, 55.001962034912225, 23.36484528738236, 20.429040372350073, 5.904226458316254, 31.572272377930517, 47.71008542662105, 87.06715190474792, 24.64380764717261, 107.2874286983162, 19.4882516763468, 101.8549546816439, 15.876803375316694, 24.90738908983301, 13.53348959689974, 12.233293298353258, 5.537982762956421, 5.22408138906821, 7.442775212153702, 74.6162380910711, 5.454233466468665, 10.128742963136473, 14.95188381875069, 25.10449541764492, 63.45164442436041, 15.120175544458881, 106.89136562641347, 19.132139783100786, 15.957265296211064, 45.574117936158665, 109.16823472436681, 23.94751516022428, 38.527461796619335, 27.570906913895367, 13.125505967593384, 48.10492351105251, 15.797550763948085, 6.524061328280128, 29.957143527287506, 33.92594188754503, 6.05349149529632, 31.090257040584493, 79.49231754258822, 8.908985271894089, 5.893672918722974, 110.62052570457831, 15.472195902430617, 77.18421976393714, 120.77628964652881, 33.430200436844345, 40.30385868876021, 71.12180924147711, 65.78787045468874, 106.59734556437186, 9.139417866169719, 60.40176714854761, 7.126233921512015, 5.8291224425136186, 21.26111882397367, 103.60788449549467, 17.03200421754554, 20.565535408923996, 20.972166486329648, 94.89862088514788, 15.264853984164459, 83.32271161058489, 11.552250987450144, 35.038510308493805, 20.222046481244462, 60.722612528977436, 7.013721743920445, 27.895979392790785, 58.756673729281935, 83.2239776253827, 15.645744081590419, 22.687152778129118, 6.012956296546086, 8.918970882054955, 7.520744467753998, 19.45450469446439, 13.534944467806003, 110.31331338818109, 89.3750527127962, 74.4803541547939, 26.9486793008053, 47.63563428596153, 26.580197507669855, 13.592948624727113, 20.898014538855612, 5.6766403271795545, 81.19916801949302, 67.89759786986906, 28.631687352749942, 76.63327681815466, 17.48356409782257, 11.685785086431792, 76.4433400894653, 5.4501987446496925, 11.385476307973143, 78.84729440154582, 18.70241200372942, 12.89950169320969, 29.817459239300273, 41.84740193920634, 13.813228933625322, 18.70662532723228, 5.860263089962685, 30.372766785379582, 11.406399104493572, 12.845932854488561, 70.39460027422142, 7.538188197264218, 94.44315019217629, 44.374949623393725, 67.23141220218743, 16.28132285512244, 97.13986358828596, 46.62735545495329, 24.641397336280303, 6.7389763738431, 29.33444297095956, 83.07853097399483, 32.095159062460766, 20.738024078407634, 62.17930933847456, 13.571104241546822, 36.260153614648, 50.432364636222474, 12.922604878801534, 15.744636454055637, 10.427049279170081, 9.622650786818632, 50.01624826715252, 5.071151392049201, 9.079174002749646, 8.288959079695847, 20.16134220791884, 22.59124864991506, 15.9121284599782, 13.612421527459505, 23.386243599521265, 23.964357505419905, 10.564089069545725, 39.26582691558876, 57.05359908985469, 5.909488902801315, 21.434340347928995, 12.71991613004124, 5.922416046592423, 7.732021397223279, 210.48041098426393, 29.911273717249394, 20.24462186667467, 16.87743796691525, 20.32212342784574, 34.197756038630864, 9.318508864379927, 14.253673452355503, 34.183487905570104, 34.87790942677114, 17.652212564885897, 14.789122448872511, 10.502940086474103, 52.80511500160857, 65.99201854265634, 107.49508651996892, 60.529355272295675, 105.06592579998028, 20.18678768728839, 5.828047589349488, 59.62899608597813, 7.225758672926852, 16.806735764788918, 25.803394675124135, 22.440215700028322, 13.117791064324908, 41.03106284735288, 61.985854639277534, 7.508251264404732, 12.596051895494304, 24.551036739574347, 63.52124742953542, 43.65196669143684, 20.346455529735575, 24.155665664909975, 25.26608606854284, 32.76331664288174, 46.93899321308096, 6.261850123860991, 63.772435578721144, 103.56281542627687, 5.962957993279881, 49.695005251119504, 9.999792198614411, 49.65657500189138, 83.17996413298305, 188.25200287216083, 9.80363619191805, 6.308215097332402, 66.70287874837382, 16.14947608925147, 17.012259552390812, 41.56852214967478, 11.256092687426053, 9.562325127630688, 46.491537575794986, 17.819239986290384, 87.71520316455201, 32.71390077435509, 68.80768223614481, 96.54549824353563, 6.019164284719584, 70.8214504791885, 45.31956822783317, 56.16805951286429, 5.206853970301101, 46.318459149973705, 10.56559482614759, 38.452883526327525, 5.134268242899093, 6.155225026830717, 22.925826296641496, 7.610988651193684, 11.078454847363302, 49.37661139300806, 53.6601095874923, 10.582102277007438, 59.08383639049697, 49.03532852320161, 5.666192506358569, 13.80936784964638, 21.091830910851293, 26.797088213774867, 11.1413369072643, 10.13312518165367, 57.77854144712291, 8.589409906232934, 29.137934553198434, 10.533306424712263, 10.725523165941196, 14.455372864630867, 15.516847170773204, 8.096153984055448, 18.879002786168662, 7.523147311584292, 17.360787742034564, 49.40813025339453, 39.03299622985623, 41.121108067741616, 27.736471233335322, 56.872133111738975, 9.51475355123709, 8.441208301237776, 54.822243984816076, 32.47404327915076, 17.501349533269913, 31.1295707230462, 64.46386196058911])
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);
([3107329.6875, 3125158.393152776, 3141018.7668980244, 3162889.652052848, 3167255.4676465048, 3178984.0164214284, 3184208.5798834823, 3186407.8125, 3228769.2576153283, 3229403.4617480338, 3238120.1950465934, 3241279.6875, 3246098.4375, 3248584.164262074, 3249754.5631445735, 3252107.5856488226, 3252778.125, 3253804.6875, 3255121.3117518364, 3256696.712525173, 3258326.5625, 3258601.785649584, 3261478.125, 3262517.1875, 3264501.5625, 3265426.5208231066, 3272988.7645438677, 3275120.736850414, 3283826.271597386, 3287864.6246628105, 3294707.787796333, 3295003.8114289856, 3301652.554816296, 3303245.5256199525, 3303528.0307413745, 3304280.8407171397, 3305332.5147486753, 3306118.458159921, 3306550.332468805, 3306834.8232875727, 3306838.894030308, 3308248.2775432654, 3308932.730778166, 3309362.2635627068, 3310486.9337808574, 3312316.893819013, 3314708.745228674, 3315624.9882343416, 3321124.4189796722, 3321839.3826993224, 3326301.2622666955, 3327870.344195232, 3333002.6908684783, 3335573.5784514993, 3341621.561544343, 3352159.375, 3352305.51110315, 3365643.5022354447, 3368667.0436193896, 3372960.474831824, 3378675.4771962366, 3389056.129001577, 3389478.344656627, 3390163.450981857, 3396479.550034871, 3400604.1104716435, 3400706.3995709447, 3438229.6875, 3450303.3004040685, 3486672.7685393468, 3577016.663955689, 3590960.750528405, 3596556.25, 3626190.625, 3629587.17300188, 3674224.4219332994, 3674960.9375, 3683362.932243405, 3689832.775080618, 3690407.566787683, 3690418.5561287217, 3691249.183512621, 3693515.9674154846, 3693564.6373316175, 3701695.088777757, 3701908.409742529, 3714328.125, 3717104.6875, 3719579.6875, 3722108.818474861, 3725806.25, 3729775.712043867, 3738340.702788229, 3738341.8178337044, 3743809.375, 3743820.084736835, 3746621.935186685, 3750428.1469570324, 3761151.249944461, 3772078.553033549, 3776230.841401362, 3784511.669103861, 3789381.862483966, 3800007.043978287, 3803901.4478029087, 3806258.9247535737, 3809722.3095370163, 3822187.549416446, 3822545.5633686827, 3822562.0224481067, 3823682.8125, 3830980.3931159987, 3831045.70008463, 3835014.2558311243, 3835860.0217136582, 3837672.9102422753, 3856517.8202536544, 3861145.1895656046, 3863441.5925142076, 3863793.0771499206, 3870481.25, 3872723.3361144806, 3875155.919176906, 3886676.436289556, 3890858.9619783955, 3900871.751940584, 3901706.1068713916, 3904496.875, 3908842.587711343, 3912890.4432962146, 3925068.4434710285, 3928525.0, 3945253.7857238175, 3956383.67724779, 3960864.0510495775, 3966133.4207934523, 3983418.850595587, 3996469.5420354838, 4003671.4084276822, 4004134.375, 4004173.2608075645, 4005300.8131723013, 4005751.7860170235, 4008093.549072218, 4009684.375, 4010082.858598523, 4013660.7042244333, 4017510.1630586246, 4017531.4932016805, 4020743.75, 4043565.5488436264, 4045688.7777501172, 4046699.9806132633, 4052190.5748950285, 4058254.112606466, 4061243.75, 4065571.6754390174, 4070922.106855205, 4072045.9918064126, 4075398.4375, 4081871.5354979252, 4089605.8576134164, 4090918.75, 4093402.579275425, 4094530.709435368, 4095942.1875, 4106523.2412542133, 4107406.13692919, 4112591.9665315016, 4116116.97010937, 4118000.646375776, 4120227.4582143826, 4126807.8125, 4133145.3125, 4133470.0763723236, 4138384.375, 4138451.580661351, 4140464.265071749, 4142380.7264262126, 4143284.879397022, 4147781.221811356, 4153793.59597076, 4157177.571143602, 4159880.5010737637, 4162957.8948232452, 4163709.3627250884, 4166975.2556300606, 4169871.764090308, 4170050.9248878993, 4170945.3125, 4171974.5736870323, 4172609.0080883363, 4172939.0625, 4174101.2109312774, 4175938.9090507594, 4177646.4869095697, 4177707.0575248306, 4180376.0308369435, 4182101.328509803, 4182796.202687059, 4183515.199542505, 4184969.617704594, 4195853.291256231, 4200814.0625, 4202456.164948572, 4203222.890745074, 4205923.403559781, 4208316.78214368, 4208623.636464817, 4218065.141134797, 4219202.100205539, 4219772.349438062, 4220128.125, 4220880.342882164, 4229161.475483041, 4233272.204929177, 4233582.8125, 4233759.102688033, 4235253.194024816, 4242077.197777614, 4242758.540902953, 4244433.711498806, 4244632.351062406, 4252846.351589247, 4269148.106239568, 4280457.761300022, 4281205.294017945, 4282428.125, 4283822.046270344, 4284035.252306497, 4288123.4375, 4289084.191493793, 4297139.420817729, 4304116.047464145, 4320835.514258292, 4329825.3120877305, 4330975.693899238, 4333911.658346567, 4334963.829167747, 4336665.500874741, 4338532.20248143, 4341171.120391229, 4341726.123631939, 4341960.358322549, 4359329.6875, 4371676.149603213, 4374954.6875, 4376248.4375, 4376444.658270732, 4376446.094667596, 4407577.625174329, 4422430.012967686, 4425820.069346194, 4426134.498630872, 4430955.935836331, 4434046.879501217, 4434557.767538908, 4438806.774661661, 4448800.233300768, 4451283.348293066, 4541971.777574807, 4609130.966541207, 5075358.981781339, 5078631.25, 5266584.375, 5309534.024937367, 5430477.619089356, 5693916.450183831, 5906598.24032176, 5929062.842563689, 6062419.900035021, 6063948.189576217, 6093793.105413478, 6111181.67950833, 6221908.74901652, 6255007.61678317, 6320649.984711036, 6376857.61952184, 6423670.04796829, 6469077.4112435235, 6537594.31640891, 6767550.675188413, 6781947.997297298, 6805882.729059359, 6844202.048473855, 6894561.990977756, 6898294.272374191, 6941799.2637839, 6994003.739595951, 6994056.4383279905, 6995493.295706351, 7010558.194976802, 7013780.103668437, 7018926.407829302, 7072269.902476786, 7088943.172156936, 7114747.186954612, 7125874.198235025, 7126366.917011901, 7126666.397401532, 7141193.51017181, 7152674.468763976, 7157068.32016194, 7215611.960771638, 7246807.361659706, 7281281.120409048, 7288984.375, 7303971.875, 7334034.332551204, 7503268.254269949, 7505685.422820276, 7613912.766534543, 7633761.353528819, 7709844.447181808, 7752096.761797701, 7813354.290708979, 7854412.5, 7878319.260248612, 8152251.880393345, 9197489.020855572, 9385312.191081097, 9395610.954723688, 9410874.281789765, 9496432.893113356, 9496478.386032922, 9514621.875, 9520384.968860649, 9721959.503815144, 10328696.875, 10606887.587733667, 10619896.875, 10637264.934952756, 10639716.638737429, 10780894.822239853, 10800799.552572917, 10801047.00918085, 10802355.944774846, 10802471.482926656, 10802477.860707635, 10803628.300383758, 10804578.746672655, 10804877.03810125, 10808654.708879558, 10809353.093259944, 10814305.413680498, 10821568.75, 10823335.557946429, 10824094.626329074, 10829415.483312324, 10829980.593161702, 10830390.292470483, 10830598.547831072, 10831145.34051913, 10831776.57120265, 10832149.254523417, 10832829.6875, 10833020.844385052, 10833050.0, 10833073.020745283, 10833204.413998595, 10833310.506513055, 10833719.07443924, 10833987.121668877, 10834455.440844355, 10834668.522996709, 10834738.016825927, 10835126.137352897, 10835126.5625, 10835237.5, 10835494.799516693, 10835526.086516265, 10835945.521662267, 10836362.78139419, 10836760.9375, 10845473.118483875, 10879221.518463977, 10880516.594243014, 10881885.68805563], [75.1404703007961, 9.875897748713244, 16.950789814887514, 17.792752964789642, 84.72749247109641, 73.9033013192517, 43.121888621028226, 60.581977566160276, 33.122899526368, 96.4228114554134, 14.478868656166213, 71.45831827331519, 42.800274614340445, 74.5194406119524, 20.810234917415343, 7.52319966516929, 96.70237690871011, 73.27595229096441, 20.88454552229696, 6.461919965535392, 78.11807879490388, 31.7814523038873, 57.18742639918304, 72.88098240999742, 29.90728236901546, 5.935784249787432, 5.913871032050728, 43.49127960107117, 27.335283007298678, 107.21960178477913, 114.04012701394211, 20.73542782920617, 6.19775085147816, 5.625944261606568, 67.32789369941138, 22.44844277534571, 42.05848542915888, 13.274463620486573, 16.38069411909122, 11.909022135713025, 38.19161377795534, 91.53405280085552, 9.26324563325095, 67.19107635672464, 7.410526504238314, 7.500363169483896, 23.084418857858672, 9.321474421194242, 8.001498036268888, 6.122042342050086, 10.68875464953398, 22.531834459747184, 130.24784783095765, 11.355409936915665, 30.146022567434745, 60.54437994290947, 6.9398810561951425, 29.7495852486698, 10.910020824911365, 38.125376848568635, 17.13687793298704, 14.499540188624707, 5.958765572681569, 13.030659779629136, 49.018454441266755, 20.757640380228384, 73.1430385793994, 59.35740285547766, 23.904247603138955, 54.852774388497394, 21.261404968915542, 25.31051835457304, 75.23145793768926, 57.67821668287869, 89.06117657228822, 20.748156830186414, 60.95946254005261, 29.992068310421256, 72.09729909152004, 74.99191518219448, 31.261835024635076, 8.724851446206719, 31.631356027939674, 28.121437713872837, 5.037793843738283, 17.84010706159134, 36.33614629920547, 54.59484313047134, 40.35590609318959, 20.947174097776813, 50.67854385023464, 44.564661011811324, 9.398055184002178, 88.9456211876905, 31.730987170875302, 21.322554580648877, 15.175984900991056, 15.025865033556329, 32.88967028857515, 11.869863982420041, 13.583543126243898, 12.502791551533612, 56.24703657743199, 19.176188177166036, 26.4463803831533, 38.152271671256436, 11.882393258143264, 70.18840325178645, 40.128285904178796, 7.001332043469763, 43.639041574820645, 5.654310772456447, 11.792861571532079, 33.586737025875394, 18.15291089894718, 53.49651846143238, 12.285328190652288, 94.46637899279789, 87.27680452943842, 46.5998229681294, 37.61829614045855, 55.001962034912225, 23.36484528738236, 20.429040372350073, 5.904226458316254, 31.572272377930517, 47.71008542662105, 87.06715190474792, 24.64380764717261, 107.2874286983162, 19.4882516763468, 101.8549546816439, 15.876803375316694, 24.90738908983301, 13.53348959689974, 12.233293298353258, 5.537982762956421, 5.22408138906821, 7.442775212153702, 74.6162380910711, 5.454233466468665, 10.128742963136473, 14.95188381875069, 25.10449541764492, 63.45164442436041, 15.120175544458881, 106.89136562641347, 19.132139783100786, 15.957265296211064, 45.574117936158665, 109.16823472436681, 23.94751516022428, 38.527461796619335, 27.570906913895367, 13.125505967593384, 48.10492351105251, 15.797550763948085, 6.524061328280128, 29.957143527287506, 33.92594188754503, 6.05349149529632, 31.090257040584493, 79.49231754258822, 8.908985271894089, 5.893672918722974, 110.62052570457831, 15.472195902430617, 77.18421976393714, 120.77628964652881, 33.430200436844345, 40.30385868876021, 71.12180924147711, 65.78787045468874, 106.59734556437186, 9.139417866169719, 60.40176714854761, 7.126233921512015, 5.8291224425136186, 21.26111882397367, 103.60788449549467, 17.03200421754554, 20.565535408923996, 20.972166486329648, 94.89862088514788, 15.264853984164459, 83.32271161058489, 11.552250987450144, 35.038510308493805, 20.222046481244462, 60.722612528977436, 7.013721743920445, 27.895979392790785, 58.756673729281935, 83.2239776253827, 15.645744081590419, 22.687152778129118, 6.012956296546086, 8.918970882054955, 7.520744467753998, 19.45450469446439, 13.534944467806003, 110.31331338818109, 89.3750527127962, 74.4803541547939, 26.9486793008053, 47.63563428596153, 26.580197507669855, 13.592948624727113, 20.898014538855612, 5.6766403271795545, 81.19916801949302, 67.89759786986906, 28.631687352749942, 76.63327681815466, 17.48356409782257, 11.685785086431792, 76.4433400894653, 5.4501987446496925, 11.385476307973143, 78.84729440154582, 18.70241200372942, 12.89950169320969, 29.817459239300273, 41.84740193920634, 13.813228933625322, 18.70662532723228, 5.860263089962685, 30.372766785379582, 11.406399104493572, 12.845932854488561, 70.39460027422142, 7.538188197264218, 94.44315019217629, 44.374949623393725, 67.23141220218743, 16.28132285512244, 97.13986358828596, 46.62735545495329, 24.641397336280303, 6.7389763738431, 29.33444297095956, 83.07853097399483, 32.095159062460766, 20.738024078407634, 62.17930933847456, 13.571104241546822, 36.260153614648, 50.432364636222474, 12.922604878801534, 15.744636454055637, 10.427049279170081, 9.622650786818632, 50.01624826715252, 5.071151392049201, 9.079174002749646, 8.288959079695847, 20.16134220791884, 22.59124864991506, 15.9121284599782, 13.612421527459505, 23.386243599521265, 23.964357505419905, 10.564089069545725, 39.26582691558876, 57.05359908985469, 5.909488902801315, 21.434340347928995, 12.71991613004124, 5.922416046592423, 7.732021397223279, 210.48041098426393, 29.911273717249394, 20.24462186667467, 16.87743796691525, 20.32212342784574, 34.197756038630864, 9.318508864379927, 14.253673452355503, 34.183487905570104, 34.87790942677114, 17.652212564885897, 14.789122448872511, 10.502940086474103, 52.80511500160857, 65.99201854265634, 107.49508651996892, 60.529355272295675, 105.06592579998028, 20.18678768728839, 5.828047589349488, 59.62899608597813, 7.225758672926852, 16.806735764788918, 25.803394675124135, 22.440215700028322, 13.117791064324908, 41.03106284735288, 61.985854639277534, 7.508251264404732, 12.596051895494304, 24.551036739574347, 63.52124742953542, 43.65196669143684, 20.346455529735575, 24.155665664909975, 25.26608606854284, 32.76331664288174, 46.93899321308096, 6.261850123860991, 63.772435578721144, 103.56281542627687, 5.962957993279881, 49.695005251119504, 9.999792198614411, 49.65657500189138, 83.17996413298305, 188.25200287216083, 9.80363619191805, 6.308215097332402, 66.70287874837382, 16.14947608925147, 17.012259552390812, 41.56852214967478, 11.256092687426053, 9.562325127630688, 46.491537575794986, 17.819239986290384, 87.71520316455201, 32.71390077435509, 68.80768223614481, 96.54549824353563, 6.019164284719584, 70.8214504791885, 45.31956822783317, 56.16805951286429, 5.206853970301101, 46.318459149973705, 10.56559482614759, 38.452883526327525, 5.134268242899093, 6.155225026830717, 22.925826296641496, 7.610988651193684, 11.078454847363302, 49.37661139300806, 53.6601095874923, 10.582102277007438, 59.08383639049697, 49.03532852320161, 5.666192506358569, 13.80936784964638, 21.091830910851293, 26.797088213774867, 11.1413369072643, 10.13312518165367, 57.77854144712291, 8.589409906232934, 29.137934553198434, 10.533306424712263, 10.725523165941196, 14.455372864630867, 15.516847170773204, 8.096153984055448, 18.879002786168662, 7.523147311584292, 17.360787742034564, 49.40813025339453, 39.03299622985623, 41.121108067741616, 27.736471233335322, 56.872133111738975, 9.51475355123709, 8.441208301237776, 54.822243984816076, 32.47404327915076, 17.501349533269913, 31.1295707230462, 64.46386196058911])
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)