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
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"
#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 = 36529 #test discharge for which the notebook will definitely work
shot_no = 44336
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))
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 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=[]
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))
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')
i=i+1
t3pa_cls.close
return T_first, E_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)
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.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.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)
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].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
#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'
#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'
#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)
#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 = 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);
([4263023.4375, 4371998.4375, 4418676.5625, 4432365.625, 4496935.9375, 4514459.375, 4515912.5, 4525092.1875, 4534492.1875, 4547834.375, 4575310.9375, 4585326.5625, 4588596.875, 4626156.25, 4636429.6875, 4641110.9375, 4641157.8125, 4658356.25, 4667623.4375, 4668820.3125, 4683215.625, 4692364.0625, 4693901.5625, 4697382.8125, 4702895.3125, 4705914.0625, 4710729.6875, 4716715.625, 4718979.6875, 4718979.6875, 4721576.5625, 4724023.4375, 4740521.875, 4741104.6875, 4753154.6875, 4796992.1875, 4810360.9375, 4822298.4375, 4823964.0625, 4833821.875, 4836564.0625, 4844626.5625, 4846645.3125, 4856887.5, 4861290.625, 4864639.0625, 4869829.6875, 4872018.75, 4904923.4375, 4952871.875, 4966859.375, 4983715.625, 4989593.75, 4994854.6875, 5007935.9375, 5011746.875, 5014898.4375, 5017796.875, 5033670.3125, 5034526.5625, 5039940.625, 5048759.375, 5073082.8125, 5078303.125, 5085275.0, 5095835.9375, 5115237.5, 5120532.8125, 5142353.125, 5157578.125, 5160321.875, 5167671.875, 5184042.1875, 5190539.0625, 5211078.125, 5217657.8125, 5242373.4375, 5242375.0, 5261410.9375, 5268876.5625, 5289987.5, 5290276.5625, 5302592.1875, 5302665.625, 5326343.75, 5357887.5, 5362414.0625, 5364851.5625, 5367762.5, 5371967.1875, 5371979.6875, 5373078.125, 5373087.5, 5373871.875, 5384314.0625, 5391817.1875, 5392939.0625, 5393662.5, 5424623.4375, 5431607.8125, 5431637.5, 5542489.0625, 5566043.75, 5606954.6875, 5637765.625, 5643578.125, 5643593.75, 5669556.25, 5669948.4375, 5951293.75, 6001239.0625, 6086362.5, 6086370.3125, 6138085.9375, 6356351.5625, 6392862.5, 6396762.5, 6409676.5625, 6417145.3125, 6418918.75, 6424409.375, 6461706.25, 6497645.3125, 6498998.4375, 6511101.5625, 6538787.5, 6551039.0625, 6563745.3125, 6576421.875, 6595610.9375, 6627362.5, 6627789.0625, 6627803.125, 6642779.6875, 6644973.4375, 6714018.75, 6751995.3125, 6770535.9375, 6787503.125, 6856206.25, 6864709.375, 6872554.6875, 6880689.0625, 6904756.25, 6908471.875, 6923959.375, 6925746.875, 6933843.75, 6975551.5625, 6978018.75, 6982548.4375, 7013621.875, 7044329.6875, 7049875.0, 7054881.25, 7084814.0625, 7085201.5625, 7103809.375, 7137973.4375, 7141196.875, 7158231.25, 7165657.8125, 7185343.75, 7209634.375, 7231834.375, 7246871.875, 7249220.3125, 7288818.75, 7335070.3125, 7335081.25, 7339795.3125, 7345653.125, 7368623.4375, 7373142.1875, 7374037.5, 7379456.25, 7389642.1875, 7389656.25, 7391343.75, 7391542.1875, 7392000.0, 7392446.875, 7398220.3125, 7406279.6875, 7416806.25, 7417289.0625, 7417295.3125, 7421151.5625, 7430768.75, 7445028.125, 7446646.875, 7449987.5, 7450048.4375, 7456259.375, 7456428.125, 7456640.625, 7471482.8125, 7472154.6875, 7482257.8125, 7484815.625, 7489745.3125, 7490284.375, 7494926.5625, 7497390.625, 7504248.4375, 7508557.8125, 7511153.125, 7516600.0, 7523770.3125, 7542960.9375, 7552768.75, 7556373.4375, 7561317.1875, 7565128.125, 7570631.25, 7586706.25, 7587782.8125, 7594001.5625, 7596476.5625, 7596907.8125, 7597779.6875, 7602729.6875, 7618550.0, 7620429.6875, 7620435.9375, 7621545.3125, 7621576.5625, 7625181.25, 7629429.6875, 7630812.5, 7632164.0625, 7645857.8125, 7655718.75, 7658578.125, 7658579.6875, 7658631.25, 7684256.25, 7693248.4375, 7696334.375, 7698617.1875, 7698640.625, 7705017.1875, 7706262.5, 7743084.375, 7751151.5625, 7755917.1875, 7764721.875, 7771070.3125, 7785031.25, 7786431.25, 7789218.75, 7789559.375, 7822479.6875, 7823637.5, 7829618.75, 7844909.375, 7845140.625, 7849551.5625, 7866268.75, 7876570.3125, 7894229.6875, 7894237.5, 7900403.125, 7903307.8125, 7903320.3125, 7929675.0, 7929684.375, 7943184.375, 7958656.25, 7963379.6875, 7963462.5, 7964729.6875, 7967565.625, 7967689.0625, 7968023.4375, 7977184.375, 7977201.5625, 7979596.875, 7985793.75, 7985867.1875, 7994846.875, 8012031.25, 8025629.6875, 8031643.75, 8032339.0625, 8032878.125, 8035640.625, 8035667.1875, 8035848.4375, 8035962.5, 8036490.625, 8052401.5625, 8053787.5, 8073048.4375, 8085475.0, 8088560.9375, 8119718.75, 8121507.8125, 8125043.75, 8125126.5625, 8132248.4375, 8152287.5, 8162296.875, 8167564.0625, 8167923.4375, 8184398.4375, 8193546.875, 8204557.8125, 8208621.875, 8214882.8125, 8214895.3125, 8216015.625, 8217492.1875, 8226376.5625, 8236634.375, 8253909.375, 8270468.75, 8270521.875, 8279437.5, 8285237.5, 8304106.25, 8307625.0, 8310478.125, 8339134.375, 8340056.25, 8344732.8125, 8344948.4375, 8345787.5, 8365265.625, 8377150.0, 8382410.9375, 8382562.5, 8385437.5, 8387495.3125, 8392815.625, 8409857.8125, 8422153.125, 8438442.1875, 8440303.125, 8440789.0625, 8440954.6875, 8457318.75, 8463173.4375, 8463429.6875, 8473434.375, 8491429.6875, 8497693.75, 8498178.125, 8511750.0, 8517632.8125, 8518865.625, 8519481.25, 8524629.6875, 8526403.125, 8531068.75, 8544759.375, 8551620.3125, 8558395.3125, 8558773.4375, 8558792.1875, 8604120.3125, 8607721.875, 8613284.375, 8613856.25, 8615665.625, 8615665.625, 8623284.375, 8623843.75, 8626360.9375, 8627260.9375, 8629035.9375, 8629156.25, 8632742.1875, 8636800.0, 8642000.0, 8646437.5, 8649417.1875, 8650764.0625, 8650832.8125, 8651735.9375, 8651995.3125, 8652270.3125, 8654412.5, 8654415.625, 8666992.1875, 8686307.8125, 8687815.625, 8690760.9375, 8690901.5625, 8695042.1875, 8701471.875, 8705229.6875, 8715464.0625, 8716314.0625, 8718215.625, 8718831.25, 8722082.8125, 8723418.75, 8723446.875, 8723525.0, 8723951.5625, 8725254.6875, 8727762.5, 8736359.375, 8743459.375, 8744790.625, 8746439.0625, 8752575.0, 8759464.0625, 8768525.0, 8769975.0, 8790435.9375, 8797265.625, 8803973.4375, 8813942.1875, 8827754.6875, 8834621.875, 8860553.125, 8861417.1875, 8862434.375, 8874187.5, 8878218.75, 8901118.75, 8911667.1875, 8921603.125, 8942468.75, 8948856.25, 8949446.875, 8963603.125, 8972242.1875, 8975189.0625, 8975195.3125, 8975251.5625, 8978203.125, 8978870.3125, 8990660.9375, 8992045.3125, 9007353.125, 9008207.8125, 9009860.9375, 9010276.5625, 9014137.5, 9025264.0625, 9026546.875, 9026942.1875, 9027373.4375, 9029770.3125, 9030534.375, 9033706.25, 9037496.875, 9038495.3125, 9042614.0625, 9042628.125, 9042871.875, 9050470.3125, 9053646.875, 9071004.6875, 9086912.5, 9087926.5625, 9094907.8125, 9105285.9375, 9114106.25, 9115875.0, 9115879.6875, 9115900.0, 9167504.6875, 9190057.8125, 9190120.3125, 9193934.375, 9212334.375, 9220767.1875, 9240729.6875, 9263198.4375, 9469115.625, 9475731.25, 9783857.8125, 9846853.125, 10301696.875, 10301706.25, 185025821.875], [11.101580363913374, 8.011784695692626, 72.44585526931753, 14.347816589726925, 5.756102129125485, 87.385323374031, 76.17779587299047, 107.99664708764669, 19.72843410604672, 39.10930818687333, 9.627914012043236, 56.80774538435759, 25.96073784466553, 13.914864961612249, 18.780631182643006, 21.313862854451553, 59.95145119039324, 17.506734104519396, 24.128894705115098, 27.900880078693707, 14.241912963078558, 83.29909870515208, 84.95656912316575, 114.99151884044814, 94.59711727798506, 13.24821152486531, 119.72567836013425, 33.820966644943006, 21.289711267876097, 69.03593812205935, 81.53792456572054, 13.085462024600208, 82.56913771889664, 14.878061759705504, 38.32306364371053, 19.640082351115318, 104.35841871084341, 23.33613119831007, 29.446112477769557, 9.916758155287416, 19.836310976595147, 20.695804975224746, 7.493662964348806, 9.517887052723264, 74.45662931151713, 71.94697276297941, 5.850695780298132, 16.3678818520616, 32.673152758975554, 32.38188263824176, 5.833929917311078, 105.17910355392323, 70.46472972578911, 138.93586368691433, 100.54238737123653, 22.19169016818997, 86.80789525674498, 74.17732303324587, 7.921973098748991, 181.45760933303836, 12.865538835059759, 22.395423179730045, 12.323556044231575, 7.904859271664465, 24.75933428959041, 54.819798291645405, 21.512957520995506, 9.63343319717513, 6.086613662262037, 18.823574993431567, 72.21723700807743, 21.033945564225125, 6.720648754888573, 5.358440591995233, 5.160636055314275, 7.195744010751504, 88.01736228879392, 42.38750295577467, 144.68038880856074, 49.553447534604295, 18.072395148610354, 9.060655574834634, 52.62801814856042, 5.0717238443842545, 43.21186709782987, 52.536402972880566, 17.864751961146148, 14.287315191971636, 19.46343947015068, 64.88252002708647, 13.868755671005468, 9.627558165164318, 29.62589868359522, 20.29951035367074, 54.09723818963781, 114.71964071050179, 39.86273802882381, 13.17733595636095, 12.776182417496932, 9.046050360367834, 7.097232536067141, 45.59335801333194, 12.116743368342647, 22.58815668792236, 55.88370765841404, 74.33783700900771, 15.90950105827982, 171.09079965091837, 105.3093756841658, 44.4419602436551, 15.582214119401641, 20.27719987225025, 17.806972650122994, 6.864139974628623, 20.13466554058812, 5.22567103586317, 8.58085327720214, 10.39570948146242, 26.628669275000572, 25.96643410727331, 36.414411198147405, 38.57910342613177, 49.08523676052493, 18.814937358059577, 24.36586388865136, 46.11995442051068, 21.09183107329924, 7.989189350430483, 27.32122480662828, 13.67177568352378, 24.351940212260875, 25.51755546835777, 22.440551371399273, 27.599898078233064, 42.87841004488553, 41.53821672744536, 12.140946917483129, 15.441415095234856, 37.35624868754465, 32.00707771174734, 10.354207548715781, 68.30546735161596, 7.21858151488474, 13.32273075711121, 15.168953534594229, 37.26140245948525, 10.828232404456468, 40.61561905417885, 82.72806466965469, 38.61313322638843, 47.797681788431234, 14.320460033872937, 158.59521125550557, 39.82222881717597, 34.458051712505366, 11.629249847161987, 13.41140708315247, 122.41821928935335, 51.90588102857899, 25.0865107951365, 43.72934918729466, 57.35148903156816, 148.42183022772815, 15.577367813089152, 26.45520724907302, 51.723501921839215, 6.855106421791236, 5.3759971619625535, 15.382859182884408, 65.10575747315265, 32.649236880429605, 33.4376770137219, 16.73482614902011, 5.560629534822578, 25.1792413202484, 49.06687093802242, 70.16475099072075, 16.119269847119025, 7.925374144834829, 60.96404825225152, 14.645526462717534, 17.520041685257205, 5.169484720398979, 33.01409064367853, 33.394733120469866, 19.615364153188764, 5.825247390318702, 23.264118447508253, 11.012188296062108, 49.75632125692971, 23.153826124151028, 13.987642027315875, 5.97752832179726, 18.80935442189234, 22.556824292795135, 20.691589266086662, 26.34250695058015, 31.444172908327978, 43.08589673517366, 95.4749700886816, 7.658633462946834, 56.816964829295934, 47.1081133431399, 5.234899131578936, 8.108716560737406, 15.20693593496299, 14.962603126943653, 80.85441943273635, 62.24374751775872, 53.136234636537964, 6.34260282826561, 7.1328853760424975, 48.95654110399021, 92.23470735631307, 33.22933740867728, 153.7428846859147, 5.110333100648386, 49.668299046297115, 6.465587903414277, 29.53303269971729, 41.14954338251667, 10.70011029441048, 61.70316108293828, 45.99475692190689, 51.29872513410671, 150.779456308735, 34.928129783252835, 6.79123206253547, 27.942673917854787, 25.569029330287627, 24.107166425092522, 28.291392086726326, 41.22476593014589, 25.644334544943533, 43.1268120661893, 5.3000858601886875, 67.64199740177777, 21.321966163434112, 27.670746728993016, 10.603157655723404, 5.809649841241515, 21.40909738239076, 65.14720208670542, 6.225019785769913, 95.16925824836007, 7.22426054126202, 85.13353397017005, 44.54649889678244, 51.056177547348845, 11.867950634716557, 17.81592269462825, 63.32482071922137, 27.203892354485472, 34.726214576468806, 9.977277152773143, 37.71282021159668, 9.484088820854321, 36.08015961687416, 35.02523378112039, 33.357864323790025, 64.32414996045307, 46.8726799871254, 55.35508847047251, 60.89672299304907, 80.25070360187335, 42.66522396574055, 18.18710721523749, 5.844955605952644, 13.415915281224052, 20.32275620900253, 5.099444532726002, 29.100361007161233, 11.809338721573589, 27.50905229491358, 130.6310785440546, 80.08938507526578, 12.711044917266337, 67.64999554654986, 26.9391626942586, 5.113539864091768, 93.64421497772801, 23.34764225286143, 53.11091949613426, 66.4959220582905, 5.304568571679289, 113.03868358754795, 23.79340810045118, 15.921667257794159, 92.10569777732384, 22.058145537301346, 8.273893286303878, 31.719945472755416, 26.469554620319457, 87.05401103975795, 11.011883057385658, 42.002568473547406, 7.758594756965759, 17.77250924131261, 25.81924821258079, 107.15156741743611, 66.7567525601749, 59.99733102652843, 42.00304552705204, 32.191122614878424, 11.75318093533309, 24.34317914342495, 96.36293109271041, 95.3127226805667, 21.385377885435815, 23.1293727065903, 17.025770000330674, 71.0645855095409, 14.731122273842619, 22.706000453600094, 59.453880680543726, 7.908123280936999, 11.72752997682038, 5.8144971898085265, 59.740391536894876, 29.80545426717216, 10.511863490919161, 79.45784306268689, 33.572941090550806, 14.030280145118482, 80.98781998911574, 18.86424619862356, 97.53721968685002, 23.24975761775236, 73.85491215810161, 143.46328966813073, 11.71490097469733, 10.302382204839653, 23.212576151190216, 53.352786510313585, 13.333626895174218, 42.81772783180756, 60.7856035212977, 9.642738784882283, 27.92157851528229, 26.703145494684936, 153.61370988725588, 44.93373463555534, 41.277863382950656, 11.921499635527788, 10.177958241169165, 166.16326976390476, 14.903684436630474, 19.672666753809608, 46.54946779017015, 8.756252296215303, 11.486628361969315, 7.756441988410308, 73.7998003866553, 171.5115540968983, 74.98653248488802, 68.11500799320905, 23.905096365878872, 14.893992767340901, 68.55070323359209, 21.634347244522615, 38.14542859957315, 5.680388207629731, 11.737256337046237, 18.79121470850585, 6.19352103811289, 28.492089445117085, 68.58314955587942, 93.54552867584778, 13.073403174502305, 46.2060181157984, 36.227002965169895, 32.530855673720346, 5.636668874460704, 12.43414898133872, 17.623746604928325, 21.3612728953091, 9.61205674752464, 38.27252200883065, 16.611547295306586, 5.518810750205772, 60.42241918732426, 10.283101256188838, 59.21101158776405, 18.55670053569477, 114.3732680367528, 69.3971316752013, 21.17867522302161, 42.77334718951573, 22.264373703002008, 123.69088950810833, 17.662211614123684, 20.633641971510006, 25.684539860366318, 33.87034536883893, 20.95415977912374, 17.274962044839306, 23.496813421782246, 44.183772073270916, 41.42068118814684, 166.11135665887304, 22.308764811400263, 55.48342281841406, 80.65979048528992, 61.30793481918077, 28.464496298120295, 55.61564756773387, 30.680692819628664, 5.1081660170143754, 23.180296039672285, 16.485853844268522, 56.11685692667604, 44.36688322155889, 213.9425403166021, 16.053704850840788, 11.23170235114088, 16.89426476368958, 24.705032940356634, 16.2018770492917, 23.513649401678155, 32.44791018703346, 30.248830554461403, 89.67930850309871, 40.59119183347853, 48.5807239661626, 169.44530713712177, 34.21477779229892, 5.975668405098904, 5.923652490221701, 106.7693152251893, 124.98863959727944, 9.096912830523662, 30.82932180909603, 5.254466029694362, 66.9954704224761, 12.212662517821258, 206.04817292226727, 31.209438679313465, 9.298853126145952, 67.18239456917279, 6.554575635262604, 31.411381635533218, 68.37312490508562, 35.14284647351524, 8.314890313953917, 78.07629610219774, 9.071100959141496, 132.64101123127813, 36.57254219218948, 115.374437809691, 30.187739978679343, 18.59040570482528, 127.20471094616337, 11.834344810464582, 6.306060258160586, 99.83029974229957, 109.39160606754342, 29.93881600288789, 78.65245736048377, 46.489802750829995, 25.494136803435094, 43.234628840729094, 57.250733240476436, 55.98516543555722, 10.74679190376119, 5.712406217801906, 21.901361962190208, 31.609812459897984, 5.584098092632381, 44.16146483036407, 42.59150343636785, 27.03525642239425, 103.285415942492, 61.54531630814729, 9.528083249612328, 17.086701954631785, 61.39358293001782, 10.392679179823565, 99.54137109642372, 22.136784716123895, 32.41362017211548])
caption, xmean,count, xle, Etot = energy_spectrum(E_tot)
hist_file(E_hist, xmean, count, caption);
([4263023.4375, 4371998.4375, 4418676.5625, 4432365.625, 4496935.9375, 4514459.375, 4515912.5, 4525092.1875, 4534492.1875, 4547834.375, 4575310.9375, 4585326.5625, 4588596.875, 4626156.25, 4636429.6875, 4641110.9375, 4641157.8125, 4658356.25, 4667623.4375, 4668820.3125, 4683215.625, 4692364.0625, 4693901.5625, 4697382.8125, 4702895.3125, 4705914.0625, 4710729.6875, 4716715.625, 4718979.6875, 4718979.6875, 4721576.5625, 4724023.4375, 4740521.875, 4741104.6875, 4753154.6875, 4796992.1875, 4810360.9375, 4822298.4375, 4823964.0625, 4833821.875, 4836564.0625, 4844626.5625, 4846645.3125, 4856887.5, 4861290.625, 4864639.0625, 4869829.6875, 4872018.75, 4904923.4375, 4952871.875, 4966859.375, 4983715.625, 4989593.75, 4994854.6875, 5007935.9375, 5011746.875, 5014898.4375, 5017796.875, 5033670.3125, 5034526.5625, 5039940.625, 5048759.375, 5073082.8125, 5078303.125, 5085275.0, 5095835.9375, 5115237.5, 5120532.8125, 5142353.125, 5157578.125, 5160321.875, 5167671.875, 5184042.1875, 5190539.0625, 5211078.125, 5217657.8125, 5242373.4375, 5242375.0, 5261410.9375, 5268876.5625, 5289987.5, 5290276.5625, 5302592.1875, 5302665.625, 5326343.75, 5357887.5, 5362414.0625, 5364851.5625, 5367762.5, 5371967.1875, 5371979.6875, 5373078.125, 5373087.5, 5373871.875, 5384314.0625, 5391817.1875, 5392939.0625, 5393662.5, 5424623.4375, 5431607.8125, 5431637.5, 5542489.0625, 5566043.75, 5606954.6875, 5637765.625, 5643578.125, 5643593.75, 5669556.25, 5669948.4375, 5951293.75, 6001239.0625, 6086362.5, 6086370.3125, 6138085.9375, 6356351.5625, 6392862.5, 6396762.5, 6409676.5625, 6417145.3125, 6418918.75, 6424409.375, 6461706.25, 6497645.3125, 6498998.4375, 6511101.5625, 6538787.5, 6551039.0625, 6563745.3125, 6576421.875, 6595610.9375, 6627362.5, 6627789.0625, 6627803.125, 6642779.6875, 6644973.4375, 6714018.75, 6751995.3125, 6770535.9375, 6787503.125, 6856206.25, 6864709.375, 6872554.6875, 6880689.0625, 6904756.25, 6908471.875, 6923959.375, 6925746.875, 6933843.75, 6975551.5625, 6978018.75, 6982548.4375, 7013621.875, 7044329.6875, 7049875.0, 7054881.25, 7084814.0625, 7085201.5625, 7103809.375, 7137973.4375, 7141196.875, 7158231.25, 7165657.8125, 7185343.75, 7209634.375, 7231834.375, 7246871.875, 7249220.3125, 7288818.75, 7335070.3125, 7335081.25, 7339795.3125, 7345653.125, 7368623.4375, 7373142.1875, 7374037.5, 7379456.25, 7389642.1875, 7389656.25, 7391343.75, 7391542.1875, 7392000.0, 7392446.875, 7398220.3125, 7406279.6875, 7416806.25, 7417289.0625, 7417295.3125, 7421151.5625, 7430768.75, 7445028.125, 7446646.875, 7449987.5, 7450048.4375, 7456259.375, 7456428.125, 7456640.625, 7471482.8125, 7472154.6875, 7482257.8125, 7484815.625, 7489745.3125, 7490284.375, 7494926.5625, 7497390.625, 7504248.4375, 7508557.8125, 7511153.125, 7516600.0, 7523770.3125, 7542960.9375, 7552768.75, 7556373.4375, 7561317.1875, 7565128.125, 7570631.25, 7586706.25, 7587782.8125, 7594001.5625, 7596476.5625, 7596907.8125, 7597779.6875, 7602729.6875, 7618550.0, 7620429.6875, 7620435.9375, 7621545.3125, 7621576.5625, 7625181.25, 7629429.6875, 7630812.5, 7632164.0625, 7645857.8125, 7655718.75, 7658578.125, 7658579.6875, 7658631.25, 7684256.25, 7693248.4375, 7696334.375, 7698617.1875, 7698640.625, 7705017.1875, 7706262.5, 7743084.375, 7751151.5625, 7755917.1875, 7764721.875, 7771070.3125, 7785031.25, 7786431.25, 7789218.75, 7789559.375, 7822479.6875, 7823637.5, 7829618.75, 7844909.375, 7845140.625, 7849551.5625, 7866268.75, 7876570.3125, 7894229.6875, 7894237.5, 7900403.125, 7903307.8125, 7903320.3125, 7929675.0, 7929684.375, 7943184.375, 7958656.25, 7963379.6875, 7963462.5, 7964729.6875, 7967565.625, 7967689.0625, 7968023.4375, 7977184.375, 7977201.5625, 7979596.875, 7985793.75, 7985867.1875, 7994846.875, 8012031.25, 8025629.6875, 8031643.75, 8032339.0625, 8032878.125, 8035640.625, 8035667.1875, 8035848.4375, 8035962.5, 8036490.625, 8052401.5625, 8053787.5, 8073048.4375, 8085475.0, 8088560.9375, 8119718.75, 8121507.8125, 8125043.75, 8125126.5625, 8132248.4375, 8152287.5, 8162296.875, 8167564.0625, 8167923.4375, 8184398.4375, 8193546.875, 8204557.8125, 8208621.875, 8214882.8125, 8214895.3125, 8216015.625, 8217492.1875, 8226376.5625, 8236634.375, 8253909.375, 8270468.75, 8270521.875, 8279437.5, 8285237.5, 8304106.25, 8307625.0, 8310478.125, 8339134.375, 8340056.25, 8344732.8125, 8344948.4375, 8345787.5, 8365265.625, 8377150.0, 8382410.9375, 8382562.5, 8385437.5, 8387495.3125, 8392815.625, 8409857.8125, 8422153.125, 8438442.1875, 8440303.125, 8440789.0625, 8440954.6875, 8457318.75, 8463173.4375, 8463429.6875, 8473434.375, 8491429.6875, 8497693.75, 8498178.125, 8511750.0, 8517632.8125, 8518865.625, 8519481.25, 8524629.6875, 8526403.125, 8531068.75, 8544759.375, 8551620.3125, 8558395.3125, 8558773.4375, 8558792.1875, 8604120.3125, 8607721.875, 8613284.375, 8613856.25, 8615665.625, 8615665.625, 8623284.375, 8623843.75, 8626360.9375, 8627260.9375, 8629035.9375, 8629156.25, 8632742.1875, 8636800.0, 8642000.0, 8646437.5, 8649417.1875, 8650764.0625, 8650832.8125, 8651735.9375, 8651995.3125, 8652270.3125, 8654412.5, 8654415.625, 8666992.1875, 8686307.8125, 8687815.625, 8690760.9375, 8690901.5625, 8695042.1875, 8701471.875, 8705229.6875, 8715464.0625, 8716314.0625, 8718215.625, 8718831.25, 8722082.8125, 8723418.75, 8723446.875, 8723525.0, 8723951.5625, 8725254.6875, 8727762.5, 8736359.375, 8743459.375, 8744790.625, 8746439.0625, 8752575.0, 8759464.0625, 8768525.0, 8769975.0, 8790435.9375, 8797265.625, 8803973.4375, 8813942.1875, 8827754.6875, 8834621.875, 8860553.125, 8861417.1875, 8862434.375, 8874187.5, 8878218.75, 8901118.75, 8911667.1875, 8921603.125, 8942468.75, 8948856.25, 8949446.875, 8963603.125, 8972242.1875, 8975189.0625, 8975195.3125, 8975251.5625, 8978203.125, 8978870.3125, 8990660.9375, 8992045.3125, 9007353.125, 9008207.8125, 9009860.9375, 9010276.5625, 9014137.5, 9025264.0625, 9026546.875, 9026942.1875, 9027373.4375, 9029770.3125, 9030534.375, 9033706.25, 9037496.875, 9038495.3125, 9042614.0625, 9042628.125, 9042871.875, 9050470.3125, 9053646.875, 9071004.6875, 9086912.5, 9087926.5625, 9094907.8125, 9105285.9375, 9114106.25, 9115875.0, 9115879.6875, 9115900.0, 9167504.6875, 9190057.8125, 9190120.3125, 9193934.375, 9212334.375, 9220767.1875, 9240729.6875, 9263198.4375, 9469115.625, 9475731.25, 9783857.8125, 9846853.125, 10301696.875, 10301706.25, 185025821.875], [11.101580363913374, 8.011784695692626, 72.44585526931753, 14.347816589726925, 5.756102129125485, 87.385323374031, 76.17779587299047, 107.99664708764669, 19.72843410604672, 39.10930818687333, 9.627914012043236, 56.80774538435759, 25.96073784466553, 13.914864961612249, 18.780631182643006, 21.313862854451553, 59.95145119039324, 17.506734104519396, 24.128894705115098, 27.900880078693707, 14.241912963078558, 83.29909870515208, 84.95656912316575, 114.99151884044814, 94.59711727798506, 13.24821152486531, 119.72567836013425, 33.820966644943006, 21.289711267876097, 69.03593812205935, 81.53792456572054, 13.085462024600208, 82.56913771889664, 14.878061759705504, 38.32306364371053, 19.640082351115318, 104.35841871084341, 23.33613119831007, 29.446112477769557, 9.916758155287416, 19.836310976595147, 20.695804975224746, 7.493662964348806, 9.517887052723264, 74.45662931151713, 71.94697276297941, 5.850695780298132, 16.3678818520616, 32.673152758975554, 32.38188263824176, 5.833929917311078, 105.17910355392323, 70.46472972578911, 138.93586368691433, 100.54238737123653, 22.19169016818997, 86.80789525674498, 74.17732303324587, 7.921973098748991, 181.45760933303836, 12.865538835059759, 22.395423179730045, 12.323556044231575, 7.904859271664465, 24.75933428959041, 54.819798291645405, 21.512957520995506, 9.63343319717513, 6.086613662262037, 18.823574993431567, 72.21723700807743, 21.033945564225125, 6.720648754888573, 5.358440591995233, 5.160636055314275, 7.195744010751504, 88.01736228879392, 42.38750295577467, 144.68038880856074, 49.553447534604295, 18.072395148610354, 9.060655574834634, 52.62801814856042, 5.0717238443842545, 43.21186709782987, 52.536402972880566, 17.864751961146148, 14.287315191971636, 19.46343947015068, 64.88252002708647, 13.868755671005468, 9.627558165164318, 29.62589868359522, 20.29951035367074, 54.09723818963781, 114.71964071050179, 39.86273802882381, 13.17733595636095, 12.776182417496932, 9.046050360367834, 7.097232536067141, 45.59335801333194, 12.116743368342647, 22.58815668792236, 55.88370765841404, 74.33783700900771, 15.90950105827982, 171.09079965091837, 105.3093756841658, 44.4419602436551, 15.582214119401641, 20.27719987225025, 17.806972650122994, 6.864139974628623, 20.13466554058812, 5.22567103586317, 8.58085327720214, 10.39570948146242, 26.628669275000572, 25.96643410727331, 36.414411198147405, 38.57910342613177, 49.08523676052493, 18.814937358059577, 24.36586388865136, 46.11995442051068, 21.09183107329924, 7.989189350430483, 27.32122480662828, 13.67177568352378, 24.351940212260875, 25.51755546835777, 22.440551371399273, 27.599898078233064, 42.87841004488553, 41.53821672744536, 12.140946917483129, 15.441415095234856, 37.35624868754465, 32.00707771174734, 10.354207548715781, 68.30546735161596, 7.21858151488474, 13.32273075711121, 15.168953534594229, 37.26140245948525, 10.828232404456468, 40.61561905417885, 82.72806466965469, 38.61313322638843, 47.797681788431234, 14.320460033872937, 158.59521125550557, 39.82222881717597, 34.458051712505366, 11.629249847161987, 13.41140708315247, 122.41821928935335, 51.90588102857899, 25.0865107951365, 43.72934918729466, 57.35148903156816, 148.42183022772815, 15.577367813089152, 26.45520724907302, 51.723501921839215, 6.855106421791236, 5.3759971619625535, 15.382859182884408, 65.10575747315265, 32.649236880429605, 33.4376770137219, 16.73482614902011, 5.560629534822578, 25.1792413202484, 49.06687093802242, 70.16475099072075, 16.119269847119025, 7.925374144834829, 60.96404825225152, 14.645526462717534, 17.520041685257205, 5.169484720398979, 33.01409064367853, 33.394733120469866, 19.615364153188764, 5.825247390318702, 23.264118447508253, 11.012188296062108, 49.75632125692971, 23.153826124151028, 13.987642027315875, 5.97752832179726, 18.80935442189234, 22.556824292795135, 20.691589266086662, 26.34250695058015, 31.444172908327978, 43.08589673517366, 95.4749700886816, 7.658633462946834, 56.816964829295934, 47.1081133431399, 5.234899131578936, 8.108716560737406, 15.20693593496299, 14.962603126943653, 80.85441943273635, 62.24374751775872, 53.136234636537964, 6.34260282826561, 7.1328853760424975, 48.95654110399021, 92.23470735631307, 33.22933740867728, 153.7428846859147, 5.110333100648386, 49.668299046297115, 6.465587903414277, 29.53303269971729, 41.14954338251667, 10.70011029441048, 61.70316108293828, 45.99475692190689, 51.29872513410671, 150.779456308735, 34.928129783252835, 6.79123206253547, 27.942673917854787, 25.569029330287627, 24.107166425092522, 28.291392086726326, 41.22476593014589, 25.644334544943533, 43.1268120661893, 5.3000858601886875, 67.64199740177777, 21.321966163434112, 27.670746728993016, 10.603157655723404, 5.809649841241515, 21.40909738239076, 65.14720208670542, 6.225019785769913, 95.16925824836007, 7.22426054126202, 85.13353397017005, 44.54649889678244, 51.056177547348845, 11.867950634716557, 17.81592269462825, 63.32482071922137, 27.203892354485472, 34.726214576468806, 9.977277152773143, 37.71282021159668, 9.484088820854321, 36.08015961687416, 35.02523378112039, 33.357864323790025, 64.32414996045307, 46.8726799871254, 55.35508847047251, 60.89672299304907, 80.25070360187335, 42.66522396574055, 18.18710721523749, 5.844955605952644, 13.415915281224052, 20.32275620900253, 5.099444532726002, 29.100361007161233, 11.809338721573589, 27.50905229491358, 130.6310785440546, 80.08938507526578, 12.711044917266337, 67.64999554654986, 26.9391626942586, 5.113539864091768, 93.64421497772801, 23.34764225286143, 53.11091949613426, 66.4959220582905, 5.304568571679289, 113.03868358754795, 23.79340810045118, 15.921667257794159, 92.10569777732384, 22.058145537301346, 8.273893286303878, 31.719945472755416, 26.469554620319457, 87.05401103975795, 11.011883057385658, 42.002568473547406, 7.758594756965759, 17.77250924131261, 25.81924821258079, 107.15156741743611, 66.7567525601749, 59.99733102652843, 42.00304552705204, 32.191122614878424, 11.75318093533309, 24.34317914342495, 96.36293109271041, 95.3127226805667, 21.385377885435815, 23.1293727065903, 17.025770000330674, 71.0645855095409, 14.731122273842619, 22.706000453600094, 59.453880680543726, 7.908123280936999, 11.72752997682038, 5.8144971898085265, 59.740391536894876, 29.80545426717216, 10.511863490919161, 79.45784306268689, 33.572941090550806, 14.030280145118482, 80.98781998911574, 18.86424619862356, 97.53721968685002, 23.24975761775236, 73.85491215810161, 143.46328966813073, 11.71490097469733, 10.302382204839653, 23.212576151190216, 53.352786510313585, 13.333626895174218, 42.81772783180756, 60.7856035212977, 9.642738784882283, 27.92157851528229, 26.703145494684936, 153.61370988725588, 44.93373463555534, 41.277863382950656, 11.921499635527788, 10.177958241169165, 166.16326976390476, 14.903684436630474, 19.672666753809608, 46.54946779017015, 8.756252296215303, 11.486628361969315, 7.756441988410308, 73.7998003866553, 171.5115540968983, 74.98653248488802, 68.11500799320905, 23.905096365878872, 14.893992767340901, 68.55070323359209, 21.634347244522615, 38.14542859957315, 5.680388207629731, 11.737256337046237, 18.79121470850585, 6.19352103811289, 28.492089445117085, 68.58314955587942, 93.54552867584778, 13.073403174502305, 46.2060181157984, 36.227002965169895, 32.530855673720346, 5.636668874460704, 12.43414898133872, 17.623746604928325, 21.3612728953091, 9.61205674752464, 38.27252200883065, 16.611547295306586, 5.518810750205772, 60.42241918732426, 10.283101256188838, 59.21101158776405, 18.55670053569477, 114.3732680367528, 69.3971316752013, 21.17867522302161, 42.77334718951573, 22.264373703002008, 123.69088950810833, 17.662211614123684, 20.633641971510006, 25.684539860366318, 33.87034536883893, 20.95415977912374, 17.274962044839306, 23.496813421782246, 44.183772073270916, 41.42068118814684, 166.11135665887304, 22.308764811400263, 55.48342281841406, 80.65979048528992, 61.30793481918077, 28.464496298120295, 55.61564756773387, 30.680692819628664, 5.1081660170143754, 23.180296039672285, 16.485853844268522, 56.11685692667604, 44.36688322155889, 213.9425403166021, 16.053704850840788, 11.23170235114088, 16.89426476368958, 24.705032940356634, 16.2018770492917, 23.513649401678155, 32.44791018703346, 30.248830554461403, 89.67930850309871, 40.59119183347853, 48.5807239661626, 169.44530713712177, 34.21477779229892, 5.975668405098904, 5.923652490221701, 106.7693152251893, 124.98863959727944, 9.096912830523662, 30.82932180909603, 5.254466029694362, 66.9954704224761, 12.212662517821258, 206.04817292226727, 31.209438679313465, 9.298853126145952, 67.18239456917279, 6.554575635262604, 31.411381635533218, 68.37312490508562, 35.14284647351524, 8.314890313953917, 78.07629610219774, 9.071100959141496, 132.64101123127813, 36.57254219218948, 115.374437809691, 30.187739978679343, 18.59040570482528, 127.20471094616337, 11.834344810464582, 6.306060258160586, 99.83029974229957, 109.39160606754342, 29.93881600288789, 78.65245736048377, 46.489802750829995, 25.494136803435094, 43.234628840729094, 57.250733240476436, 55.98516543555722, 10.74679190376119, 5.712406217801906, 21.901361962190208, 31.609812459897984, 5.584098092632381, 44.16146483036407, 42.59150343636785, 27.03525642239425, 103.285415942492, 61.54531630814729, 9.528083249612328, 17.086701954631785, 61.39358293001782, 10.392679179823565, 99.54137109642372, 22.136784716123895, 32.41362017211548])
caption, T_hit,count = 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, count, caption);
([4263023.4375, 4371998.4375, 4418676.5625, 4432365.625, 4496935.9375, 4514459.375, 4515912.5, 4525092.1875, 4534492.1875, 4547834.375, 4575310.9375, 4585326.5625, 4588596.875, 4626156.25, 4636429.6875, 4641110.9375, 4641157.8125, 4658356.25, 4667623.4375, 4668820.3125, 4683215.625, 4692364.0625, 4693901.5625, 4697382.8125, 4702895.3125, 4705914.0625, 4710729.6875, 4716715.625, 4718979.6875, 4718979.6875, 4721576.5625, 4724023.4375, 4740521.875, 4741104.6875, 4753154.6875, 4796992.1875, 4810360.9375, 4822298.4375, 4823964.0625, 4833821.875, 4836564.0625, 4844626.5625, 4846645.3125, 4856887.5, 4861290.625, 4864639.0625, 4869829.6875, 4872018.75, 4904923.4375, 4952871.875, 4966859.375, 4983715.625, 4989593.75, 4994854.6875, 5007935.9375, 5011746.875, 5014898.4375, 5017796.875, 5033670.3125, 5034526.5625, 5039940.625, 5048759.375, 5073082.8125, 5078303.125, 5085275.0, 5095835.9375, 5115237.5, 5120532.8125, 5142353.125, 5157578.125, 5160321.875, 5167671.875, 5184042.1875, 5190539.0625, 5211078.125, 5217657.8125, 5242373.4375, 5242375.0, 5261410.9375, 5268876.5625, 5289987.5, 5290276.5625, 5302592.1875, 5302665.625, 5326343.75, 5357887.5, 5362414.0625, 5364851.5625, 5367762.5, 5371967.1875, 5371979.6875, 5373078.125, 5373087.5, 5373871.875, 5384314.0625, 5391817.1875, 5392939.0625, 5393662.5, 5424623.4375, 5431607.8125, 5431637.5, 5542489.0625, 5566043.75, 5606954.6875, 5637765.625, 5643578.125, 5643593.75, 5669556.25, 5669948.4375, 5951293.75, 6001239.0625, 6086362.5, 6086370.3125, 6138085.9375, 6356351.5625, 6392862.5, 6396762.5, 6409676.5625, 6417145.3125, 6418918.75, 6424409.375, 6461706.25, 6497645.3125, 6498998.4375, 6511101.5625, 6538787.5, 6551039.0625, 6563745.3125, 6576421.875, 6595610.9375, 6627362.5, 6627789.0625, 6627803.125, 6642779.6875, 6644973.4375, 6714018.75, 6751995.3125, 6770535.9375, 6787503.125, 6856206.25, 6864709.375, 6872554.6875, 6880689.0625, 6904756.25, 6908471.875, 6923959.375, 6925746.875, 6933843.75, 6975551.5625, 6978018.75, 6982548.4375, 7013621.875, 7044329.6875, 7049875.0, 7054881.25, 7084814.0625, 7085201.5625, 7103809.375, 7137973.4375, 7141196.875, 7158231.25, 7165657.8125, 7185343.75, 7209634.375, 7231834.375, 7246871.875, 7249220.3125, 7288818.75, 7335070.3125, 7335081.25, 7339795.3125, 7345653.125, 7368623.4375, 7373142.1875, 7374037.5, 7379456.25, 7389642.1875, 7389656.25, 7391343.75, 7391542.1875, 7392000.0, 7392446.875, 7398220.3125, 7406279.6875, 7416806.25, 7417289.0625, 7417295.3125, 7421151.5625, 7430768.75, 7445028.125, 7446646.875, 7449987.5, 7450048.4375, 7456259.375, 7456428.125, 7456640.625, 7471482.8125, 7472154.6875, 7482257.8125, 7484815.625, 7489745.3125, 7490284.375, 7494926.5625, 7497390.625, 7504248.4375, 7508557.8125, 7511153.125, 7516600.0, 7523770.3125, 7542960.9375, 7552768.75, 7556373.4375, 7561317.1875, 7565128.125, 7570631.25, 7586706.25, 7587782.8125, 7594001.5625, 7596476.5625, 7596907.8125, 7597779.6875, 7602729.6875, 7618550.0, 7620429.6875, 7620435.9375, 7621545.3125, 7621576.5625, 7625181.25, 7629429.6875, 7630812.5, 7632164.0625, 7645857.8125, 7655718.75, 7658578.125, 7658579.6875, 7658631.25, 7684256.25, 7693248.4375, 7696334.375, 7698617.1875, 7698640.625, 7705017.1875, 7706262.5, 7743084.375, 7751151.5625, 7755917.1875, 7764721.875, 7771070.3125, 7785031.25, 7786431.25, 7789218.75, 7789559.375, 7822479.6875, 7823637.5, 7829618.75, 7844909.375, 7845140.625, 7849551.5625, 7866268.75, 7876570.3125, 7894229.6875, 7894237.5, 7900403.125, 7903307.8125, 7903320.3125, 7929675.0, 7929684.375, 7943184.375, 7958656.25, 7963379.6875, 7963462.5, 7964729.6875, 7967565.625, 7967689.0625, 7968023.4375, 7977184.375, 7977201.5625, 7979596.875, 7985793.75, 7985867.1875, 7994846.875, 8012031.25, 8025629.6875, 8031643.75, 8032339.0625, 8032878.125, 8035640.625, 8035667.1875, 8035848.4375, 8035962.5, 8036490.625, 8052401.5625, 8053787.5, 8073048.4375, 8085475.0, 8088560.9375, 8119718.75, 8121507.8125, 8125043.75, 8125126.5625, 8132248.4375, 8152287.5, 8162296.875, 8167564.0625, 8167923.4375, 8184398.4375, 8193546.875, 8204557.8125, 8208621.875, 8214882.8125, 8214895.3125, 8216015.625, 8217492.1875, 8226376.5625, 8236634.375, 8253909.375, 8270468.75, 8270521.875, 8279437.5, 8285237.5, 8304106.25, 8307625.0, 8310478.125, 8339134.375, 8340056.25, 8344732.8125, 8344948.4375, 8345787.5, 8365265.625, 8377150.0, 8382410.9375, 8382562.5, 8385437.5, 8387495.3125, 8392815.625, 8409857.8125, 8422153.125, 8438442.1875, 8440303.125, 8440789.0625, 8440954.6875, 8457318.75, 8463173.4375, 8463429.6875, 8473434.375, 8491429.6875, 8497693.75, 8498178.125, 8511750.0, 8517632.8125, 8518865.625, 8519481.25, 8524629.6875, 8526403.125, 8531068.75, 8544759.375, 8551620.3125, 8558395.3125, 8558773.4375, 8558792.1875, 8604120.3125, 8607721.875, 8613284.375, 8613856.25, 8615665.625, 8615665.625, 8623284.375, 8623843.75, 8626360.9375, 8627260.9375, 8629035.9375, 8629156.25, 8632742.1875, 8636800.0, 8642000.0, 8646437.5, 8649417.1875, 8650764.0625, 8650832.8125, 8651735.9375, 8651995.3125, 8652270.3125, 8654412.5, 8654415.625, 8666992.1875, 8686307.8125, 8687815.625, 8690760.9375, 8690901.5625, 8695042.1875, 8701471.875, 8705229.6875, 8715464.0625, 8716314.0625, 8718215.625, 8718831.25, 8722082.8125, 8723418.75, 8723446.875, 8723525.0, 8723951.5625, 8725254.6875, 8727762.5, 8736359.375, 8743459.375, 8744790.625, 8746439.0625, 8752575.0, 8759464.0625, 8768525.0, 8769975.0, 8790435.9375, 8797265.625, 8803973.4375, 8813942.1875, 8827754.6875, 8834621.875, 8860553.125, 8861417.1875, 8862434.375, 8874187.5, 8878218.75, 8901118.75, 8911667.1875, 8921603.125, 8942468.75, 8948856.25, 8949446.875, 8963603.125, 8972242.1875, 8975189.0625, 8975195.3125, 8975251.5625, 8978203.125, 8978870.3125, 8990660.9375, 8992045.3125, 9007353.125, 9008207.8125, 9009860.9375, 9010276.5625, 9014137.5, 9025264.0625, 9026546.875, 9026942.1875, 9027373.4375, 9029770.3125, 9030534.375, 9033706.25, 9037496.875, 9038495.3125, 9042614.0625, 9042628.125, 9042871.875, 9050470.3125, 9053646.875, 9071004.6875, 9086912.5, 9087926.5625, 9094907.8125, 9105285.9375, 9114106.25, 9115875.0, 9115879.6875, 9115900.0, 9167504.6875, 9190057.8125, 9190120.3125, 9193934.375, 9212334.375, 9220767.1875, 9240729.6875, 9263198.4375, 9469115.625, 9475731.25, 9783857.8125, 9846853.125, 10301696.875, 10301706.25, 185025821.875], [11.101580363913374, 8.011784695692626, 72.44585526931753, 14.347816589726925, 5.756102129125485, 87.385323374031, 76.17779587299047, 107.99664708764669, 19.72843410604672, 39.10930818687333, 9.627914012043236, 56.80774538435759, 25.96073784466553, 13.914864961612249, 18.780631182643006, 21.313862854451553, 59.95145119039324, 17.506734104519396, 24.128894705115098, 27.900880078693707, 14.241912963078558, 83.29909870515208, 84.95656912316575, 114.99151884044814, 94.59711727798506, 13.24821152486531, 119.72567836013425, 33.820966644943006, 21.289711267876097, 69.03593812205935, 81.53792456572054, 13.085462024600208, 82.56913771889664, 14.878061759705504, 38.32306364371053, 19.640082351115318, 104.35841871084341, 23.33613119831007, 29.446112477769557, 9.916758155287416, 19.836310976595147, 20.695804975224746, 7.493662964348806, 9.517887052723264, 74.45662931151713, 71.94697276297941, 5.850695780298132, 16.3678818520616, 32.673152758975554, 32.38188263824176, 5.833929917311078, 105.17910355392323, 70.46472972578911, 138.93586368691433, 100.54238737123653, 22.19169016818997, 86.80789525674498, 74.17732303324587, 7.921973098748991, 181.45760933303836, 12.865538835059759, 22.395423179730045, 12.323556044231575, 7.904859271664465, 24.75933428959041, 54.819798291645405, 21.512957520995506, 9.63343319717513, 6.086613662262037, 18.823574993431567, 72.21723700807743, 21.033945564225125, 6.720648754888573, 5.358440591995233, 5.160636055314275, 7.195744010751504, 88.01736228879392, 42.38750295577467, 144.68038880856074, 49.553447534604295, 18.072395148610354, 9.060655574834634, 52.62801814856042, 5.0717238443842545, 43.21186709782987, 52.536402972880566, 17.864751961146148, 14.287315191971636, 19.46343947015068, 64.88252002708647, 13.868755671005468, 9.627558165164318, 29.62589868359522, 20.29951035367074, 54.09723818963781, 114.71964071050179, 39.86273802882381, 13.17733595636095, 12.776182417496932, 9.046050360367834, 7.097232536067141, 45.59335801333194, 12.116743368342647, 22.58815668792236, 55.88370765841404, 74.33783700900771, 15.90950105827982, 171.09079965091837, 105.3093756841658, 44.4419602436551, 15.582214119401641, 20.27719987225025, 17.806972650122994, 6.864139974628623, 20.13466554058812, 5.22567103586317, 8.58085327720214, 10.39570948146242, 26.628669275000572, 25.96643410727331, 36.414411198147405, 38.57910342613177, 49.08523676052493, 18.814937358059577, 24.36586388865136, 46.11995442051068, 21.09183107329924, 7.989189350430483, 27.32122480662828, 13.67177568352378, 24.351940212260875, 25.51755546835777, 22.440551371399273, 27.599898078233064, 42.87841004488553, 41.53821672744536, 12.140946917483129, 15.441415095234856, 37.35624868754465, 32.00707771174734, 10.354207548715781, 68.30546735161596, 7.21858151488474, 13.32273075711121, 15.168953534594229, 37.26140245948525, 10.828232404456468, 40.61561905417885, 82.72806466965469, 38.61313322638843, 47.797681788431234, 14.320460033872937, 158.59521125550557, 39.82222881717597, 34.458051712505366, 11.629249847161987, 13.41140708315247, 122.41821928935335, 51.90588102857899, 25.0865107951365, 43.72934918729466, 57.35148903156816, 148.42183022772815, 15.577367813089152, 26.45520724907302, 51.723501921839215, 6.855106421791236, 5.3759971619625535, 15.382859182884408, 65.10575747315265, 32.649236880429605, 33.4376770137219, 16.73482614902011, 5.560629534822578, 25.1792413202484, 49.06687093802242, 70.16475099072075, 16.119269847119025, 7.925374144834829, 60.96404825225152, 14.645526462717534, 17.520041685257205, 5.169484720398979, 33.01409064367853, 33.394733120469866, 19.615364153188764, 5.825247390318702, 23.264118447508253, 11.012188296062108, 49.75632125692971, 23.153826124151028, 13.987642027315875, 5.97752832179726, 18.80935442189234, 22.556824292795135, 20.691589266086662, 26.34250695058015, 31.444172908327978, 43.08589673517366, 95.4749700886816, 7.658633462946834, 56.816964829295934, 47.1081133431399, 5.234899131578936, 8.108716560737406, 15.20693593496299, 14.962603126943653, 80.85441943273635, 62.24374751775872, 53.136234636537964, 6.34260282826561, 7.1328853760424975, 48.95654110399021, 92.23470735631307, 33.22933740867728, 153.7428846859147, 5.110333100648386, 49.668299046297115, 6.465587903414277, 29.53303269971729, 41.14954338251667, 10.70011029441048, 61.70316108293828, 45.99475692190689, 51.29872513410671, 150.779456308735, 34.928129783252835, 6.79123206253547, 27.942673917854787, 25.569029330287627, 24.107166425092522, 28.291392086726326, 41.22476593014589, 25.644334544943533, 43.1268120661893, 5.3000858601886875, 67.64199740177777, 21.321966163434112, 27.670746728993016, 10.603157655723404, 5.809649841241515, 21.40909738239076, 65.14720208670542, 6.225019785769913, 95.16925824836007, 7.22426054126202, 85.13353397017005, 44.54649889678244, 51.056177547348845, 11.867950634716557, 17.81592269462825, 63.32482071922137, 27.203892354485472, 34.726214576468806, 9.977277152773143, 37.71282021159668, 9.484088820854321, 36.08015961687416, 35.02523378112039, 33.357864323790025, 64.32414996045307, 46.8726799871254, 55.35508847047251, 60.89672299304907, 80.25070360187335, 42.66522396574055, 18.18710721523749, 5.844955605952644, 13.415915281224052, 20.32275620900253, 5.099444532726002, 29.100361007161233, 11.809338721573589, 27.50905229491358, 130.6310785440546, 80.08938507526578, 12.711044917266337, 67.64999554654986, 26.9391626942586, 5.113539864091768, 93.64421497772801, 23.34764225286143, 53.11091949613426, 66.4959220582905, 5.304568571679289, 113.03868358754795, 23.79340810045118, 15.921667257794159, 92.10569777732384, 22.058145537301346, 8.273893286303878, 31.719945472755416, 26.469554620319457, 87.05401103975795, 11.011883057385658, 42.002568473547406, 7.758594756965759, 17.77250924131261, 25.81924821258079, 107.15156741743611, 66.7567525601749, 59.99733102652843, 42.00304552705204, 32.191122614878424, 11.75318093533309, 24.34317914342495, 96.36293109271041, 95.3127226805667, 21.385377885435815, 23.1293727065903, 17.025770000330674, 71.0645855095409, 14.731122273842619, 22.706000453600094, 59.453880680543726, 7.908123280936999, 11.72752997682038, 5.8144971898085265, 59.740391536894876, 29.80545426717216, 10.511863490919161, 79.45784306268689, 33.572941090550806, 14.030280145118482, 80.98781998911574, 18.86424619862356, 97.53721968685002, 23.24975761775236, 73.85491215810161, 143.46328966813073, 11.71490097469733, 10.302382204839653, 23.212576151190216, 53.352786510313585, 13.333626895174218, 42.81772783180756, 60.7856035212977, 9.642738784882283, 27.92157851528229, 26.703145494684936, 153.61370988725588, 44.93373463555534, 41.277863382950656, 11.921499635527788, 10.177958241169165, 166.16326976390476, 14.903684436630474, 19.672666753809608, 46.54946779017015, 8.756252296215303, 11.486628361969315, 7.756441988410308, 73.7998003866553, 171.5115540968983, 74.98653248488802, 68.11500799320905, 23.905096365878872, 14.893992767340901, 68.55070323359209, 21.634347244522615, 38.14542859957315, 5.680388207629731, 11.737256337046237, 18.79121470850585, 6.19352103811289, 28.492089445117085, 68.58314955587942, 93.54552867584778, 13.073403174502305, 46.2060181157984, 36.227002965169895, 32.530855673720346, 5.636668874460704, 12.43414898133872, 17.623746604928325, 21.3612728953091, 9.61205674752464, 38.27252200883065, 16.611547295306586, 5.518810750205772, 60.42241918732426, 10.283101256188838, 59.21101158776405, 18.55670053569477, 114.3732680367528, 69.3971316752013, 21.17867522302161, 42.77334718951573, 22.264373703002008, 123.69088950810833, 17.662211614123684, 20.633641971510006, 25.684539860366318, 33.87034536883893, 20.95415977912374, 17.274962044839306, 23.496813421782246, 44.183772073270916, 41.42068118814684, 166.11135665887304, 22.308764811400263, 55.48342281841406, 80.65979048528992, 61.30793481918077, 28.464496298120295, 55.61564756773387, 30.680692819628664, 5.1081660170143754, 23.180296039672285, 16.485853844268522, 56.11685692667604, 44.36688322155889, 213.9425403166021, 16.053704850840788, 11.23170235114088, 16.89426476368958, 24.705032940356634, 16.2018770492917, 23.513649401678155, 32.44791018703346, 30.248830554461403, 89.67930850309871, 40.59119183347853, 48.5807239661626, 169.44530713712177, 34.21477779229892, 5.975668405098904, 5.923652490221701, 106.7693152251893, 124.98863959727944, 9.096912830523662, 30.82932180909603, 5.254466029694362, 66.9954704224761, 12.212662517821258, 206.04817292226727, 31.209438679313465, 9.298853126145952, 67.18239456917279, 6.554575635262604, 31.411381635533218, 68.37312490508562, 35.14284647351524, 8.314890313953917, 78.07629610219774, 9.071100959141496, 132.64101123127813, 36.57254219218948, 115.374437809691, 30.187739978679343, 18.59040570482528, 127.20471094616337, 11.834344810464582, 6.306060258160586, 99.83029974229957, 109.39160606754342, 29.93881600288789, 78.65245736048377, 46.489802750829995, 25.494136803435094, 43.234628840729094, 57.250733240476436, 55.98516543555722, 10.74679190376119, 5.712406217801906, 21.901361962190208, 31.609812459897984, 5.584098092632381, 44.16146483036407, 42.59150343636785, 27.03525642239425, 103.285415942492, 61.54531630814729, 9.528083249612328, 17.086701954631785, 61.39358293001782, 10.392679179823565, 99.54137109642372, 22.136784716123895, 32.41362017211548])
Detected energies during the discharge + Energy spectrum
multiplot(icon_fig, T_int_first,E,xle,Etot)