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 = 44488
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);
([4509303.125, 5726881.25, 5895495.3125, 5898396.875, 5963679.6875, 6033443.75, 6097943.75, 6097945.3125, 6146892.1875, 6147200.0, 6169921.875, 6173812.5, 6220754.6875, 6252118.75, 6254509.375, 6257951.5625, 6258731.25, 6260673.4375, 6290281.25, 6290317.1875, 6290321.875, 6365145.3125, 6388359.375, 6398478.125, 6403035.9375, 6409546.875, 6416400.0, 6416421.875, 6416431.25, 6503960.9375, 6503962.5, 6532671.875, 6535754.6875, 6535798.4375, 6540193.75, 6540206.25, 6543932.8125, 6548207.8125, 6574818.75, 6592940.625, 6595159.375, 6618120.3125, 6618818.75, 6636110.9375, 6649989.0625, 6662557.8125, 6671384.375, 6675345.3125, 6675693.75, 6678309.375, 6682137.5, 6685729.6875, 6688237.5, 6697598.4375, 6699785.9375, 6700290.625, 6708854.6875, 6759795.3125, 6789487.5, 6819693.75, 6819871.875, 6820346.875, 6822345.3125, 6824073.4375, 6828104.6875, 6829032.8125, 6830812.5, 6831871.875, 6831879.6875, 6846090.625, 6854595.3125, 6874039.0625, 6874285.9375, 6875442.1875, 6876396.875, 6876453.125, 6880800.0, 6883087.5, 6883087.5, 6883090.625, 6884518.75, 6903334.375, 6912475.0, 6921434.375, 6928809.375, 6931853.125, 6933328.125, 6968901.5625, 6979415.625, 6985854.6875, 6991734.375, 6999659.375, 7017282.8125, 7017357.8125, 7019720.3125, 7027153.125, 7069204.6875, 7070554.6875, 7070932.8125, 7072831.25, 7074715.625, 7076942.1875, 7107660.9375, 7111607.8125, 7127453.125, 7143932.8125, 7147412.5, 7153400.0, 7156906.25, 7197481.25, 7202660.9375, 7205618.75, 7219554.6875, 7235167.1875, 7243121.875, 7245929.6875, 7246887.5, 7247509.375, 7248621.875, 7252601.5625, 7261642.1875, 7263448.4375, 7263807.8125, 7266307.8125, 7267860.9375, 7272078.125, 7274051.5625, 7292335.9375, 7292339.0625, 7294748.4375, 7326775.0, 7332781.25, 7333576.5625, 7334728.125, 7346076.5625, 7429070.3125, 7435621.875, 7437409.375, 7439900.0, 7441617.1875, 7442550.0, 7443739.0625, 7444204.6875, 7445223.4375, 7445234.375, 7445546.875, 7457279.6875, 7470979.6875, 7476740.625, 7488329.6875, 7493220.3125, 7494729.6875, 7495103.125, 7498042.1875, 7498231.25, 7498473.4375, 7504328.125, 7506909.375, 7507045.3125, 7507467.1875, 7524807.8125, 7533784.375, 7534759.375, 7535201.5625, 7536196.875, 7537164.0625, 7545676.5625, 7549262.5, 7551684.375, 7553984.375, 7554854.6875, 7557237.5, 7557732.8125, 7558039.0625, 7558664.0625, 7558910.9375, 7564082.8125, 7565204.6875, 7568240.625, 7580882.8125, 7580907.8125, 7581057.8125, 7591165.625, 7591464.0625, 7591926.5625, 7593543.75, 7594768.75, 7594845.3125, 7595510.9375, 7596942.1875, 7597665.625, 7598009.375, 7598626.5625, 7598690.625, 7599584.375, 7604117.1875, 7604304.6875, 7605023.4375, 7605767.1875, 7606606.25, 7606635.9375, 7607487.5, 7607554.6875, 7615828.125, 7616632.8125, 7616725.0, 7617206.25, 7617671.875, 7618531.25, 7624687.5, 7624964.0625, 7625057.8125, 7626087.5, 7628621.875, 7629587.5, 7629648.4375, 7632651.5625, 7633687.5, 7633885.9375, 7634245.3125, 7639203.125, 7639662.5, 7639685.9375, 7640151.5625, 7641714.0625, 7642845.3125, 7643232.8125, 7643748.4375, 7644489.0625, 7644739.0625, 7644942.1875, 7645885.9375, 7647620.3125, 7648367.1875, 7648417.1875, 7654084.375, 7657085.9375, 7665100.0, 7670917.1875, 7671278.125, 7671289.0625, 7676937.5, 7677473.4375, 7677768.75, 7677832.8125, 7681734.375, 7682717.1875, 7682837.5, 7685981.25, 7701057.8125, 7702171.875, 7705756.25, 7714235.9375, 7732807.8125, 7736170.3125, 7736506.25, 7742768.75, 7744229.6875, 7746053.125, 7746629.6875, 7748007.8125, 7748096.875, 7748453.125, 7749090.625, 7749904.6875, 7750909.375, 7759750.0, 7764579.6875, 7765901.5625, 7776676.5625, 7788829.6875, 7822196.875, 7881740.625, 7881764.0625, 7882896.875, 7936025.0, 7984193.75, 8006200.0, 8045176.5625, 8145351.5625, 8145407.8125, 8145735.9375, 8146023.4375, 8146496.875, 8151556.25, 8152760.9375, 8223973.4375, 8224584.375, 8227187.5, 8246671.875, 8247096.875, 8249906.25, 8271876.5625, 8273917.1875, 8305432.8125, 8308284.375, 8308415.625, 8309623.4375, 8309667.1875, 8309767.1875, 8315026.5625, 8315085.9375, 8316010.9375, 8318675.0, 8362768.75, 8363171.875, 8363753.125, 8367021.875, 8367409.375, 8368612.5, 8388445.3125, 8388625.0, 8389509.375, 8389584.375, 8390350.0, 8392196.875, 8413985.9375, 8417773.4375, 8418895.3125, 8418950.0, 8432876.5625, 8435734.375, 8436945.3125, 8438981.25, 8452975.0, 8468428.125, 8468440.625, 8494278.125, 8512312.5, 8518373.4375, 8518895.3125, 8520242.1875, 8520471.875, 8520750.0, 8520806.25, 8520931.25, 8522456.25, 8530384.375, 8555868.75, 8557051.5625, 8557075.0, 8558443.75, 8564120.3125, 8591182.8125, 8596387.5, 8596989.0625, 8597181.25, 8599428.125, 8599742.1875, 8599923.4375, 8600503.125, 8601029.6875, 8601092.1875, 8617042.1875, 8617478.125, 8617481.25, 8618496.875, 8618642.1875, 8619318.75, 8621273.4375, 8653617.1875, 8657764.0625, 8658732.8125, 8661471.875, 8689989.0625, 8692842.1875, 8696203.125, 8700734.375, 8713471.875, 8713493.75, 8713501.5625, 8713715.625, 8714410.9375, 8714654.6875, 8714796.875, 8717371.875, 8717834.375, 8718621.875, 8719215.625, 8719776.5625, 8719981.25, 8720242.1875, 8720396.875, 8720595.3125, 8720737.5, 8720956.25, 8720964.0625, 8721056.25, 8721107.8125, 8721431.25, 8721850.0, 8722400.0, 8722690.625, 8724184.375, 8724614.0625, 8725993.75, 8726001.5625, 8727760.9375, 8728892.1875, 8731070.3125, 8731942.1875, 8732196.875, 8732257.8125, 8732356.25, 8732507.8125, 8732742.1875, 8733379.6875, 8734014.0625, 8734310.9375, 8734723.4375, 8734982.8125, 8735154.6875, 8735173.4375, 8735335.9375, 8735479.6875, 8735817.1875, 8736256.25, 8736321.875, 8736348.4375, 8736693.75, 8736803.125, 8737360.9375, 8737475.0, 8737560.9375, 8737575.0, 8737660.9375, 8737743.75, 8737896.875, 8738057.8125, 8738118.75, 8738164.0625, 8738257.8125, 8738379.6875, 8738495.3125, 8738756.25, 8738825.0, 8738856.25, 8739031.25, 8740304.6875, 8740520.3125, 8740787.5, 8741028.125, 8741195.3125, 8741275.0, 8741493.75, 8741965.625, 8742026.5625, 8742303.125, 8742631.25, 8742862.5, 8742951.5625, 8743404.6875, 8744089.0625, 8756454.6875, 8756687.5, 8764475.0, 8770170.3125, 8776865.625, 8778262.5, 8779309.375, 8779475.0, 8779689.0625, 8779704.6875, 8779732.8125, 8779970.3125, 8789154.6875, 8800957.8125, 8801029.6875, 8801151.5625, 8805629.6875, 8840106.25, 8840456.25, 8851953.125, 8853264.0625, 8858865.625, 8859253.125, 8863767.1875, 8866765.625, 8868876.5625, 8872748.4375, 8952567.1875, 8952579.6875, 9045673.4375, 9320275.0, 9331740.625, 9334976.5625, 9382781.25, 271843206.25], [41.67178873297116, 5.578634164171258, 14.527171980981278, 92.71928777235759, 9.943565057371199, 36.08486251050869, 13.221944074687602, 69.41645310810846, 27.69444754996908, 73.02106767267703, 57.960142658057386, 13.014364806437177, 8.933485182324157, 10.897374456283067, 84.02865180245084, 112.9943431032024, 23.209709127437026, 12.46527407456302, 11.948455055185722, 32.7920881265001, 14.041936658446854, 41.53471289339199, 41.38030218290467, 90.00661007257087, 13.068115453201626, 10.632407195900509, 17.780300807806174, 82.04592951126207, 17.506274870174575, 8.658141828528665, 56.26282802781747, 25.616048587634474, 32.41780436878059, 233.2684992205805, 49.60656401363786, 27.06134919580792, 8.088057441082443, 44.353889201370464, 11.56781513294806, 49.68119096913122, 18.701334793117574, 11.35066189508997, 78.44248016439778, 6.302004025477443, 128.78587535749983, 37.006688160520305, 13.098098548688759, 79.82151367664332, 6.90160430729582, 57.63868398181887, 117.86245661284782, 58.52337918109647, 8.022217110731743, 53.49100452069713, 9.513471873601143, 29.821775990551338, 10.661494157234163, 37.109198538044176, 46.90013937247279, 101.16609547270522, 109.2355030756971, 6.924420708533361, 9.973597555857305, 8.145766729474204, 43.56455545505315, 8.32402119294648, 6.8713105414908515, 35.307802696409496, 101.65123769102277, 10.409744781190714, 28.64555328477701, 32.19049188794404, 53.75567327692757, 60.851284770422595, 40.04754270598194, 6.080612587319049, 7.874261535271877, 6.8419890474824925, 6.589599100127268, 19.77196782346693, 13.454462889413382, 53.349861719368576, 14.025001206923225, 40.46809587859134, 44.49082009030248, 12.548803580065574, 16.387230341030914, 48.948522944671566, 83.08240828428576, 10.550274329660587, 32.18358486569456, 95.29205373207834, 9.25215537385079, 29.619193565545636, 58.032135718006046, 82.8619623224343, 39.05142857135997, 15.147824937405243, 61.81519758828101, 194.04806942468161, 42.89518779516269, 35.944097832114856, 35.06072721779722, 86.08028151635855, 7.439513154878682, 13.27580732593714, 10.948450018665188, 59.58737666114197, 15.15380019181062, 9.774557528079113, 42.63967702672404, 12.205259511257232, 34.12014829325785, 57.00322683697621, 40.90324352035722, 33.25008264404635, 70.62406520287928, 42.19379569300597, 41.96374347646452, 11.341733237758907, 13.192374449218766, 30.250826634854775, 20.46186525425784, 84.2541893259285, 28.529989595911275, 86.11283417895315, 13.216834591017015, 19.856356214502014, 8.641456053944486, 25.946239927140603, 96.28146712883114, 8.406319727193129, 14.13931631707727, 27.430530648706025, 80.23888584828832, 29.879533248325526, 24.55152425662531, 205.20926819524882, 21.050387706765882, 56.47758741302982, 89.38913036861103, 10.195811916515671, 8.409969468438304, 26.683720395285313, 67.06488160922815, 72.77219589675096, 10.002998272128142, 56.06921158341417, 51.34616565814398, 52.926285546540086, 114.96493713747361, 37.56981328629935, 51.03465600426623, 17.309148181911752, 60.87728048009039, 16.736195279349438, 23.898593970663768, 12.025298152599758, 100.64460293711491, 60.46932707297623, 5.891540841243194, 38.588299985966835, 28.071293338284526, 17.527585106445283, 17.9081981160582, 32.181731182585466, 91.78334567281506, 92.29708403564521, 23.46155867799992, 22.04820577637732, 69.38576901863041, 34.367093771131444, 41.38807644874464, 36.86327356861686, 33.78895011136538, 6.5489616886872914, 137.30840248597357, 23.462782246145288, 40.77381961514763, 125.91971053771098, 34.60292475387246, 6.947342438945286, 28.784813518049603, 10.617126477751192, 8.766789707632125, 114.36481324289282, 340.672940655638, 42.96578471165742, 8.382172636704846, 38.19327345519459, 32.83423638820268, 21.02250443029666, 49.4438354997352, 46.94228398503433, 37.05968518697375, 65.64144159152502, 100.59113675217426, 17.699254981219468, 11.773878086795394, 84.1176700128994, 12.967142248504791, 57.21692526335513, 5.081997639867709, 177.44310742486937, 41.64710748998508, 9.319466360404947, 64.34755264408076, 29.407269876702877, 7.618772737279266, 12.682753147160676, 15.219779579178745, 5.132283996595804, 26.1550569271629, 43.757639763466095, 69.55694212325895, 6.678740706663369, 10.13288892332824, 64.23691024251312, 75.46411743837635, 6.48261265990011, 120.97958329322341, 16.205089248215298, 62.64008998527797, 36.215881559794816, 20.46662235741879, 169.5402755402704, 56.8681541317533, 13.69627693486664, 43.454607972334195, 91.10115093428433, 60.42235727900473, 20.964365202569684, 117.49495905917921, 58.55120695978522, 7.24797881311785, 9.674857874985516, 76.65356822550135, 25.47274184967929, 106.27528833955205, 33.19900987322498, 17.540219252291198, 26.1970987189968, 73.09845275673389, 10.902481219422834, 5.905962921892926, 54.704560244593154, 54.87487726844623, 18.591837974207447, 97.86303030151267, 20.291786812926713, 26.422870907038032, 14.233084694653439, 11.650820298304197, 67.52761244920605, 100.75290805061003, 127.05188872023447, 42.561179822128224, 27.04689079053583, 45.92313356954443, 49.62550085815417, 140.30581005346002, 21.519223233576433, 31.609751301136512, 36.96703145055269, 33.40716621061067, 5.558496972627978, 5.3428380068830466, 20.449871089162627, 20.189062465497717, 6.182986602546195, 31.151648037187744, 68.32766572392575, 54.368501890435965, 76.6697052619113, 41.86923531565741, 56.52416294405178, 17.83468151793812, 43.1342744466707, 59.18376268661839, 12.741394428016106, 5.228499446469903, 59.21361925533664, 6.9467905412409, 97.03336181343798, 46.647716589372116, 25.86102368293768, 58.18971812496032, 72.37578523313113, 70.23795468521033, 41.16219601764927, 22.393695445851783, 20.65527936419075, 11.403946278919419, 106.49575214276896, 15.843257456768184, 90.04771418632353, 8.077769225653508, 46.88587030634015, 6.383660956368158, 25.486708757198922, 46.22713168555553, 6.174385215143308, 13.27734147881969, 5.528908700389755, 17.54939218091406, 66.91137081604688, 7.132156315521342, 17.051580732744323, 32.282498899032916, 64.08295146631272, 30.751944526052075, 59.36985399745167, 28.42911724117826, 26.51216975387128, 21.74859893938685, 38.8674289567833, 26.906290510316264, 6.016739397606368, 27.735729771392258, 5.320834883010508, 11.388378225709289, 92.90130322952342, 16.10060928419711, 141.54857450739678, 96.18074231830602, 38.99324947046772, 79.99738658167935, 257.91355691379533, 36.32850773539004, 50.58369492351422, 45.652638788549496, 49.88628218131724, 124.1194531609494, 105.37731265625145, 16.864413216700004, 9.984867026109365, 65.88650254559872, 309.8974819888052, 28.96891938342963, 71.35850026365931, 22.65038521157153, 15.27400433296637, 51.99358758712998, 144.68457620754197, 61.14916732924348, 22.72603305895, 7.0955692772894645, 73.08266696701625, 11.705428480412463, 40.8631636501282, 29.900148504460994, 51.70550664992193, 124.34951737893681, 36.550136523179376, 72.38013829499657, 24.990264044061995, 91.60050668300889, 53.63509192559013, 58.63115692660871, 16.425835433610807, 64.95686848211781, 11.568971017455887, 13.366625400556893, 7.136111567576853, 13.903548887343463, 33.99459328652728, 45.458457395131354, 14.98955848235012, 56.675787117269515, 53.99269679240055, 8.440581653043646, 52.53796815078363, 37.512425263222234, 38.56721315874269, 44.83772420480217, 52.00118442254174, 36.513239744838515, 8.953723696357054, 34.96939989346399, 39.48071546634512, 22.004016172567542, 12.551797281105744, 39.58130550472742, 52.47534216610209, 53.327282586386175, 24.69167575014622, 14.629796409513197, 26.173845544400756, 10.89469325881429, 9.206762356134973, 9.083295388613589, 48.42434599292518, 5.22124257563242, 82.81576692027579, 42.89318852469586, 33.75141089592246, 95.10603203796944, 24.884253114019945, 132.4425800903468, 5.088706848412747, 72.25196325331308, 61.838405642093406, 32.73645084073963, 45.2007067329995, 7.798372872961571, 13.613484458735046, 46.924154574442184, 9.828931566883199, 56.18283986808998, 10.556941016983506, 26.439853522341927, 34.94967079422484, 12.296289453402789, 88.90337715472128, 11.940769052917432, 60.96409245027057, 70.39573890641694, 91.66743496656821, 7.4492343856548295, 182.8403958203387, 19.321066765768254, 6.496114093731783, 19.33199020722344, 35.06021899391598, 20.11160000901891, 5.318552387885878, 58.63684382933097, 82.63127795324667, 8.88151463512787, 17.555994986526574, 83.67302132806391, 9.532419809647742, 50.43002153082149, 82.89481131088823, 11.995172383002703, 68.63226284559707, 39.601998707833644, 69.46597327793512, 23.311049175523202, 22.97639715920836, 72.09737344602246, 25.756357801226905, 7.837935827374959, 13.085653596850904, 5.034588242010135, 10.719510107994, 6.350316809612064, 5.705682402392434, 21.263083685863393, 55.2119769197665, 5.191668554899057, 35.981045109133305, 23.137188027499334, 51.87207652705913, 12.205313884370787, 5.052273174345627, 5.471181914399071, 48.92904995979554, 128.73986977478432, 17.95897990316097, 7.808070017992536, 88.03736798436725, 26.99958545392189, 15.588450301809395, 26.367120929089435, 93.5929311705362, 22.99607125752202, 5.7767592322552686, 21.46557907728417, 88.75043419299207, 11.702671398863707, 99.5319089792854, 18.42535623947937, 10.154054195142587, 53.2099984368438, 72.0026660095297, 96.44337751623125, 9.267942944265153, 17.361363422588564, 35.48719516606059, 27.82006886043832, 25.31515916175496, 159.6750841565885, 6.406805964648084, 29.00121202326489, 14.192230459707645, 18.2809547179354, 167.49023432177464])
caption, xmean,count, xle, Etot = energy_spectrum(E_tot)
hist_file(E_hist, xmean, count, caption);
([4509303.125, 5726881.25, 5895495.3125, 5898396.875, 5963679.6875, 6033443.75, 6097943.75, 6097945.3125, 6146892.1875, 6147200.0, 6169921.875, 6173812.5, 6220754.6875, 6252118.75, 6254509.375, 6257951.5625, 6258731.25, 6260673.4375, 6290281.25, 6290317.1875, 6290321.875, 6365145.3125, 6388359.375, 6398478.125, 6403035.9375, 6409546.875, 6416400.0, 6416421.875, 6416431.25, 6503960.9375, 6503962.5, 6532671.875, 6535754.6875, 6535798.4375, 6540193.75, 6540206.25, 6543932.8125, 6548207.8125, 6574818.75, 6592940.625, 6595159.375, 6618120.3125, 6618818.75, 6636110.9375, 6649989.0625, 6662557.8125, 6671384.375, 6675345.3125, 6675693.75, 6678309.375, 6682137.5, 6685729.6875, 6688237.5, 6697598.4375, 6699785.9375, 6700290.625, 6708854.6875, 6759795.3125, 6789487.5, 6819693.75, 6819871.875, 6820346.875, 6822345.3125, 6824073.4375, 6828104.6875, 6829032.8125, 6830812.5, 6831871.875, 6831879.6875, 6846090.625, 6854595.3125, 6874039.0625, 6874285.9375, 6875442.1875, 6876396.875, 6876453.125, 6880800.0, 6883087.5, 6883087.5, 6883090.625, 6884518.75, 6903334.375, 6912475.0, 6921434.375, 6928809.375, 6931853.125, 6933328.125, 6968901.5625, 6979415.625, 6985854.6875, 6991734.375, 6999659.375, 7017282.8125, 7017357.8125, 7019720.3125, 7027153.125, 7069204.6875, 7070554.6875, 7070932.8125, 7072831.25, 7074715.625, 7076942.1875, 7107660.9375, 7111607.8125, 7127453.125, 7143932.8125, 7147412.5, 7153400.0, 7156906.25, 7197481.25, 7202660.9375, 7205618.75, 7219554.6875, 7235167.1875, 7243121.875, 7245929.6875, 7246887.5, 7247509.375, 7248621.875, 7252601.5625, 7261642.1875, 7263448.4375, 7263807.8125, 7266307.8125, 7267860.9375, 7272078.125, 7274051.5625, 7292335.9375, 7292339.0625, 7294748.4375, 7326775.0, 7332781.25, 7333576.5625, 7334728.125, 7346076.5625, 7429070.3125, 7435621.875, 7437409.375, 7439900.0, 7441617.1875, 7442550.0, 7443739.0625, 7444204.6875, 7445223.4375, 7445234.375, 7445546.875, 7457279.6875, 7470979.6875, 7476740.625, 7488329.6875, 7493220.3125, 7494729.6875, 7495103.125, 7498042.1875, 7498231.25, 7498473.4375, 7504328.125, 7506909.375, 7507045.3125, 7507467.1875, 7524807.8125, 7533784.375, 7534759.375, 7535201.5625, 7536196.875, 7537164.0625, 7545676.5625, 7549262.5, 7551684.375, 7553984.375, 7554854.6875, 7557237.5, 7557732.8125, 7558039.0625, 7558664.0625, 7558910.9375, 7564082.8125, 7565204.6875, 7568240.625, 7580882.8125, 7580907.8125, 7581057.8125, 7591165.625, 7591464.0625, 7591926.5625, 7593543.75, 7594768.75, 7594845.3125, 7595510.9375, 7596942.1875, 7597665.625, 7598009.375, 7598626.5625, 7598690.625, 7599584.375, 7604117.1875, 7604304.6875, 7605023.4375, 7605767.1875, 7606606.25, 7606635.9375, 7607487.5, 7607554.6875, 7615828.125, 7616632.8125, 7616725.0, 7617206.25, 7617671.875, 7618531.25, 7624687.5, 7624964.0625, 7625057.8125, 7626087.5, 7628621.875, 7629587.5, 7629648.4375, 7632651.5625, 7633687.5, 7633885.9375, 7634245.3125, 7639203.125, 7639662.5, 7639685.9375, 7640151.5625, 7641714.0625, 7642845.3125, 7643232.8125, 7643748.4375, 7644489.0625, 7644739.0625, 7644942.1875, 7645885.9375, 7647620.3125, 7648367.1875, 7648417.1875, 7654084.375, 7657085.9375, 7665100.0, 7670917.1875, 7671278.125, 7671289.0625, 7676937.5, 7677473.4375, 7677768.75, 7677832.8125, 7681734.375, 7682717.1875, 7682837.5, 7685981.25, 7701057.8125, 7702171.875, 7705756.25, 7714235.9375, 7732807.8125, 7736170.3125, 7736506.25, 7742768.75, 7744229.6875, 7746053.125, 7746629.6875, 7748007.8125, 7748096.875, 7748453.125, 7749090.625, 7749904.6875, 7750909.375, 7759750.0, 7764579.6875, 7765901.5625, 7776676.5625, 7788829.6875, 7822196.875, 7881740.625, 7881764.0625, 7882896.875, 7936025.0, 7984193.75, 8006200.0, 8045176.5625, 8145351.5625, 8145407.8125, 8145735.9375, 8146023.4375, 8146496.875, 8151556.25, 8152760.9375, 8223973.4375, 8224584.375, 8227187.5, 8246671.875, 8247096.875, 8249906.25, 8271876.5625, 8273917.1875, 8305432.8125, 8308284.375, 8308415.625, 8309623.4375, 8309667.1875, 8309767.1875, 8315026.5625, 8315085.9375, 8316010.9375, 8318675.0, 8362768.75, 8363171.875, 8363753.125, 8367021.875, 8367409.375, 8368612.5, 8388445.3125, 8388625.0, 8389509.375, 8389584.375, 8390350.0, 8392196.875, 8413985.9375, 8417773.4375, 8418895.3125, 8418950.0, 8432876.5625, 8435734.375, 8436945.3125, 8438981.25, 8452975.0, 8468428.125, 8468440.625, 8494278.125, 8512312.5, 8518373.4375, 8518895.3125, 8520242.1875, 8520471.875, 8520750.0, 8520806.25, 8520931.25, 8522456.25, 8530384.375, 8555868.75, 8557051.5625, 8557075.0, 8558443.75, 8564120.3125, 8591182.8125, 8596387.5, 8596989.0625, 8597181.25, 8599428.125, 8599742.1875, 8599923.4375, 8600503.125, 8601029.6875, 8601092.1875, 8617042.1875, 8617478.125, 8617481.25, 8618496.875, 8618642.1875, 8619318.75, 8621273.4375, 8653617.1875, 8657764.0625, 8658732.8125, 8661471.875, 8689989.0625, 8692842.1875, 8696203.125, 8700734.375, 8713471.875, 8713493.75, 8713501.5625, 8713715.625, 8714410.9375, 8714654.6875, 8714796.875, 8717371.875, 8717834.375, 8718621.875, 8719215.625, 8719776.5625, 8719981.25, 8720242.1875, 8720396.875, 8720595.3125, 8720737.5, 8720956.25, 8720964.0625, 8721056.25, 8721107.8125, 8721431.25, 8721850.0, 8722400.0, 8722690.625, 8724184.375, 8724614.0625, 8725993.75, 8726001.5625, 8727760.9375, 8728892.1875, 8731070.3125, 8731942.1875, 8732196.875, 8732257.8125, 8732356.25, 8732507.8125, 8732742.1875, 8733379.6875, 8734014.0625, 8734310.9375, 8734723.4375, 8734982.8125, 8735154.6875, 8735173.4375, 8735335.9375, 8735479.6875, 8735817.1875, 8736256.25, 8736321.875, 8736348.4375, 8736693.75, 8736803.125, 8737360.9375, 8737475.0, 8737560.9375, 8737575.0, 8737660.9375, 8737743.75, 8737896.875, 8738057.8125, 8738118.75, 8738164.0625, 8738257.8125, 8738379.6875, 8738495.3125, 8738756.25, 8738825.0, 8738856.25, 8739031.25, 8740304.6875, 8740520.3125, 8740787.5, 8741028.125, 8741195.3125, 8741275.0, 8741493.75, 8741965.625, 8742026.5625, 8742303.125, 8742631.25, 8742862.5, 8742951.5625, 8743404.6875, 8744089.0625, 8756454.6875, 8756687.5, 8764475.0, 8770170.3125, 8776865.625, 8778262.5, 8779309.375, 8779475.0, 8779689.0625, 8779704.6875, 8779732.8125, 8779970.3125, 8789154.6875, 8800957.8125, 8801029.6875, 8801151.5625, 8805629.6875, 8840106.25, 8840456.25, 8851953.125, 8853264.0625, 8858865.625, 8859253.125, 8863767.1875, 8866765.625, 8868876.5625, 8872748.4375, 8952567.1875, 8952579.6875, 9045673.4375, 9320275.0, 9331740.625, 9334976.5625, 9382781.25, 271843206.25], [41.67178873297116, 5.578634164171258, 14.527171980981278, 92.71928777235759, 9.943565057371199, 36.08486251050869, 13.221944074687602, 69.41645310810846, 27.69444754996908, 73.02106767267703, 57.960142658057386, 13.014364806437177, 8.933485182324157, 10.897374456283067, 84.02865180245084, 112.9943431032024, 23.209709127437026, 12.46527407456302, 11.948455055185722, 32.7920881265001, 14.041936658446854, 41.53471289339199, 41.38030218290467, 90.00661007257087, 13.068115453201626, 10.632407195900509, 17.780300807806174, 82.04592951126207, 17.506274870174575, 8.658141828528665, 56.26282802781747, 25.616048587634474, 32.41780436878059, 233.2684992205805, 49.60656401363786, 27.06134919580792, 8.088057441082443, 44.353889201370464, 11.56781513294806, 49.68119096913122, 18.701334793117574, 11.35066189508997, 78.44248016439778, 6.302004025477443, 128.78587535749983, 37.006688160520305, 13.098098548688759, 79.82151367664332, 6.90160430729582, 57.63868398181887, 117.86245661284782, 58.52337918109647, 8.022217110731743, 53.49100452069713, 9.513471873601143, 29.821775990551338, 10.661494157234163, 37.109198538044176, 46.90013937247279, 101.16609547270522, 109.2355030756971, 6.924420708533361, 9.973597555857305, 8.145766729474204, 43.56455545505315, 8.32402119294648, 6.8713105414908515, 35.307802696409496, 101.65123769102277, 10.409744781190714, 28.64555328477701, 32.19049188794404, 53.75567327692757, 60.851284770422595, 40.04754270598194, 6.080612587319049, 7.874261535271877, 6.8419890474824925, 6.589599100127268, 19.77196782346693, 13.454462889413382, 53.349861719368576, 14.025001206923225, 40.46809587859134, 44.49082009030248, 12.548803580065574, 16.387230341030914, 48.948522944671566, 83.08240828428576, 10.550274329660587, 32.18358486569456, 95.29205373207834, 9.25215537385079, 29.619193565545636, 58.032135718006046, 82.8619623224343, 39.05142857135997, 15.147824937405243, 61.81519758828101, 194.04806942468161, 42.89518779516269, 35.944097832114856, 35.06072721779722, 86.08028151635855, 7.439513154878682, 13.27580732593714, 10.948450018665188, 59.58737666114197, 15.15380019181062, 9.774557528079113, 42.63967702672404, 12.205259511257232, 34.12014829325785, 57.00322683697621, 40.90324352035722, 33.25008264404635, 70.62406520287928, 42.19379569300597, 41.96374347646452, 11.341733237758907, 13.192374449218766, 30.250826634854775, 20.46186525425784, 84.2541893259285, 28.529989595911275, 86.11283417895315, 13.216834591017015, 19.856356214502014, 8.641456053944486, 25.946239927140603, 96.28146712883114, 8.406319727193129, 14.13931631707727, 27.430530648706025, 80.23888584828832, 29.879533248325526, 24.55152425662531, 205.20926819524882, 21.050387706765882, 56.47758741302982, 89.38913036861103, 10.195811916515671, 8.409969468438304, 26.683720395285313, 67.06488160922815, 72.77219589675096, 10.002998272128142, 56.06921158341417, 51.34616565814398, 52.926285546540086, 114.96493713747361, 37.56981328629935, 51.03465600426623, 17.309148181911752, 60.87728048009039, 16.736195279349438, 23.898593970663768, 12.025298152599758, 100.64460293711491, 60.46932707297623, 5.891540841243194, 38.588299985966835, 28.071293338284526, 17.527585106445283, 17.9081981160582, 32.181731182585466, 91.78334567281506, 92.29708403564521, 23.46155867799992, 22.04820577637732, 69.38576901863041, 34.367093771131444, 41.38807644874464, 36.86327356861686, 33.78895011136538, 6.5489616886872914, 137.30840248597357, 23.462782246145288, 40.77381961514763, 125.91971053771098, 34.60292475387246, 6.947342438945286, 28.784813518049603, 10.617126477751192, 8.766789707632125, 114.36481324289282, 340.672940655638, 42.96578471165742, 8.382172636704846, 38.19327345519459, 32.83423638820268, 21.02250443029666, 49.4438354997352, 46.94228398503433, 37.05968518697375, 65.64144159152502, 100.59113675217426, 17.699254981219468, 11.773878086795394, 84.1176700128994, 12.967142248504791, 57.21692526335513, 5.081997639867709, 177.44310742486937, 41.64710748998508, 9.319466360404947, 64.34755264408076, 29.407269876702877, 7.618772737279266, 12.682753147160676, 15.219779579178745, 5.132283996595804, 26.1550569271629, 43.757639763466095, 69.55694212325895, 6.678740706663369, 10.13288892332824, 64.23691024251312, 75.46411743837635, 6.48261265990011, 120.97958329322341, 16.205089248215298, 62.64008998527797, 36.215881559794816, 20.46662235741879, 169.5402755402704, 56.8681541317533, 13.69627693486664, 43.454607972334195, 91.10115093428433, 60.42235727900473, 20.964365202569684, 117.49495905917921, 58.55120695978522, 7.24797881311785, 9.674857874985516, 76.65356822550135, 25.47274184967929, 106.27528833955205, 33.19900987322498, 17.540219252291198, 26.1970987189968, 73.09845275673389, 10.902481219422834, 5.905962921892926, 54.704560244593154, 54.87487726844623, 18.591837974207447, 97.86303030151267, 20.291786812926713, 26.422870907038032, 14.233084694653439, 11.650820298304197, 67.52761244920605, 100.75290805061003, 127.05188872023447, 42.561179822128224, 27.04689079053583, 45.92313356954443, 49.62550085815417, 140.30581005346002, 21.519223233576433, 31.609751301136512, 36.96703145055269, 33.40716621061067, 5.558496972627978, 5.3428380068830466, 20.449871089162627, 20.189062465497717, 6.182986602546195, 31.151648037187744, 68.32766572392575, 54.368501890435965, 76.6697052619113, 41.86923531565741, 56.52416294405178, 17.83468151793812, 43.1342744466707, 59.18376268661839, 12.741394428016106, 5.228499446469903, 59.21361925533664, 6.9467905412409, 97.03336181343798, 46.647716589372116, 25.86102368293768, 58.18971812496032, 72.37578523313113, 70.23795468521033, 41.16219601764927, 22.393695445851783, 20.65527936419075, 11.403946278919419, 106.49575214276896, 15.843257456768184, 90.04771418632353, 8.077769225653508, 46.88587030634015, 6.383660956368158, 25.486708757198922, 46.22713168555553, 6.174385215143308, 13.27734147881969, 5.528908700389755, 17.54939218091406, 66.91137081604688, 7.132156315521342, 17.051580732744323, 32.282498899032916, 64.08295146631272, 30.751944526052075, 59.36985399745167, 28.42911724117826, 26.51216975387128, 21.74859893938685, 38.8674289567833, 26.906290510316264, 6.016739397606368, 27.735729771392258, 5.320834883010508, 11.388378225709289, 92.90130322952342, 16.10060928419711, 141.54857450739678, 96.18074231830602, 38.99324947046772, 79.99738658167935, 257.91355691379533, 36.32850773539004, 50.58369492351422, 45.652638788549496, 49.88628218131724, 124.1194531609494, 105.37731265625145, 16.864413216700004, 9.984867026109365, 65.88650254559872, 309.8974819888052, 28.96891938342963, 71.35850026365931, 22.65038521157153, 15.27400433296637, 51.99358758712998, 144.68457620754197, 61.14916732924348, 22.72603305895, 7.0955692772894645, 73.08266696701625, 11.705428480412463, 40.8631636501282, 29.900148504460994, 51.70550664992193, 124.34951737893681, 36.550136523179376, 72.38013829499657, 24.990264044061995, 91.60050668300889, 53.63509192559013, 58.63115692660871, 16.425835433610807, 64.95686848211781, 11.568971017455887, 13.366625400556893, 7.136111567576853, 13.903548887343463, 33.99459328652728, 45.458457395131354, 14.98955848235012, 56.675787117269515, 53.99269679240055, 8.440581653043646, 52.53796815078363, 37.512425263222234, 38.56721315874269, 44.83772420480217, 52.00118442254174, 36.513239744838515, 8.953723696357054, 34.96939989346399, 39.48071546634512, 22.004016172567542, 12.551797281105744, 39.58130550472742, 52.47534216610209, 53.327282586386175, 24.69167575014622, 14.629796409513197, 26.173845544400756, 10.89469325881429, 9.206762356134973, 9.083295388613589, 48.42434599292518, 5.22124257563242, 82.81576692027579, 42.89318852469586, 33.75141089592246, 95.10603203796944, 24.884253114019945, 132.4425800903468, 5.088706848412747, 72.25196325331308, 61.838405642093406, 32.73645084073963, 45.2007067329995, 7.798372872961571, 13.613484458735046, 46.924154574442184, 9.828931566883199, 56.18283986808998, 10.556941016983506, 26.439853522341927, 34.94967079422484, 12.296289453402789, 88.90337715472128, 11.940769052917432, 60.96409245027057, 70.39573890641694, 91.66743496656821, 7.4492343856548295, 182.8403958203387, 19.321066765768254, 6.496114093731783, 19.33199020722344, 35.06021899391598, 20.11160000901891, 5.318552387885878, 58.63684382933097, 82.63127795324667, 8.88151463512787, 17.555994986526574, 83.67302132806391, 9.532419809647742, 50.43002153082149, 82.89481131088823, 11.995172383002703, 68.63226284559707, 39.601998707833644, 69.46597327793512, 23.311049175523202, 22.97639715920836, 72.09737344602246, 25.756357801226905, 7.837935827374959, 13.085653596850904, 5.034588242010135, 10.719510107994, 6.350316809612064, 5.705682402392434, 21.263083685863393, 55.2119769197665, 5.191668554899057, 35.981045109133305, 23.137188027499334, 51.87207652705913, 12.205313884370787, 5.052273174345627, 5.471181914399071, 48.92904995979554, 128.73986977478432, 17.95897990316097, 7.808070017992536, 88.03736798436725, 26.99958545392189, 15.588450301809395, 26.367120929089435, 93.5929311705362, 22.99607125752202, 5.7767592322552686, 21.46557907728417, 88.75043419299207, 11.702671398863707, 99.5319089792854, 18.42535623947937, 10.154054195142587, 53.2099984368438, 72.0026660095297, 96.44337751623125, 9.267942944265153, 17.361363422588564, 35.48719516606059, 27.82006886043832, 25.31515916175496, 159.6750841565885, 6.406805964648084, 29.00121202326489, 14.192230459707645, 18.2809547179354, 167.49023432177464])
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);
([4509303.125, 5726881.25, 5895495.3125, 5898396.875, 5963679.6875, 6033443.75, 6097943.75, 6097945.3125, 6146892.1875, 6147200.0, 6169921.875, 6173812.5, 6220754.6875, 6252118.75, 6254509.375, 6257951.5625, 6258731.25, 6260673.4375, 6290281.25, 6290317.1875, 6290321.875, 6365145.3125, 6388359.375, 6398478.125, 6403035.9375, 6409546.875, 6416400.0, 6416421.875, 6416431.25, 6503960.9375, 6503962.5, 6532671.875, 6535754.6875, 6535798.4375, 6540193.75, 6540206.25, 6543932.8125, 6548207.8125, 6574818.75, 6592940.625, 6595159.375, 6618120.3125, 6618818.75, 6636110.9375, 6649989.0625, 6662557.8125, 6671384.375, 6675345.3125, 6675693.75, 6678309.375, 6682137.5, 6685729.6875, 6688237.5, 6697598.4375, 6699785.9375, 6700290.625, 6708854.6875, 6759795.3125, 6789487.5, 6819693.75, 6819871.875, 6820346.875, 6822345.3125, 6824073.4375, 6828104.6875, 6829032.8125, 6830812.5, 6831871.875, 6831879.6875, 6846090.625, 6854595.3125, 6874039.0625, 6874285.9375, 6875442.1875, 6876396.875, 6876453.125, 6880800.0, 6883087.5, 6883087.5, 6883090.625, 6884518.75, 6903334.375, 6912475.0, 6921434.375, 6928809.375, 6931853.125, 6933328.125, 6968901.5625, 6979415.625, 6985854.6875, 6991734.375, 6999659.375, 7017282.8125, 7017357.8125, 7019720.3125, 7027153.125, 7069204.6875, 7070554.6875, 7070932.8125, 7072831.25, 7074715.625, 7076942.1875, 7107660.9375, 7111607.8125, 7127453.125, 7143932.8125, 7147412.5, 7153400.0, 7156906.25, 7197481.25, 7202660.9375, 7205618.75, 7219554.6875, 7235167.1875, 7243121.875, 7245929.6875, 7246887.5, 7247509.375, 7248621.875, 7252601.5625, 7261642.1875, 7263448.4375, 7263807.8125, 7266307.8125, 7267860.9375, 7272078.125, 7274051.5625, 7292335.9375, 7292339.0625, 7294748.4375, 7326775.0, 7332781.25, 7333576.5625, 7334728.125, 7346076.5625, 7429070.3125, 7435621.875, 7437409.375, 7439900.0, 7441617.1875, 7442550.0, 7443739.0625, 7444204.6875, 7445223.4375, 7445234.375, 7445546.875, 7457279.6875, 7470979.6875, 7476740.625, 7488329.6875, 7493220.3125, 7494729.6875, 7495103.125, 7498042.1875, 7498231.25, 7498473.4375, 7504328.125, 7506909.375, 7507045.3125, 7507467.1875, 7524807.8125, 7533784.375, 7534759.375, 7535201.5625, 7536196.875, 7537164.0625, 7545676.5625, 7549262.5, 7551684.375, 7553984.375, 7554854.6875, 7557237.5, 7557732.8125, 7558039.0625, 7558664.0625, 7558910.9375, 7564082.8125, 7565204.6875, 7568240.625, 7580882.8125, 7580907.8125, 7581057.8125, 7591165.625, 7591464.0625, 7591926.5625, 7593543.75, 7594768.75, 7594845.3125, 7595510.9375, 7596942.1875, 7597665.625, 7598009.375, 7598626.5625, 7598690.625, 7599584.375, 7604117.1875, 7604304.6875, 7605023.4375, 7605767.1875, 7606606.25, 7606635.9375, 7607487.5, 7607554.6875, 7615828.125, 7616632.8125, 7616725.0, 7617206.25, 7617671.875, 7618531.25, 7624687.5, 7624964.0625, 7625057.8125, 7626087.5, 7628621.875, 7629587.5, 7629648.4375, 7632651.5625, 7633687.5, 7633885.9375, 7634245.3125, 7639203.125, 7639662.5, 7639685.9375, 7640151.5625, 7641714.0625, 7642845.3125, 7643232.8125, 7643748.4375, 7644489.0625, 7644739.0625, 7644942.1875, 7645885.9375, 7647620.3125, 7648367.1875, 7648417.1875, 7654084.375, 7657085.9375, 7665100.0, 7670917.1875, 7671278.125, 7671289.0625, 7676937.5, 7677473.4375, 7677768.75, 7677832.8125, 7681734.375, 7682717.1875, 7682837.5, 7685981.25, 7701057.8125, 7702171.875, 7705756.25, 7714235.9375, 7732807.8125, 7736170.3125, 7736506.25, 7742768.75, 7744229.6875, 7746053.125, 7746629.6875, 7748007.8125, 7748096.875, 7748453.125, 7749090.625, 7749904.6875, 7750909.375, 7759750.0, 7764579.6875, 7765901.5625, 7776676.5625, 7788829.6875, 7822196.875, 7881740.625, 7881764.0625, 7882896.875, 7936025.0, 7984193.75, 8006200.0, 8045176.5625, 8145351.5625, 8145407.8125, 8145735.9375, 8146023.4375, 8146496.875, 8151556.25, 8152760.9375, 8223973.4375, 8224584.375, 8227187.5, 8246671.875, 8247096.875, 8249906.25, 8271876.5625, 8273917.1875, 8305432.8125, 8308284.375, 8308415.625, 8309623.4375, 8309667.1875, 8309767.1875, 8315026.5625, 8315085.9375, 8316010.9375, 8318675.0, 8362768.75, 8363171.875, 8363753.125, 8367021.875, 8367409.375, 8368612.5, 8388445.3125, 8388625.0, 8389509.375, 8389584.375, 8390350.0, 8392196.875, 8413985.9375, 8417773.4375, 8418895.3125, 8418950.0, 8432876.5625, 8435734.375, 8436945.3125, 8438981.25, 8452975.0, 8468428.125, 8468440.625, 8494278.125, 8512312.5, 8518373.4375, 8518895.3125, 8520242.1875, 8520471.875, 8520750.0, 8520806.25, 8520931.25, 8522456.25, 8530384.375, 8555868.75, 8557051.5625, 8557075.0, 8558443.75, 8564120.3125, 8591182.8125, 8596387.5, 8596989.0625, 8597181.25, 8599428.125, 8599742.1875, 8599923.4375, 8600503.125, 8601029.6875, 8601092.1875, 8617042.1875, 8617478.125, 8617481.25, 8618496.875, 8618642.1875, 8619318.75, 8621273.4375, 8653617.1875, 8657764.0625, 8658732.8125, 8661471.875, 8689989.0625, 8692842.1875, 8696203.125, 8700734.375, 8713471.875, 8713493.75, 8713501.5625, 8713715.625, 8714410.9375, 8714654.6875, 8714796.875, 8717371.875, 8717834.375, 8718621.875, 8719215.625, 8719776.5625, 8719981.25, 8720242.1875, 8720396.875, 8720595.3125, 8720737.5, 8720956.25, 8720964.0625, 8721056.25, 8721107.8125, 8721431.25, 8721850.0, 8722400.0, 8722690.625, 8724184.375, 8724614.0625, 8725993.75, 8726001.5625, 8727760.9375, 8728892.1875, 8731070.3125, 8731942.1875, 8732196.875, 8732257.8125, 8732356.25, 8732507.8125, 8732742.1875, 8733379.6875, 8734014.0625, 8734310.9375, 8734723.4375, 8734982.8125, 8735154.6875, 8735173.4375, 8735335.9375, 8735479.6875, 8735817.1875, 8736256.25, 8736321.875, 8736348.4375, 8736693.75, 8736803.125, 8737360.9375, 8737475.0, 8737560.9375, 8737575.0, 8737660.9375, 8737743.75, 8737896.875, 8738057.8125, 8738118.75, 8738164.0625, 8738257.8125, 8738379.6875, 8738495.3125, 8738756.25, 8738825.0, 8738856.25, 8739031.25, 8740304.6875, 8740520.3125, 8740787.5, 8741028.125, 8741195.3125, 8741275.0, 8741493.75, 8741965.625, 8742026.5625, 8742303.125, 8742631.25, 8742862.5, 8742951.5625, 8743404.6875, 8744089.0625, 8756454.6875, 8756687.5, 8764475.0, 8770170.3125, 8776865.625, 8778262.5, 8779309.375, 8779475.0, 8779689.0625, 8779704.6875, 8779732.8125, 8779970.3125, 8789154.6875, 8800957.8125, 8801029.6875, 8801151.5625, 8805629.6875, 8840106.25, 8840456.25, 8851953.125, 8853264.0625, 8858865.625, 8859253.125, 8863767.1875, 8866765.625, 8868876.5625, 8872748.4375, 8952567.1875, 8952579.6875, 9045673.4375, 9320275.0, 9331740.625, 9334976.5625, 9382781.25, 271843206.25], [41.67178873297116, 5.578634164171258, 14.527171980981278, 92.71928777235759, 9.943565057371199, 36.08486251050869, 13.221944074687602, 69.41645310810846, 27.69444754996908, 73.02106767267703, 57.960142658057386, 13.014364806437177, 8.933485182324157, 10.897374456283067, 84.02865180245084, 112.9943431032024, 23.209709127437026, 12.46527407456302, 11.948455055185722, 32.7920881265001, 14.041936658446854, 41.53471289339199, 41.38030218290467, 90.00661007257087, 13.068115453201626, 10.632407195900509, 17.780300807806174, 82.04592951126207, 17.506274870174575, 8.658141828528665, 56.26282802781747, 25.616048587634474, 32.41780436878059, 233.2684992205805, 49.60656401363786, 27.06134919580792, 8.088057441082443, 44.353889201370464, 11.56781513294806, 49.68119096913122, 18.701334793117574, 11.35066189508997, 78.44248016439778, 6.302004025477443, 128.78587535749983, 37.006688160520305, 13.098098548688759, 79.82151367664332, 6.90160430729582, 57.63868398181887, 117.86245661284782, 58.52337918109647, 8.022217110731743, 53.49100452069713, 9.513471873601143, 29.821775990551338, 10.661494157234163, 37.109198538044176, 46.90013937247279, 101.16609547270522, 109.2355030756971, 6.924420708533361, 9.973597555857305, 8.145766729474204, 43.56455545505315, 8.32402119294648, 6.8713105414908515, 35.307802696409496, 101.65123769102277, 10.409744781190714, 28.64555328477701, 32.19049188794404, 53.75567327692757, 60.851284770422595, 40.04754270598194, 6.080612587319049, 7.874261535271877, 6.8419890474824925, 6.589599100127268, 19.77196782346693, 13.454462889413382, 53.349861719368576, 14.025001206923225, 40.46809587859134, 44.49082009030248, 12.548803580065574, 16.387230341030914, 48.948522944671566, 83.08240828428576, 10.550274329660587, 32.18358486569456, 95.29205373207834, 9.25215537385079, 29.619193565545636, 58.032135718006046, 82.8619623224343, 39.05142857135997, 15.147824937405243, 61.81519758828101, 194.04806942468161, 42.89518779516269, 35.944097832114856, 35.06072721779722, 86.08028151635855, 7.439513154878682, 13.27580732593714, 10.948450018665188, 59.58737666114197, 15.15380019181062, 9.774557528079113, 42.63967702672404, 12.205259511257232, 34.12014829325785, 57.00322683697621, 40.90324352035722, 33.25008264404635, 70.62406520287928, 42.19379569300597, 41.96374347646452, 11.341733237758907, 13.192374449218766, 30.250826634854775, 20.46186525425784, 84.2541893259285, 28.529989595911275, 86.11283417895315, 13.216834591017015, 19.856356214502014, 8.641456053944486, 25.946239927140603, 96.28146712883114, 8.406319727193129, 14.13931631707727, 27.430530648706025, 80.23888584828832, 29.879533248325526, 24.55152425662531, 205.20926819524882, 21.050387706765882, 56.47758741302982, 89.38913036861103, 10.195811916515671, 8.409969468438304, 26.683720395285313, 67.06488160922815, 72.77219589675096, 10.002998272128142, 56.06921158341417, 51.34616565814398, 52.926285546540086, 114.96493713747361, 37.56981328629935, 51.03465600426623, 17.309148181911752, 60.87728048009039, 16.736195279349438, 23.898593970663768, 12.025298152599758, 100.64460293711491, 60.46932707297623, 5.891540841243194, 38.588299985966835, 28.071293338284526, 17.527585106445283, 17.9081981160582, 32.181731182585466, 91.78334567281506, 92.29708403564521, 23.46155867799992, 22.04820577637732, 69.38576901863041, 34.367093771131444, 41.38807644874464, 36.86327356861686, 33.78895011136538, 6.5489616886872914, 137.30840248597357, 23.462782246145288, 40.77381961514763, 125.91971053771098, 34.60292475387246, 6.947342438945286, 28.784813518049603, 10.617126477751192, 8.766789707632125, 114.36481324289282, 340.672940655638, 42.96578471165742, 8.382172636704846, 38.19327345519459, 32.83423638820268, 21.02250443029666, 49.4438354997352, 46.94228398503433, 37.05968518697375, 65.64144159152502, 100.59113675217426, 17.699254981219468, 11.773878086795394, 84.1176700128994, 12.967142248504791, 57.21692526335513, 5.081997639867709, 177.44310742486937, 41.64710748998508, 9.319466360404947, 64.34755264408076, 29.407269876702877, 7.618772737279266, 12.682753147160676, 15.219779579178745, 5.132283996595804, 26.1550569271629, 43.757639763466095, 69.55694212325895, 6.678740706663369, 10.13288892332824, 64.23691024251312, 75.46411743837635, 6.48261265990011, 120.97958329322341, 16.205089248215298, 62.64008998527797, 36.215881559794816, 20.46662235741879, 169.5402755402704, 56.8681541317533, 13.69627693486664, 43.454607972334195, 91.10115093428433, 60.42235727900473, 20.964365202569684, 117.49495905917921, 58.55120695978522, 7.24797881311785, 9.674857874985516, 76.65356822550135, 25.47274184967929, 106.27528833955205, 33.19900987322498, 17.540219252291198, 26.1970987189968, 73.09845275673389, 10.902481219422834, 5.905962921892926, 54.704560244593154, 54.87487726844623, 18.591837974207447, 97.86303030151267, 20.291786812926713, 26.422870907038032, 14.233084694653439, 11.650820298304197, 67.52761244920605, 100.75290805061003, 127.05188872023447, 42.561179822128224, 27.04689079053583, 45.92313356954443, 49.62550085815417, 140.30581005346002, 21.519223233576433, 31.609751301136512, 36.96703145055269, 33.40716621061067, 5.558496972627978, 5.3428380068830466, 20.449871089162627, 20.189062465497717, 6.182986602546195, 31.151648037187744, 68.32766572392575, 54.368501890435965, 76.6697052619113, 41.86923531565741, 56.52416294405178, 17.83468151793812, 43.1342744466707, 59.18376268661839, 12.741394428016106, 5.228499446469903, 59.21361925533664, 6.9467905412409, 97.03336181343798, 46.647716589372116, 25.86102368293768, 58.18971812496032, 72.37578523313113, 70.23795468521033, 41.16219601764927, 22.393695445851783, 20.65527936419075, 11.403946278919419, 106.49575214276896, 15.843257456768184, 90.04771418632353, 8.077769225653508, 46.88587030634015, 6.383660956368158, 25.486708757198922, 46.22713168555553, 6.174385215143308, 13.27734147881969, 5.528908700389755, 17.54939218091406, 66.91137081604688, 7.132156315521342, 17.051580732744323, 32.282498899032916, 64.08295146631272, 30.751944526052075, 59.36985399745167, 28.42911724117826, 26.51216975387128, 21.74859893938685, 38.8674289567833, 26.906290510316264, 6.016739397606368, 27.735729771392258, 5.320834883010508, 11.388378225709289, 92.90130322952342, 16.10060928419711, 141.54857450739678, 96.18074231830602, 38.99324947046772, 79.99738658167935, 257.91355691379533, 36.32850773539004, 50.58369492351422, 45.652638788549496, 49.88628218131724, 124.1194531609494, 105.37731265625145, 16.864413216700004, 9.984867026109365, 65.88650254559872, 309.8974819888052, 28.96891938342963, 71.35850026365931, 22.65038521157153, 15.27400433296637, 51.99358758712998, 144.68457620754197, 61.14916732924348, 22.72603305895, 7.0955692772894645, 73.08266696701625, 11.705428480412463, 40.8631636501282, 29.900148504460994, 51.70550664992193, 124.34951737893681, 36.550136523179376, 72.38013829499657, 24.990264044061995, 91.60050668300889, 53.63509192559013, 58.63115692660871, 16.425835433610807, 64.95686848211781, 11.568971017455887, 13.366625400556893, 7.136111567576853, 13.903548887343463, 33.99459328652728, 45.458457395131354, 14.98955848235012, 56.675787117269515, 53.99269679240055, 8.440581653043646, 52.53796815078363, 37.512425263222234, 38.56721315874269, 44.83772420480217, 52.00118442254174, 36.513239744838515, 8.953723696357054, 34.96939989346399, 39.48071546634512, 22.004016172567542, 12.551797281105744, 39.58130550472742, 52.47534216610209, 53.327282586386175, 24.69167575014622, 14.629796409513197, 26.173845544400756, 10.89469325881429, 9.206762356134973, 9.083295388613589, 48.42434599292518, 5.22124257563242, 82.81576692027579, 42.89318852469586, 33.75141089592246, 95.10603203796944, 24.884253114019945, 132.4425800903468, 5.088706848412747, 72.25196325331308, 61.838405642093406, 32.73645084073963, 45.2007067329995, 7.798372872961571, 13.613484458735046, 46.924154574442184, 9.828931566883199, 56.18283986808998, 10.556941016983506, 26.439853522341927, 34.94967079422484, 12.296289453402789, 88.90337715472128, 11.940769052917432, 60.96409245027057, 70.39573890641694, 91.66743496656821, 7.4492343856548295, 182.8403958203387, 19.321066765768254, 6.496114093731783, 19.33199020722344, 35.06021899391598, 20.11160000901891, 5.318552387885878, 58.63684382933097, 82.63127795324667, 8.88151463512787, 17.555994986526574, 83.67302132806391, 9.532419809647742, 50.43002153082149, 82.89481131088823, 11.995172383002703, 68.63226284559707, 39.601998707833644, 69.46597327793512, 23.311049175523202, 22.97639715920836, 72.09737344602246, 25.756357801226905, 7.837935827374959, 13.085653596850904, 5.034588242010135, 10.719510107994, 6.350316809612064, 5.705682402392434, 21.263083685863393, 55.2119769197665, 5.191668554899057, 35.981045109133305, 23.137188027499334, 51.87207652705913, 12.205313884370787, 5.052273174345627, 5.471181914399071, 48.92904995979554, 128.73986977478432, 17.95897990316097, 7.808070017992536, 88.03736798436725, 26.99958545392189, 15.588450301809395, 26.367120929089435, 93.5929311705362, 22.99607125752202, 5.7767592322552686, 21.46557907728417, 88.75043419299207, 11.702671398863707, 99.5319089792854, 18.42535623947937, 10.154054195142587, 53.2099984368438, 72.0026660095297, 96.44337751623125, 9.267942944265153, 17.361363422588564, 35.48719516606059, 27.82006886043832, 25.31515916175496, 159.6750841565885, 6.406805964648084, 29.00121202326489, 14.192230459707645, 18.2809547179354, 167.49023432177464])
Detected energies during the discharge + Energy spectrum
multiplot(icon_fig, T_int_first,E,xle,Etot)