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 = 44635
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
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
RowNo.append(int(int(matrix_index[i]))%int(256)) #ver XV
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);
([7306521.028606147, 7567940.577593207, 7596065.625, 7710365.328105023, 7712430.652954111, 7768625.244147376, 7791188.596239342, 7837100.94711374, 7864036.4660289725, 7890864.0625, 7978179.512278471, 7978218.398317487, 7992036.029567209, 8019233.392209233, 8042237.5, 8042326.399025798, 8103225.0, 8105912.5183864385, 8153007.584466423, 8155216.342193424, 8186316.934374467, 8186318.9013885325, 8205032.696557319, 8205571.56960811, 8215485.995719238, 8227188.629183266, 8232472.287354318, 8233890.509146686, 8236642.530669035, 8240732.707560483, 8249103.463408303, 8259878.6240551155, 8269551.5625, 8276958.447377768, 8278598.451078913, 8284357.8125, 8288428.125, 8292536.341590316, 8292566.880874628, 8293426.5625, 8301750.242906189, 8302592.95465614, 8302738.9948542565, 8302932.18332765, 8303561.599353042, 8305969.103488335, 8309034.197482627, 8345668.302246109, 8367028.993943138, 8385031.4173632, 8408745.508542124, 8411932.729785258, 8416298.4375, 8421780.524227466, 8440226.948863655, 8487724.246078253, 8487738.674607929, 8553238.00861369, 8571030.961734623, 8585665.625, 8600698.920498691, 8606953.099418934, 8614666.257938027, 8639724.844590623, 8706826.244411353, 8710984.375, 8734590.862375092, 8739919.406185765, 8742922.41180603, 8830073.4375, 8864637.208118124, 8874580.374590043, 8879287.16928855, 8959963.269251429, 9013467.260914652, 9022136.59314195, 9070218.75, 9083042.454107113, 9094030.921490114, 9098123.042412117, 9111747.189615866, 9121106.591583487, 9136362.283399856, 9189694.150713272, 9203875.0, 9209932.38327751, 9263530.825388197, 9295805.498770367, 9314741.20312108, 9402033.954093294, 9472620.3125, 9557451.5625, 9579268.762125935, 9602778.485224172, 9647669.923525682, 9680700.760859469, 9828815.203440187, 9911031.0197575, 9915492.252187654, 10029075.204244955, 10068960.044869712, 10323385.31289545, 10331718.594318327, 10410780.538238779, 10483113.853361698, 10827435.66704515, 11051748.196522003, 11096905.86152925, 11117882.616828395, 11152449.819656815, 11153098.107550053, 11383336.680095345, 11893621.092779335, 11930039.0625, 11935815.074139494, 12017134.375, 16603963.621576501, 17368815.29306696, 17407905.454706576, 17450398.89681107, 17474720.501964208, 17480167.1875, 17518295.3125, 17522617.596462466, 17524719.920416363, 17529582.8125, 17530099.688710067, 17531205.356892157, 17553362.5, 17553720.99189664, 17561228.97616294, 17575442.134896178, 17609698.14668328, 17611491.64529242, 17611493.632504214, 17611786.49574031, 17611809.461949002, 17616721.108380172, 17617193.75, 17619432.8125, 17623302.88082219, 17632068.75, 17633285.30892098, 17645843.865328822, 17650611.01587052, 17654840.78090722, 17662470.3125, 17663985.9375, 17664820.3125, 17665092.1875, 17665228.125, 17665239.563338757, 17665502.66791227, 17665551.40549707, 17665834.9684207, 17666172.469741054, 17666186.97352635, 17666394.315258514, 17666673.248453375, 17667518.09866201, 17673230.43772472, 17687300.802069634, 17688228.125, 17691947.021519244, 17697123.151808716, 17700689.128646404, 17702801.5625, 17702963.904878173, 17738227.09710401, 17752140.5728917, 17762416.939869955, 17769079.672726598, 17770422.18774678, 17774058.869007956, 17778696.875, 17785089.0625, 17785362.256932348, 17785846.401369654, 17786301.5625, 17786372.361536257, 17786404.6875, 17786616.19221772, 17786717.8593627, 17786858.21265411, 17786942.941834234, 17786952.05032953, 17787003.125, 17787009.36089104, 17787019.451307725, 17787052.103122123, 17787220.10445074, 17787230.72640122, 17787247.66834863, 17787588.672384262, 17787738.91563782, 17787804.01102358, 17788012.18192038, 17788037.302645143, 17788105.801198542, 17789143.64577691, 17801950.0, 17802312.5, 17803071.420916058, 17804706.194321796, 17805559.375, 17805838.147421565, 17806251.525892746, 17808184.375, 17808246.85747218, 17808766.63538453, 17808918.273759175, 17809014.96258779, 17809175.5455817, 17809196.867308363, 17809269.2356305, 17809657.672697525, 17809678.125, 17809719.556246735, 17809843.69791409, 17810155.87534322, 17810181.85815046, 17810221.345594954, 17810230.545856945, 17810357.907024696, 17810479.6875, 17810549.474918507, 17810967.33846795, 17811573.064542174, 17811681.25, 17811717.1875, 17811898.04390725, 17811992.140959013, 17812865.904356953, 17817112.5, 17832626.5625, 17933025.882637214, 17958581.39276045, 17961033.284419093, 17961618.75, 17963176.217358284, 17968868.965610106, 17969279.16173186, 17969719.138956074, 17970070.3125, 17970406.943193186, 17970485.82217835, 17970749.2657802, 17970756.681113098, 17970792.036230184, 17970800.810394395, 17970942.633700244, 17970945.3125, 17971045.3125, 17971080.711361594, 17971141.302214354, 17971257.249066878, 17971331.129874893, 17971356.25, 17971451.5625, 17971495.111055743, 17971498.122333318, 17971709.375, 17971762.01378944, 17971777.749560628, 17975692.18511329, 17976405.070654236, 17976420.823381517, 17977938.906716198, 17978822.96225559, 17984837.29914558, 17985965.410045475, 17987176.284132436, 17992134.003891427, 18344815.61076913, 18345127.58686994, 18348852.517847065, 18349770.298369847, 18349796.44858729, 18358020.9355429, 18358709.26284095, 18370395.3125, 18370697.85019104, 18370717.1875, 18381446.988063667, 18391158.689384762, 18391935.465740576, 18398824.53269942, 18399185.9375, 18399314.244704988, 18399352.933473174, 18399363.155411363, 18399376.90235758, 18399791.67151439, 18400011.6087406, 18405545.3125, 18431562.5, 18677650.002203897, 18714380.201475926, 18749132.8125, 18749160.1005891, 18756177.038211856, 18812683.696349327, 18852453.125, 18923705.33772527, 18965362.97131382, 18980345.206630003, 18984020.3125, 19001587.5, 19032951.160078052, 19042679.645331185, 19066041.318976514, 19150939.70086988, 19264595.605619248, 19266420.15605712, 19281703.125, 19410146.208506674, 19466621.875, 19564926.17870921, 19599081.655414063], [12.467914560013101, 27.620375513544808, 33.091753311899886, 23.7904852226502, 20.57672319633363, 20.107538309327452, 85.39933207118455, 57.711354815951324, 12.068242134205725, 63.50969751725328, 17.824983004112415, 5.194553753873865, 5.293939645764899, 5.179086157173599, 29.639935583523712, 6.246763175535711, 45.704062106044844, 22.109988921960557, 24.715704066325813, 129.48341080037534, 7.056465264354936, 6.286516583199758, 55.94608141876716, 56.083336366030586, 11.21994313642559, 74.49949988708771, 16.786667029613284, 14.517582409141605, 29.608009591265443, 26.60922519016877, 16.409964993367886, 9.792320726962966, 69.47406037802703, 28.937670515550973, 8.293771158891781, 41.466616454570044, 53.07147941415049, 98.28356489539969, 23.66647902379276, 47.04322785632143, 43.3990233973149, 12.846745673750597, 7.103782462661458, 67.12506396046356, 12.348132382575749, 35.810888184949775, 5.285635184783468, 21.26365509397628, 32.64399190089351, 34.238562843521805, 25.957189301873125, 88.14381305811719, 55.38397958330659, 16.285649057397826, 5.731796494505237, 12.680549165863885, 45.25441205240387, 26.08399056456125, 13.945923392493672, 55.00775204925738, 35.5777682766381, 7.5940115783021795, 18.06436167337854, 10.893180580971578, 6.701621806610576, 45.319000412524204, 6.524956989340445, 22.172763293392673, 12.085047760434552, 55.46077772826049, 23.85499630686456, 8.68672848253289, 116.05129765498626, 24.370608952535786, 32.5885073599774, 53.74793713989738, 84.471504377094, 27.540856169969203, 6.699647678260803, 16.626995476912327, 9.612393665997468, 33.61840285425687, 14.175558179197212, 16.72581285154574, 56.38706847746214, 21.22420655602368, 10.523097835056651, 10.126581178368424, 57.67676806463956, 43.913599180549426, 40.6057175947474, 92.63252693378756, 7.124642849188828, 21.707906150429736, 38.548245670006416, 45.916264861244514, 22.312975778044436, 21.745444240953326, 15.193937164279815, 15.781668739585966, 8.675711669725558, 20.334074316978104, 67.55830394050355, 19.612249899715525, 6.241131969668841, 10.729740602756374, 14.096223206815985, 27.94658147211286, 97.63428022969026, 39.02667215463746, 20.30513881129024, 19.066473282322622, 113.06643286157274, 141.6741496988039, 87.0008593112673, 51.3258181156942, 68.17759416138679, 13.811182185801878, 16.78573608869118, 6.561586185431209, 11.437354123267266, 66.85566891364151, 36.19543786254555, 8.515369467642318, 13.631651061921772, 49.76964026896125, 39.668311915472586, 99.42185502656305, 51.24950351560926, 59.165615155750004, 19.615605013796884, 86.3210542573097, 109.54343239785703, 21.082142443855563, 33.65452335286411, 59.288385348509216, 8.33309891861886, 10.109147482767002, 39.18706569505393, 67.07217618734492, 49.045313171694914, 33.92499330282052, 5.580191029980692, 11.707414150721524, 126.6422453621708, 29.230240526558447, 38.57310047492609, 55.764428458706554, 45.695470829640854, 60.24657969340387, 48.12423572094404, 35.19169682954966, 13.445129483384695, 17.500401633734732, 49.11449067987176, 5.309818836889798, 21.233014902805387, 45.660360378044125, 97.53231897776385, 20.10552084982191, 12.545094801627931, 21.18769172379948, 53.81062733244252, 8.365609336207779, 23.935252758565703, 9.38796705128499, 44.31598610385286, 7.0806250575867145, 23.178593128364927, 33.52331546654435, 14.07479656290883, 14.88549753914714, 21.489022697944833, 21.43353392317817, 69.99031314689431, 44.88262160332172, 14.089482155281903, 20.86454821993401, 96.41904180602573, 17.188953312809634, 175.35285274259527, 17.657074494100403, 18.31754945262897, 16.72290477059867, 85.16180870493997, 11.986655832107568, 66.5423168113962, 11.105724972830577, 38.970624326983994, 9.834578480173485, 25.000919062117802, 15.791180456667863, 52.534166916457565, 38.46405912940665, 40.86421624651774, 18.90024908534329, 25.05601073062259, 83.31572108566188, 13.468488610179834, 15.253104246009471, 72.13490869360406, 75.73062450009104, 44.76707855236676, 14.733453588203668, 31.532463094500418, 12.316861867754636, 14.803791645610069, 42.611522232380295, 14.87511980613834, 20.98851060955103, 21.7334307076115, 32.71176973224764, 17.52822656379343, 7.600458116851224, 42.08037776964984, 26.0381379990527, 32.23828030365713, 12.675051396061363, 95.60663475813175, 74.22409950799955, 76.73280658247722, 46.33388095011784, 18.431707629035685, 15.314463509542513, 101.79686229479552, 21.2464952623614, 6.511020080732647, 63.20766464227733, 31.35146808206265, 77.11741721098048, 22.62457237641126, 34.500520894505875, 16.125124821993367, 79.12033105091409, 75.87381301803164, 26.04311974554294, 15.515074291815864, 35.91190629193914, 31.62822856788231, 13.771166603078537, 11.482316388821275, 69.49557114377416, 11.79544659401572, 64.39821357739685, 18.46029644942627, 26.436038112651875, 5.761580819362567, 35.506525636666524, 62.6781489661893, 19.29972452932077, 26.709461612445057, 62.020870850020806, 29.03477431370116, 50.86439949514118, 18.353091717862803, 20.88282920878846, 7.560360718872615, 47.99915995644273, 29.062303204485616, 75.10313403870533, 75.83172881748749, 56.883952788118556, 66.65633961491929, 13.680644667984112, 7.602374678317346, 7.747957037039803, 17.255917525030704, 25.786024848259217, 21.74365689283796, 25.105567822301538, 10.807557812035492, 261.88278465925197, 22.883024851681068, 28.246306381578798, 42.90043894926824, 38.54252889930277, 55.285108938813735, 13.532206185204572, 9.920334893899422, 5.39420353832782, 51.711016778252045, 10.319017779469634, 75.52000473586179, 6.504962221949632, 8.8119633938809, 83.89230567891036, 21.825616418660374, 109.25592760731688, 42.563532633339356, 10.840977389666218, 18.209410135519345, 24.194523516302823, 10.406800857728602, 55.686639186068625, 46.09941604364726, 38.463005580939445, 24.254136931350263, 18.92224319277669, 44.15676614566638, 5.754546796796432, 26.43404555884385, 8.81669621219948, 35.783545154403676, 9.949206999553029, 6.8613956506864495, 29.84727612307286, 30.75718710028666, 43.78692434715649, 74.26114946177745, 41.063533329266114, 21.957600471653794, 7.8516843165489965, 16.19030087014317, 7.54761830384795, 50.545944801474356, 12.502137241340932, 49.65329148324081, 37.307610267366016, 42.656609764547724])
caption, xmean,count, xle, Etot = energy_spectrum(E_tot)
hist_file(E_hist, xmean, count, caption);
([7306521.028606147, 7567940.577593207, 7596065.625, 7710365.328105023, 7712430.652954111, 7768625.244147376, 7791188.596239342, 7837100.94711374, 7864036.4660289725, 7890864.0625, 7978179.512278471, 7978218.398317487, 7992036.029567209, 8019233.392209233, 8042237.5, 8042326.399025798, 8103225.0, 8105912.5183864385, 8153007.584466423, 8155216.342193424, 8186316.934374467, 8186318.9013885325, 8205032.696557319, 8205571.56960811, 8215485.995719238, 8227188.629183266, 8232472.287354318, 8233890.509146686, 8236642.530669035, 8240732.707560483, 8249103.463408303, 8259878.6240551155, 8269551.5625, 8276958.447377768, 8278598.451078913, 8284357.8125, 8288428.125, 8292536.341590316, 8292566.880874628, 8293426.5625, 8301750.242906189, 8302592.95465614, 8302738.9948542565, 8302932.18332765, 8303561.599353042, 8305969.103488335, 8309034.197482627, 8345668.302246109, 8367028.993943138, 8385031.4173632, 8408745.508542124, 8411932.729785258, 8416298.4375, 8421780.524227466, 8440226.948863655, 8487724.246078253, 8487738.674607929, 8553238.00861369, 8571030.961734623, 8585665.625, 8600698.920498691, 8606953.099418934, 8614666.257938027, 8639724.844590623, 8706826.244411353, 8710984.375, 8734590.862375092, 8739919.406185765, 8742922.41180603, 8830073.4375, 8864637.208118124, 8874580.374590043, 8879287.16928855, 8959963.269251429, 9013467.260914652, 9022136.59314195, 9070218.75, 9083042.454107113, 9094030.921490114, 9098123.042412117, 9111747.189615866, 9121106.591583487, 9136362.283399856, 9189694.150713272, 9203875.0, 9209932.38327751, 9263530.825388197, 9295805.498770367, 9314741.20312108, 9402033.954093294, 9472620.3125, 9557451.5625, 9579268.762125935, 9602778.485224172, 9647669.923525682, 9680700.760859469, 9828815.203440187, 9911031.0197575, 9915492.252187654, 10029075.204244955, 10068960.044869712, 10323385.31289545, 10331718.594318327, 10410780.538238779, 10483113.853361698, 10827435.66704515, 11051748.196522003, 11096905.86152925, 11117882.616828395, 11152449.819656815, 11153098.107550053, 11383336.680095345, 11893621.092779335, 11930039.0625, 11935815.074139494, 12017134.375, 16603963.621576501, 17368815.29306696, 17407905.454706576, 17450398.89681107, 17474720.501964208, 17480167.1875, 17518295.3125, 17522617.596462466, 17524719.920416363, 17529582.8125, 17530099.688710067, 17531205.356892157, 17553362.5, 17553720.99189664, 17561228.97616294, 17575442.134896178, 17609698.14668328, 17611491.64529242, 17611493.632504214, 17611786.49574031, 17611809.461949002, 17616721.108380172, 17617193.75, 17619432.8125, 17623302.88082219, 17632068.75, 17633285.30892098, 17645843.865328822, 17650611.01587052, 17654840.78090722, 17662470.3125, 17663985.9375, 17664820.3125, 17665092.1875, 17665228.125, 17665239.563338757, 17665502.66791227, 17665551.40549707, 17665834.9684207, 17666172.469741054, 17666186.97352635, 17666394.315258514, 17666673.248453375, 17667518.09866201, 17673230.43772472, 17687300.802069634, 17688228.125, 17691947.021519244, 17697123.151808716, 17700689.128646404, 17702801.5625, 17702963.904878173, 17738227.09710401, 17752140.5728917, 17762416.939869955, 17769079.672726598, 17770422.18774678, 17774058.869007956, 17778696.875, 17785089.0625, 17785362.256932348, 17785846.401369654, 17786301.5625, 17786372.361536257, 17786404.6875, 17786616.19221772, 17786717.8593627, 17786858.21265411, 17786942.941834234, 17786952.05032953, 17787003.125, 17787009.36089104, 17787019.451307725, 17787052.103122123, 17787220.10445074, 17787230.72640122, 17787247.66834863, 17787588.672384262, 17787738.91563782, 17787804.01102358, 17788012.18192038, 17788037.302645143, 17788105.801198542, 17789143.64577691, 17801950.0, 17802312.5, 17803071.420916058, 17804706.194321796, 17805559.375, 17805838.147421565, 17806251.525892746, 17808184.375, 17808246.85747218, 17808766.63538453, 17808918.273759175, 17809014.96258779, 17809175.5455817, 17809196.867308363, 17809269.2356305, 17809657.672697525, 17809678.125, 17809719.556246735, 17809843.69791409, 17810155.87534322, 17810181.85815046, 17810221.345594954, 17810230.545856945, 17810357.907024696, 17810479.6875, 17810549.474918507, 17810967.33846795, 17811573.064542174, 17811681.25, 17811717.1875, 17811898.04390725, 17811992.140959013, 17812865.904356953, 17817112.5, 17832626.5625, 17933025.882637214, 17958581.39276045, 17961033.284419093, 17961618.75, 17963176.217358284, 17968868.965610106, 17969279.16173186, 17969719.138956074, 17970070.3125, 17970406.943193186, 17970485.82217835, 17970749.2657802, 17970756.681113098, 17970792.036230184, 17970800.810394395, 17970942.633700244, 17970945.3125, 17971045.3125, 17971080.711361594, 17971141.302214354, 17971257.249066878, 17971331.129874893, 17971356.25, 17971451.5625, 17971495.111055743, 17971498.122333318, 17971709.375, 17971762.01378944, 17971777.749560628, 17975692.18511329, 17976405.070654236, 17976420.823381517, 17977938.906716198, 17978822.96225559, 17984837.29914558, 17985965.410045475, 17987176.284132436, 17992134.003891427, 18344815.61076913, 18345127.58686994, 18348852.517847065, 18349770.298369847, 18349796.44858729, 18358020.9355429, 18358709.26284095, 18370395.3125, 18370697.85019104, 18370717.1875, 18381446.988063667, 18391158.689384762, 18391935.465740576, 18398824.53269942, 18399185.9375, 18399314.244704988, 18399352.933473174, 18399363.155411363, 18399376.90235758, 18399791.67151439, 18400011.6087406, 18405545.3125, 18431562.5, 18677650.002203897, 18714380.201475926, 18749132.8125, 18749160.1005891, 18756177.038211856, 18812683.696349327, 18852453.125, 18923705.33772527, 18965362.97131382, 18980345.206630003, 18984020.3125, 19001587.5, 19032951.160078052, 19042679.645331185, 19066041.318976514, 19150939.70086988, 19264595.605619248, 19266420.15605712, 19281703.125, 19410146.208506674, 19466621.875, 19564926.17870921, 19599081.655414063], [12.467914560013101, 27.620375513544808, 33.091753311899886, 23.7904852226502, 20.57672319633363, 20.107538309327452, 85.39933207118455, 57.711354815951324, 12.068242134205725, 63.50969751725328, 17.824983004112415, 5.194553753873865, 5.293939645764899, 5.179086157173599, 29.639935583523712, 6.246763175535711, 45.704062106044844, 22.109988921960557, 24.715704066325813, 129.48341080037534, 7.056465264354936, 6.286516583199758, 55.94608141876716, 56.083336366030586, 11.21994313642559, 74.49949988708771, 16.786667029613284, 14.517582409141605, 29.608009591265443, 26.60922519016877, 16.409964993367886, 9.792320726962966, 69.47406037802703, 28.937670515550973, 8.293771158891781, 41.466616454570044, 53.07147941415049, 98.28356489539969, 23.66647902379276, 47.04322785632143, 43.3990233973149, 12.846745673750597, 7.103782462661458, 67.12506396046356, 12.348132382575749, 35.810888184949775, 5.285635184783468, 21.26365509397628, 32.64399190089351, 34.238562843521805, 25.957189301873125, 88.14381305811719, 55.38397958330659, 16.285649057397826, 5.731796494505237, 12.680549165863885, 45.25441205240387, 26.08399056456125, 13.945923392493672, 55.00775204925738, 35.5777682766381, 7.5940115783021795, 18.06436167337854, 10.893180580971578, 6.701621806610576, 45.319000412524204, 6.524956989340445, 22.172763293392673, 12.085047760434552, 55.46077772826049, 23.85499630686456, 8.68672848253289, 116.05129765498626, 24.370608952535786, 32.5885073599774, 53.74793713989738, 84.471504377094, 27.540856169969203, 6.699647678260803, 16.626995476912327, 9.612393665997468, 33.61840285425687, 14.175558179197212, 16.72581285154574, 56.38706847746214, 21.22420655602368, 10.523097835056651, 10.126581178368424, 57.67676806463956, 43.913599180549426, 40.6057175947474, 92.63252693378756, 7.124642849188828, 21.707906150429736, 38.548245670006416, 45.916264861244514, 22.312975778044436, 21.745444240953326, 15.193937164279815, 15.781668739585966, 8.675711669725558, 20.334074316978104, 67.55830394050355, 19.612249899715525, 6.241131969668841, 10.729740602756374, 14.096223206815985, 27.94658147211286, 97.63428022969026, 39.02667215463746, 20.30513881129024, 19.066473282322622, 113.06643286157274, 141.6741496988039, 87.0008593112673, 51.3258181156942, 68.17759416138679, 13.811182185801878, 16.78573608869118, 6.561586185431209, 11.437354123267266, 66.85566891364151, 36.19543786254555, 8.515369467642318, 13.631651061921772, 49.76964026896125, 39.668311915472586, 99.42185502656305, 51.24950351560926, 59.165615155750004, 19.615605013796884, 86.3210542573097, 109.54343239785703, 21.082142443855563, 33.65452335286411, 59.288385348509216, 8.33309891861886, 10.109147482767002, 39.18706569505393, 67.07217618734492, 49.045313171694914, 33.92499330282052, 5.580191029980692, 11.707414150721524, 126.6422453621708, 29.230240526558447, 38.57310047492609, 55.764428458706554, 45.695470829640854, 60.24657969340387, 48.12423572094404, 35.19169682954966, 13.445129483384695, 17.500401633734732, 49.11449067987176, 5.309818836889798, 21.233014902805387, 45.660360378044125, 97.53231897776385, 20.10552084982191, 12.545094801627931, 21.18769172379948, 53.81062733244252, 8.365609336207779, 23.935252758565703, 9.38796705128499, 44.31598610385286, 7.0806250575867145, 23.178593128364927, 33.52331546654435, 14.07479656290883, 14.88549753914714, 21.489022697944833, 21.43353392317817, 69.99031314689431, 44.88262160332172, 14.089482155281903, 20.86454821993401, 96.41904180602573, 17.188953312809634, 175.35285274259527, 17.657074494100403, 18.31754945262897, 16.72290477059867, 85.16180870493997, 11.986655832107568, 66.5423168113962, 11.105724972830577, 38.970624326983994, 9.834578480173485, 25.000919062117802, 15.791180456667863, 52.534166916457565, 38.46405912940665, 40.86421624651774, 18.90024908534329, 25.05601073062259, 83.31572108566188, 13.468488610179834, 15.253104246009471, 72.13490869360406, 75.73062450009104, 44.76707855236676, 14.733453588203668, 31.532463094500418, 12.316861867754636, 14.803791645610069, 42.611522232380295, 14.87511980613834, 20.98851060955103, 21.7334307076115, 32.71176973224764, 17.52822656379343, 7.600458116851224, 42.08037776964984, 26.0381379990527, 32.23828030365713, 12.675051396061363, 95.60663475813175, 74.22409950799955, 76.73280658247722, 46.33388095011784, 18.431707629035685, 15.314463509542513, 101.79686229479552, 21.2464952623614, 6.511020080732647, 63.20766464227733, 31.35146808206265, 77.11741721098048, 22.62457237641126, 34.500520894505875, 16.125124821993367, 79.12033105091409, 75.87381301803164, 26.04311974554294, 15.515074291815864, 35.91190629193914, 31.62822856788231, 13.771166603078537, 11.482316388821275, 69.49557114377416, 11.79544659401572, 64.39821357739685, 18.46029644942627, 26.436038112651875, 5.761580819362567, 35.506525636666524, 62.6781489661893, 19.29972452932077, 26.709461612445057, 62.020870850020806, 29.03477431370116, 50.86439949514118, 18.353091717862803, 20.88282920878846, 7.560360718872615, 47.99915995644273, 29.062303204485616, 75.10313403870533, 75.83172881748749, 56.883952788118556, 66.65633961491929, 13.680644667984112, 7.602374678317346, 7.747957037039803, 17.255917525030704, 25.786024848259217, 21.74365689283796, 25.105567822301538, 10.807557812035492, 261.88278465925197, 22.883024851681068, 28.246306381578798, 42.90043894926824, 38.54252889930277, 55.285108938813735, 13.532206185204572, 9.920334893899422, 5.39420353832782, 51.711016778252045, 10.319017779469634, 75.52000473586179, 6.504962221949632, 8.8119633938809, 83.89230567891036, 21.825616418660374, 109.25592760731688, 42.563532633339356, 10.840977389666218, 18.209410135519345, 24.194523516302823, 10.406800857728602, 55.686639186068625, 46.09941604364726, 38.463005580939445, 24.254136931350263, 18.92224319277669, 44.15676614566638, 5.754546796796432, 26.43404555884385, 8.81669621219948, 35.783545154403676, 9.949206999553029, 6.8613956506864495, 29.84727612307286, 30.75718710028666, 43.78692434715649, 74.26114946177745, 41.063533329266114, 21.957600471653794, 7.8516843165489965, 16.19030087014317, 7.54761830384795, 50.545944801474356, 12.502137241340932, 49.65329148324081, 37.307610267366016, 42.656609764547724])
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);
([7306521.028606147, 7567940.577593207, 7596065.625, 7710365.328105023, 7712430.652954111, 7768625.244147376, 7791188.596239342, 7837100.94711374, 7864036.4660289725, 7890864.0625, 7978179.512278471, 7978218.398317487, 7992036.029567209, 8019233.392209233, 8042237.5, 8042326.399025798, 8103225.0, 8105912.5183864385, 8153007.584466423, 8155216.342193424, 8186316.934374467, 8186318.9013885325, 8205032.696557319, 8205571.56960811, 8215485.995719238, 8227188.629183266, 8232472.287354318, 8233890.509146686, 8236642.530669035, 8240732.707560483, 8249103.463408303, 8259878.6240551155, 8269551.5625, 8276958.447377768, 8278598.451078913, 8284357.8125, 8288428.125, 8292536.341590316, 8292566.880874628, 8293426.5625, 8301750.242906189, 8302592.95465614, 8302738.9948542565, 8302932.18332765, 8303561.599353042, 8305969.103488335, 8309034.197482627, 8345668.302246109, 8367028.993943138, 8385031.4173632, 8408745.508542124, 8411932.729785258, 8416298.4375, 8421780.524227466, 8440226.948863655, 8487724.246078253, 8487738.674607929, 8553238.00861369, 8571030.961734623, 8585665.625, 8600698.920498691, 8606953.099418934, 8614666.257938027, 8639724.844590623, 8706826.244411353, 8710984.375, 8734590.862375092, 8739919.406185765, 8742922.41180603, 8830073.4375, 8864637.208118124, 8874580.374590043, 8879287.16928855, 8959963.269251429, 9013467.260914652, 9022136.59314195, 9070218.75, 9083042.454107113, 9094030.921490114, 9098123.042412117, 9111747.189615866, 9121106.591583487, 9136362.283399856, 9189694.150713272, 9203875.0, 9209932.38327751, 9263530.825388197, 9295805.498770367, 9314741.20312108, 9402033.954093294, 9472620.3125, 9557451.5625, 9579268.762125935, 9602778.485224172, 9647669.923525682, 9680700.760859469, 9828815.203440187, 9911031.0197575, 9915492.252187654, 10029075.204244955, 10068960.044869712, 10323385.31289545, 10331718.594318327, 10410780.538238779, 10483113.853361698, 10827435.66704515, 11051748.196522003, 11096905.86152925, 11117882.616828395, 11152449.819656815, 11153098.107550053, 11383336.680095345, 11893621.092779335, 11930039.0625, 11935815.074139494, 12017134.375, 16603963.621576501, 17368815.29306696, 17407905.454706576, 17450398.89681107, 17474720.501964208, 17480167.1875, 17518295.3125, 17522617.596462466, 17524719.920416363, 17529582.8125, 17530099.688710067, 17531205.356892157, 17553362.5, 17553720.99189664, 17561228.97616294, 17575442.134896178, 17609698.14668328, 17611491.64529242, 17611493.632504214, 17611786.49574031, 17611809.461949002, 17616721.108380172, 17617193.75, 17619432.8125, 17623302.88082219, 17632068.75, 17633285.30892098, 17645843.865328822, 17650611.01587052, 17654840.78090722, 17662470.3125, 17663985.9375, 17664820.3125, 17665092.1875, 17665228.125, 17665239.563338757, 17665502.66791227, 17665551.40549707, 17665834.9684207, 17666172.469741054, 17666186.97352635, 17666394.315258514, 17666673.248453375, 17667518.09866201, 17673230.43772472, 17687300.802069634, 17688228.125, 17691947.021519244, 17697123.151808716, 17700689.128646404, 17702801.5625, 17702963.904878173, 17738227.09710401, 17752140.5728917, 17762416.939869955, 17769079.672726598, 17770422.18774678, 17774058.869007956, 17778696.875, 17785089.0625, 17785362.256932348, 17785846.401369654, 17786301.5625, 17786372.361536257, 17786404.6875, 17786616.19221772, 17786717.8593627, 17786858.21265411, 17786942.941834234, 17786952.05032953, 17787003.125, 17787009.36089104, 17787019.451307725, 17787052.103122123, 17787220.10445074, 17787230.72640122, 17787247.66834863, 17787588.672384262, 17787738.91563782, 17787804.01102358, 17788012.18192038, 17788037.302645143, 17788105.801198542, 17789143.64577691, 17801950.0, 17802312.5, 17803071.420916058, 17804706.194321796, 17805559.375, 17805838.147421565, 17806251.525892746, 17808184.375, 17808246.85747218, 17808766.63538453, 17808918.273759175, 17809014.96258779, 17809175.5455817, 17809196.867308363, 17809269.2356305, 17809657.672697525, 17809678.125, 17809719.556246735, 17809843.69791409, 17810155.87534322, 17810181.85815046, 17810221.345594954, 17810230.545856945, 17810357.907024696, 17810479.6875, 17810549.474918507, 17810967.33846795, 17811573.064542174, 17811681.25, 17811717.1875, 17811898.04390725, 17811992.140959013, 17812865.904356953, 17817112.5, 17832626.5625, 17933025.882637214, 17958581.39276045, 17961033.284419093, 17961618.75, 17963176.217358284, 17968868.965610106, 17969279.16173186, 17969719.138956074, 17970070.3125, 17970406.943193186, 17970485.82217835, 17970749.2657802, 17970756.681113098, 17970792.036230184, 17970800.810394395, 17970942.633700244, 17970945.3125, 17971045.3125, 17971080.711361594, 17971141.302214354, 17971257.249066878, 17971331.129874893, 17971356.25, 17971451.5625, 17971495.111055743, 17971498.122333318, 17971709.375, 17971762.01378944, 17971777.749560628, 17975692.18511329, 17976405.070654236, 17976420.823381517, 17977938.906716198, 17978822.96225559, 17984837.29914558, 17985965.410045475, 17987176.284132436, 17992134.003891427, 18344815.61076913, 18345127.58686994, 18348852.517847065, 18349770.298369847, 18349796.44858729, 18358020.9355429, 18358709.26284095, 18370395.3125, 18370697.85019104, 18370717.1875, 18381446.988063667, 18391158.689384762, 18391935.465740576, 18398824.53269942, 18399185.9375, 18399314.244704988, 18399352.933473174, 18399363.155411363, 18399376.90235758, 18399791.67151439, 18400011.6087406, 18405545.3125, 18431562.5, 18677650.002203897, 18714380.201475926, 18749132.8125, 18749160.1005891, 18756177.038211856, 18812683.696349327, 18852453.125, 18923705.33772527, 18965362.97131382, 18980345.206630003, 18984020.3125, 19001587.5, 19032951.160078052, 19042679.645331185, 19066041.318976514, 19150939.70086988, 19264595.605619248, 19266420.15605712, 19281703.125, 19410146.208506674, 19466621.875, 19564926.17870921, 19599081.655414063], [12.467914560013101, 27.620375513544808, 33.091753311899886, 23.7904852226502, 20.57672319633363, 20.107538309327452, 85.39933207118455, 57.711354815951324, 12.068242134205725, 63.50969751725328, 17.824983004112415, 5.194553753873865, 5.293939645764899, 5.179086157173599, 29.639935583523712, 6.246763175535711, 45.704062106044844, 22.109988921960557, 24.715704066325813, 129.48341080037534, 7.056465264354936, 6.286516583199758, 55.94608141876716, 56.083336366030586, 11.21994313642559, 74.49949988708771, 16.786667029613284, 14.517582409141605, 29.608009591265443, 26.60922519016877, 16.409964993367886, 9.792320726962966, 69.47406037802703, 28.937670515550973, 8.293771158891781, 41.466616454570044, 53.07147941415049, 98.28356489539969, 23.66647902379276, 47.04322785632143, 43.3990233973149, 12.846745673750597, 7.103782462661458, 67.12506396046356, 12.348132382575749, 35.810888184949775, 5.285635184783468, 21.26365509397628, 32.64399190089351, 34.238562843521805, 25.957189301873125, 88.14381305811719, 55.38397958330659, 16.285649057397826, 5.731796494505237, 12.680549165863885, 45.25441205240387, 26.08399056456125, 13.945923392493672, 55.00775204925738, 35.5777682766381, 7.5940115783021795, 18.06436167337854, 10.893180580971578, 6.701621806610576, 45.319000412524204, 6.524956989340445, 22.172763293392673, 12.085047760434552, 55.46077772826049, 23.85499630686456, 8.68672848253289, 116.05129765498626, 24.370608952535786, 32.5885073599774, 53.74793713989738, 84.471504377094, 27.540856169969203, 6.699647678260803, 16.626995476912327, 9.612393665997468, 33.61840285425687, 14.175558179197212, 16.72581285154574, 56.38706847746214, 21.22420655602368, 10.523097835056651, 10.126581178368424, 57.67676806463956, 43.913599180549426, 40.6057175947474, 92.63252693378756, 7.124642849188828, 21.707906150429736, 38.548245670006416, 45.916264861244514, 22.312975778044436, 21.745444240953326, 15.193937164279815, 15.781668739585966, 8.675711669725558, 20.334074316978104, 67.55830394050355, 19.612249899715525, 6.241131969668841, 10.729740602756374, 14.096223206815985, 27.94658147211286, 97.63428022969026, 39.02667215463746, 20.30513881129024, 19.066473282322622, 113.06643286157274, 141.6741496988039, 87.0008593112673, 51.3258181156942, 68.17759416138679, 13.811182185801878, 16.78573608869118, 6.561586185431209, 11.437354123267266, 66.85566891364151, 36.19543786254555, 8.515369467642318, 13.631651061921772, 49.76964026896125, 39.668311915472586, 99.42185502656305, 51.24950351560926, 59.165615155750004, 19.615605013796884, 86.3210542573097, 109.54343239785703, 21.082142443855563, 33.65452335286411, 59.288385348509216, 8.33309891861886, 10.109147482767002, 39.18706569505393, 67.07217618734492, 49.045313171694914, 33.92499330282052, 5.580191029980692, 11.707414150721524, 126.6422453621708, 29.230240526558447, 38.57310047492609, 55.764428458706554, 45.695470829640854, 60.24657969340387, 48.12423572094404, 35.19169682954966, 13.445129483384695, 17.500401633734732, 49.11449067987176, 5.309818836889798, 21.233014902805387, 45.660360378044125, 97.53231897776385, 20.10552084982191, 12.545094801627931, 21.18769172379948, 53.81062733244252, 8.365609336207779, 23.935252758565703, 9.38796705128499, 44.31598610385286, 7.0806250575867145, 23.178593128364927, 33.52331546654435, 14.07479656290883, 14.88549753914714, 21.489022697944833, 21.43353392317817, 69.99031314689431, 44.88262160332172, 14.089482155281903, 20.86454821993401, 96.41904180602573, 17.188953312809634, 175.35285274259527, 17.657074494100403, 18.31754945262897, 16.72290477059867, 85.16180870493997, 11.986655832107568, 66.5423168113962, 11.105724972830577, 38.970624326983994, 9.834578480173485, 25.000919062117802, 15.791180456667863, 52.534166916457565, 38.46405912940665, 40.86421624651774, 18.90024908534329, 25.05601073062259, 83.31572108566188, 13.468488610179834, 15.253104246009471, 72.13490869360406, 75.73062450009104, 44.76707855236676, 14.733453588203668, 31.532463094500418, 12.316861867754636, 14.803791645610069, 42.611522232380295, 14.87511980613834, 20.98851060955103, 21.7334307076115, 32.71176973224764, 17.52822656379343, 7.600458116851224, 42.08037776964984, 26.0381379990527, 32.23828030365713, 12.675051396061363, 95.60663475813175, 74.22409950799955, 76.73280658247722, 46.33388095011784, 18.431707629035685, 15.314463509542513, 101.79686229479552, 21.2464952623614, 6.511020080732647, 63.20766464227733, 31.35146808206265, 77.11741721098048, 22.62457237641126, 34.500520894505875, 16.125124821993367, 79.12033105091409, 75.87381301803164, 26.04311974554294, 15.515074291815864, 35.91190629193914, 31.62822856788231, 13.771166603078537, 11.482316388821275, 69.49557114377416, 11.79544659401572, 64.39821357739685, 18.46029644942627, 26.436038112651875, 5.761580819362567, 35.506525636666524, 62.6781489661893, 19.29972452932077, 26.709461612445057, 62.020870850020806, 29.03477431370116, 50.86439949514118, 18.353091717862803, 20.88282920878846, 7.560360718872615, 47.99915995644273, 29.062303204485616, 75.10313403870533, 75.83172881748749, 56.883952788118556, 66.65633961491929, 13.680644667984112, 7.602374678317346, 7.747957037039803, 17.255917525030704, 25.786024848259217, 21.74365689283796, 25.105567822301538, 10.807557812035492, 261.88278465925197, 22.883024851681068, 28.246306381578798, 42.90043894926824, 38.54252889930277, 55.285108938813735, 13.532206185204572, 9.920334893899422, 5.39420353832782, 51.711016778252045, 10.319017779469634, 75.52000473586179, 6.504962221949632, 8.8119633938809, 83.89230567891036, 21.825616418660374, 109.25592760731688, 42.563532633339356, 10.840977389666218, 18.209410135519345, 24.194523516302823, 10.406800857728602, 55.686639186068625, 46.09941604364726, 38.463005580939445, 24.254136931350263, 18.92224319277669, 44.15676614566638, 5.754546796796432, 26.43404555884385, 8.81669621219948, 35.783545154403676, 9.949206999553029, 6.8613956506864495, 29.84727612307286, 30.75718710028666, 43.78692434715649, 74.26114946177745, 41.063533329266114, 21.957600471653794, 7.8516843165489965, 16.19030087014317, 7.54761830384795, 50.545944801474356, 12.502137241340932, 49.65329148324081, 37.307610267366016, 42.656609764547724])
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)