script for convert .t3pa files to .t3pa_cls
.t3pa file example:
Index $\quad$ Matrix $\quad$ Index $\quad$ ToA $\quad$ ToT $\quad$ FToA $\quad$ Overflow
0 $\quad$ 4574 $\quad$ 832 $\quad$ 29 $\quad$ 6 $\quad$ 0
1 $\quad$ 4831 $\quad$ 832 $\quad$ 35 $\quad$ 7 $\quad$ 0
2 $\quad$ 4575 $\quad$ 832 $\quad$ 100 $\quad$ 8 $\quad$ 0
3 $\quad$ 31031 $\quad$ 1745 $\quad$ 22 $\quad$ 11 $\quad$ 0
.
.
.
.t3pa_cls file example:
% Index $\quad$ Matrix Index $\quad$ [ RowNo, ClmNo ] $\quad$ ToA $\quad$ FToA $\quad$ ( ToA_in_ns ) $\quad$ ToT ( ToT_in_keV ) $\quad$ Overflow
# 1, $\quad$ Nunmasked = 3, $\quad$ Nmasked = 0, $\quad$ Ntot = 3 # Tfirst = 2.0787500000000000e+04 ns, $\quad$ Tlast = 2.0790625000000000e+04 ns, $\quad$ dT = 3.125000 ns, $\quad$ Etot = 64.428148 keV
2 $\quad$ 4575 $\quad$ [ 17, 223 ] $\quad$ 832 $\quad$ 8 $\quad$ ( 2.0787500000000000e+04 ns ) $\quad$ 100 $\quad$ ( 37.867914 keV ) $\quad$ 0
1 $\quad$ 4831 $\quad$ [ 18, 223 ] $\quad$ 832 $\quad$ 7 $\quad$ ( 2.0789062500000000e+04 ns ) $\quad$ 35 $\quad$ ( 14.733453 keV ) $\quad$ 0
0 $\quad$ 4574 $\quad$ [ 17, 222 ] $\quad$ 832 $\quad$ 6 $\quad$ ( 2.0790625000000000e+04 ns ) $\quad$ 29 $\quad$ ( 11.826781 keV ) $\quad$ 0
# 2, $\quad$ Nunmasked = 3, $\quad$ Nmasked = 0, $\quad$ Ntot = 3 # Tfirst = 4.3601562500000000e+04 ns, $\quad$ Tlast = 4.3607812500000000e+04 ns, $\quad$ dT = 6.250000 ns, $\quad$ Etot = 63.577435 keV
5 $\quad$ 30775 $\quad$ [ 120, 55 ] $\quad$ 1745 $\quad$ 15 $\quad$ ( 4.3601562500000000e+04 ns ) $\quad$ 99 $\quad$ ( 37.617059 keV ) $\quad$ 0
4 $\quad$ 30776 $\quad$ [ 120, 56 ] $\quad$ 1745 $\quad$ 13 $\quad$ ( 4.3604687500000000e+04 ns ) $\quad$ 44 $\quad$ ( 14.715446 keV ) $\quad$ 0
3 $\quad$ 31031 $\quad$ [ 121, 55 ] $\quad$ 1745 $\quad$ 11 $\quad$ ( 4.3607812500000000e+04 ns ) $\quad$2 2 $\quad$ ( 11.244929 keV ) $\quad$ 0
.
.
.
import numpy as np
import math
#import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.cm as cm
#from matplotlib.mlab import griddata
from urllib.error import HTTPError # recognise the error stemming from missing data
#import urllib
import urllib.request
t3pa2cls_XII - upravena fce energy(a, b, c, t, ToT, pocet_udalosti, RowNo, ClmNo) - nyni je se pocita i s pripadem "nan" t3pa2cls_XV_pc - zkousim vyzobat vysoke energie (jednotlive interakce) - funkce single_interaction. Dale delam prumernou velikost stopy stopy interakce pro danou energii - funkce size_of_interactions_average. Dale delam spektra 2 casti vyboje podle zadaneho casu - primarne pro double breakdown, tj. funkce energy_spectra_doublebreakdown
#Define an exception which will be raised if the data is missing and stop the notebook execution
class StopExecution(Exception):
def _render_traceback_(self):
pass
#shot_no = 44395 #test discharge for which the notebook will definitely work
shot_no = 45415
shot = shot_no
identifier='H03-W0051_shot_'+str(shot)+'_450V'
detector = 'H03-W0051'
ds = np.DataSource('/tmp') # temporary storage for downloaded files
scalars_URL = 'http://golem.fjfi.cvut.cz/shots/{shot_no}/Diagnostics/PlasmaDetection/Results/{name}'
def get_scalar(shot_no, name):
return float(ds.open(scalars_URL.format(shot_no=shot_no, name=name)).read())
t_plasma_start = get_scalar(shot_no, 't_plasma_start')
t_plasma_end = get_scalar(shot_no, 't_plasma_end')
is_plasma = get_scalar(shot_no, 'b_plasma')
def get_file(shot, identifier):
#Pick the discharge to analyse
URL = 'http://golem.fjfi.cvut.cz/shots/{shot}/Diagnostics/TimepixDetector/H03/{identifier}.t3pa'
url = URL.format(shot=shot, identifier=identifier)
try:
file_name_t3pa=url
with urllib.request.urlopen(file_name_t3pa) as ft3pa:
line = ft3pa.readline()
line = line.decode('utf‐8')
ft3pa.close
except HTTPError:
print('File not found at %s. Aborting notebook execution.' % url)
raise StopExecution
return file_name_t3pa
def get_file_calib(name_calib):
#Pick the discharge to analyse
URL = 'http://golem.fjfi.cvut.cz/shots/{shot}/Diagnostics/TimepixDetector/calib_matrix_H03/{name_calib}.txt'
url = URL.format(shot=shot, name_calib=name_calib)
#print(url)
try:
file_calib=url
with urllib.request.urlopen(file_calib) as calib:
line = calib.readline()
line = line.decode('utf‐8')
calib.close
except HTTPError:
print('File not found at %s. Aborting notebook execution.' % url)
raise StopExecution
return file_calib
def load_calib(file_calib):
with urllib.request.urlopen(file_calib) as fc:
calib=[] #vytvoreni 1D pole
for i in range(0,256): #tj. rozsah 0-255
temp = [] # docasne pole
for j in range(0,256):
temp.append(0) #naplneni docasneho pole 0
calib.append(temp) #naplneni pole a[] docasnym polem temp
for i in range(0,256): #nacteni calib matice do pole calib
line = fc.readline()
line = line.decode('utf‐8')
word=line.strip().split(' ')
for j in range(0,256):
#calib[i][j]=float(word[j]) #i = radek, j = sloupec0
calib[j][i]=float(word[j]) #j = radek, i = sloupec0 - pouze pro stavajici kalibraci - verze XV
fc.close
return calib
def load_t3pa_file(file_t3pa):
index=[]
matrix_index=[]
ToA=[]
ToT=[]
FToA=[]
overflow=[]
pocet_udalosti = 0
with urllib.request.urlopen(file_t3pa) as ft3pa:
line = ft3pa.readline()
line = line.decode('utf‐8')
while True:
line = ft3pa.readline()
line = line.decode('utf‐8')
word=line.strip().split('\t') #v t3pa souboru je oddelovac \t
if line == '':
break
index.append(word[0])
matrix_index.append(word[1])
ToA.append(float(word[2]))
ToT.append(float(word[3]))
FToA.append(float(word[4]))
overflow.append(float(word[5]))
pocet_udalosti = pocet_udalosti + 1
ft3pa.close
return index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti
def noise(index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti): #tuto fci nemus9m explicitn2 volat - volam ji v fci load_t3pa
pocet=int(0) #pocet sumicich pixelu
konst=int(len(index)/1000)+1
noise_matrix_index=[]
for i in range(0,konst):
pom = [] # pomocne pole
k=0 #pomocna promenna - udava, kolik je v czklu ve skutecnosti udalosti - aby nebyla chyba 'list index out of range'
for j in range(0,1001):
if i*1000+j>=len(index):
break
pom.append(matrix_index[i*1000+j])
k=k+1
for m in range(0,k):
count=int(0) #pocet vvyskytu stejneho matrix index behem 1000 udalosti
index_=int(-1) #budu testovat, jestli pixel na ktery koukam je sumici (abych ho nezapocital 2x)
for p in range(0,pocet):
#index=int(p)
if pom[m]==noise_matrix_index[p]:
index_=p #pixel na ktery jsem uz koukal a byl sumici
break
if index_ >=0 and pom[m]==noise_matrix_index[index_]:
continue
for l in range(0,k):
if pom[m]==pom[l]:
count=count+1
####podminka na sumici pixely
if count>=50: #kdyz se pixel vyskytne behem tisice udalosti vicekrat nez toto cislo, je sumici
noise_matrix_index.append(pom[m])
#noise_matrix_index[pocet]=pom[i]
pocet=pocet+1
pom.clear()
pocet_udalosti=len(index)
for n in range (0,pocet_udalosti):
for o in range(0,len(noise_matrix_index)):
if n >=pocet_udalosti:
break
if(matrix_index[n]==noise_matrix_index[o]):
del matrix_index[n]
del index[n]
del ToA[n]
del ToT[n]
del FToA[n]
del overflow[n]
pocet_udalosti=pocet_udalosti-1
continue
return pocet_udalosti,index, matrix_index, ToA, ToT, FToA, overflow
def t3pa_data(pocet_udalosti,index, matrix_index, ToA, ToT, FToA, overflow):
#rovnou vyhodim sumici pixely
pocet_udalosti,index, matrix_index, ToA, ToT, FToA, overflow=noise(index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti)
RowNo=[]
ClmNo=[]
for i in range(0,len(matrix_index)):
#RowNo.append(int(int(matrix_index[i]))//int(256))
#ClmNo.append(int(int(matrix_index[i]))%int(256))
ClmNo.append(int(int(matrix_index[i]))//int(256)) #ver XV - bude pro novou kalibraci - nyn9 to bere 3patnou kalibraci jednotlivych pixelu (cislovani radku a sloupcu stejne jako v pixetu)
RowNo.append(int(int(matrix_index[i]))%int(256)) ##ver XV - bude super pro novou kalibraci - odpovida radkum a sloupcum v pixetu. Nyni bere spatne kalibrace pixelu (viz fce load_calib)
return index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti, RowNo, ClmNo
def hit_map(detector,hit_map_fig,RowNo,ClmNo):
plt.hist2d(RowNo,ClmNo,bins=(256,256),cmap='Blues')
cb=plt.colorbar()
cb.set_label('Counts in pixel')
plt.xlabel('x [pixel]')
plt.ylabel('y [pixel]')
plt.title(detector)
plt.savefig(hit_map_fig, dpi = 1000)
return
def energy(a, b, c, t, ToT, pocet_udalosti, RowNo, ClmNo):
E=[] #energy in keV
#for i in range (0,pocet_udalosti):
pom=0
for i in range (0,len(ToT)):
Sqrt=float(0.0)
e1=float(0.0)
e2=float(0.0)
# promenna sqrt je vnitrek odmocniny
Sqrt = (((float(b[RowNo[i]][ClmNo[i]])+float(a[RowNo[i]][ClmNo[i]])*float(t[RowNo[i]][ClmNo[i]])-float(ToT[i])))*(((float(b[RowNo[i]][ClmNo[i]])+float(a[RowNo[i]][ClmNo[i]])*float(t[RowNo[i]][ClmNo[i]])-float(ToT[i])))) + (float(4)*float(a[RowNo[i]][ClmNo[i]])*float(c[RowNo[i]][ClmNo[i]]))) #zmena oproti verzi VI
if float(Sqrt)<float(0):
E.append(float(0))
else:
'''
V kalibracni matici a se obcas vyskytne 0 -> ve vypoctu energie
je tim padem deleni nulou -> energie diverguje. Jak to vyresit?
zatim polozim energii = 0 (kdyz a=0), pak se uvidi
nakonec udelam limitu vyrazu energie pro a->0 (L'hopital)
'''
if a[RowNo[i]][ClmNo[i]]==0:
e1=((float(t[RowNo[i]][ClmNo[i]]))/float(2)) + ((((float(b[RowNo[i]][ClmNo[i]])+float(a[RowNo[i]][ClmNo[i]])*float(t[RowNo[i]][ClmNo[i]])-float(ToT[i]))*(float(t[RowNo[i]][ClmNo[i]]))) - 2*(float(c[RowNo[i]][ClmNo[i]])))/(float(2)*np.sqrt(float(Sqrt))))
e2=((float(t[RowNo[i]][ClmNo[i]]))/float(2)) - ((((float(b[RowNo[i]][ClmNo[i]])+float(a[RowNo[i]][ClmNo[i]])*float(t[RowNo[i]][ClmNo[i]])-float(ToT[i]))*(float(t[RowNo[i]][ClmNo[i]]))) - 2*(float(c[RowNo[i]][ClmNo[i]])))/(float(2)*np.sqrt(float(Sqrt))))
else:
e1=((-(float(b[RowNo[i]][ClmNo[i]]) - (float(a[RowNo[i]][ClmNo[i]])*float(t[RowNo[i]][ClmNo[i]]))-float(ToT[i])))+np.sqrt(float(Sqrt)))/(float(2)*float(a[RowNo[i]][ClmNo[i]]))
e2=((-(float(b[RowNo[i]][ClmNo[i]]) - (float(a[RowNo[i]][ClmNo[i]])*float(t[RowNo[i]][ClmNo[i]]))-float(ToT[i])))-np.sqrt(float(Sqrt)))/(float(2)*float(a[RowNo[i]][ClmNo[i]]))
if a[RowNo[i]][ClmNo[i]]<0:
e1=-1
e2=-1
if math.isnan(e1):
e1=-1
if math.isnan(e2):
e2=-1
if e1<0 and e2<0:
E.append(float(0))
if e1>=0 and e1>e2:
E.append(float(e1))
if e2>=0 and e2>e1:
E.append(float(e2))
if e1>=0 and e2==e1:
E.append(float(e1))
return E
def Time(ToA, FToA, pocet_udalosti, RowNo, ClmNo):
T=[] #time in ns
for i in range (0,pocet_udalosti):
Time=float(0.0)
Time=(float(ToA[i])-((float(FToA[i])/float(16))))*float(25)
T.append(float(Time))
return T
def Timewalk_parameters_Si():
#SI - korekce na TimeWalk - parametry
A = -1.21988
B = 4.33638
C = 29.5075
D = 1
sigma_A=0.7013
sigma_B=0.1366
sigma_C=4.753
sigma_D=0
return A, B, C, D, sigma_A, sigma_B, sigma_C, sigma_D
def Timewalk(E,T):
i=0
A, B, C, D, sigma_A, sigma_B, sigma_C, sigma_D = Timewalk_parameters_Si()
while i < len(T):
timewalk=float(0)
timewalk = (C / (E[i] - B)) + A
if(timewalk<0):
timewalk=0
T[i]=T[i]-timewalk
i=i+1
return E,T
def remove_interactions_with_zero_energy(index, matrix_index, ToA, ToT, FToA, overflow, RowNo, ClmNo, E, T):
i=0
treshold=5.015347
while i < len(T):
if E[i]<treshold: #E[i] < energy treshold
index.pop(i)
matrix_index.pop(i)
ToA.pop(i)
ToT.pop(i)
FToA.pop(i)
overflow.pop(i)
RowNo.pop(i)
ClmNo.pop(i)
E.pop(i)
T.pop(i)
continue
i=i+1
return index, matrix_index, ToA, ToT, FToA, overflow, RowNo, ClmNo, E, T
def clustering_new(index, matrix_index, ToA, ToT, FToA, overflow, RowNo, ClmNo, E, T):
dT=float(50)
indexCl, TCl,ECl, matrix_indexCl, ToACl,ToTCl,FToACl,RowNoCl,ClmNoCl,overflowCl=[],[],[],[],[],[],[],[],[],[]
StartLastElem=len(T)-1
indexCl.append(int(index[StartLastElem]))
TCl.append(float(T[StartLastElem]))
ECl.append(float(E[StartLastElem]))
matrix_indexCl.append(int(matrix_index[StartLastElem]))
RowNoCl.append(int(RowNo[StartLastElem]))
ClmNoCl.append(int(ClmNo[StartLastElem]))
ToACl.append(float(ToA[StartLastElem]))
ToTCl.append(float(ToT[StartLastElem]))
FToACl.append(float(FToA[StartLastElem]))
overflowCl.append(float(overflow[StartLastElem]))
del index[StartLastElem]
del T[StartLastElem]
del E[StartLastElem]
del matrix_index[StartLastElem]
del RowNo[StartLastElem]
del ClmNo[StartLastElem]
del ToA[StartLastElem]
del ToT[StartLastElem]
del FToA[StartLastElem]
del overflow[StartLastElem]
j=1
pom=float(TCl[0]+dT)
while(j >0):
if(len(T) == 0):
break
k=0
j=0
while (k<=(len(TCl)-1)):
i=len(T)-1
if(len(T) == 0):
break
pocet_sousedu=0 #pocet sousednich pixelu - mohou byt maximalne 4
delka=0
# verze X
count=0 #pomocna promanna, kterou urcuji, ze se ma nasledujici cyklus while projit jeste jednou, pokud je i = -1
while(float(T[i])<=(pom)):
delka=delka+1
if(((((int(RowNoCl[k]))==(int(RowNo[i])+1))or((int(RowNoCl[k]))==(int(RowNo[i])-1))) and ((int(ClmNoCl[k]))==(int(ClmNo[i])))) or (((int(RowNoCl[k]))==(int(RowNo[i]))) and (((int(ClmNoCl[k]))==(int(ClmNo[i])+1))or((int(ClmNoCl[k]))==(int(ClmNo[i])-1))))):
#beru jen pixely, které mají společnou jednu stranu.
#pixely, kter0 spolu sousedí přes roh neuvažuji
indexCl.append(int(index[i]))
TCl.append(float(T[i]))
ECl.append(float(E[i]))
matrix_indexCl.append(int(matrix_index[i]))
RowNoCl.append(int(RowNo[i]))
ClmNoCl.append(int(ClmNo[i]))
ToACl.append(float(ToA[i]))
ToTCl.append(float(ToT[i]))
FToACl.append(float(FToA[i]))
overflowCl.append(float(overflow[i]))
# Removes i-th Row
del index[i]
del T[i]
del E[i]
del matrix_index[i]
del RowNo[i]
del ClmNo[i]
del ToA[i]
del ToT[i]
del FToA[i]
del overflow[i]
j=j+1
i=len(T)-1
pocet_sousedu=pocet_sousedu+1
if(len(T) == 0):
break
if(pocet_sousedu==4):
break
continue
i=i-1
if(i==-1): # verze X
count=count+1
if(i<0 and len(T)>0): # verze X
i=0
if(count>1):
break
if(i>=len(T)):
break
k=k+1
if(len(TCl)>2):
indexCl, TCl, ECl, matrix_indexCl, RowNoCl, ClmNoCl, ToACl, ToTCl, FToACl, overflowCl = insertionSort(indexCl, TCl, ECl, matrix_indexCl, RowNoCl, ClmNoCl, ToACl, ToTCl, FToACl, overflowCl)
return T, indexCl,TCl, ECl, matrix_indexCl, RowNoCl, ClmNoCl, ToACl, ToTCl, FToACl, overflowCl
def insertionSort(indexCl, TCl, ECl, matrix_indexCl, RowNoCl, ClmNoCl, ToACl, ToTCl, FToACl, overflowCl):
# Function to do insertion sort
# Traverse through 1 to len(arr)
for i in range(1, len(TCl)):
key = TCl[i]
# Move elements of arr[0..i-1], that are
# greater than key, to one position ahead
# of their current position
#ostatni
key1 = indexCl[i]
key2 = ECl[i]
key3 = matrix_indexCl[i]
key4 = RowNoCl[i]
key5 = ClmNoCl[i]
key6 = ToACl[i]
key7 = ToTCl[i]
key8 = FToACl[i]
key9 = overflowCl[i]
j = i-1
while j >= 0 and key < TCl[j] :
TCl[j + 1] = TCl[j]
#ostatni
indexCl[j + 1] = indexCl[j]
ECl[j + 1] = ECl[j]
matrix_indexCl[j + 1] = matrix_indexCl[j]
RowNoCl[j + 1] = RowNoCl[j]
ClmNoCl[j + 1] = ClmNoCl[j]
ToACl[j + 1] = ToACl[j]
ToTCl[j + 1] = ToTCl[j]
FToACl[j + 1] = FToACl[j]
overflowCl[j + 1] = overflowCl[j]
j -= 1
TCl[j + 1] = key
#ostatni
indexCl[j + 1] = key1
ECl[j + 1] = key2
matrix_indexCl[j + 1] = key3
RowNoCl[j + 1] =key4
ClmNoCl[j + 1] = key5
ToACl[j + 1] = key6
ToTCl[j + 1] = key7
FToACl[j + 1] = key8
overflowCl [j + 1] = key9
return indexCl, TCl, ECl, matrix_indexCl, RowNoCl, ClmNoCl, ToACl, ToTCl, FToACl, overflowCl
def file_t3pa_cls_new(file_t3pa_cls,T):
with open(file_t3pa_cls, "w", encoding="utf-8") as t3pa_cls:
t3pa_cls.write('%\n')
t3pa_cls.write('% Index Matrix Index [ RowNo, ClmNo ] ToA FToA ( ToA_in_ns ) ToT ( ToT_in_keV ) Overflow\n')
t3pa_cls.write('\n')
i=1
T_first=[]
E_tot=[]
N_tot=[]
eventNo=0 #for high_energy_event function
while(len(T) > 0):
T, indexCl,TCl, ECl, matrix_indexCl, RowNoCl, ClmNoCl, ToACl, ToTCl, FToACl, overflowCl = clustering_new(index, matrix_index, ToA, ToT, FToA, overflow, RowNo, ClmNo, E, T)
Tfirst=float(TCl[0])
Tlast=float(TCl[len(TCl)-1])
dT=Tlast-Tfirst
Etot=float(0)
for k in range(0,len(TCl)):
Etot=Etot+float(ECl[k])
T_first.append(float(Tfirst))
dT=Tlast-Tfirst
E_tot.append(float(Etot))
N_tot.append(len(TCl)) #new in ver. XV
t3pa_cls.write('# '+str(i)+', Nunmasked = '+str(len(TCl))+', Nmasked = 0, Ntot = '+str(len(TCl))+'\n')
t3pa_cls.write('# Tfirst = '+str(Tfirst)+' ns, Tlast = '+str(Tlast)+' ns, dT = '+str(dT)+' ns, Etot = '+str(Etot)+' keV\n')
for j in range(0,len(TCl)):
t3pa_cls.write(str(indexCl[j])+' '+str(matrix_indexCl[j])+' [ '+str(RowNoCl[j])+', '+str(ClmNoCl[j])+' ] '+str(ToACl[j])+' '+str(FToACl[j])+' ( '+str(TCl[j])+' ns ) '+str(ToTCl[j])+' ( '+str(ECl[j])+' keV ) '+str(overflowCl[j])+'\n')
t3pa_cls.write('\n')
#eventNo=single_interaction(eventNo,Etot, Tfirst, ECl, TCl, RowNoCl, ClmNoCl,path)
i=i+1
t3pa_cls.close
return T_first, E_tot, N_tot
def energy_spectrum_in_time(Tfirst, Etot): #dela histogram - energie zaznamenana v case
pom = 0
dt=100 #(ns) time width of 1 bin
T_first=0 #cas, kdy prisel trigger a yacalo mereni
T_last=(max(Tfirst)) #posledni z Tfirst
Delta_T = T_last - T_first
poc = int(int(Delta_T) / float(dt)) + 1 #pocet casovych oken
T_int_first=[] #cas
E=[] #energie
for i in range(0,poc):
T_int_first.append((i*dt) + dt/2)
E.append(0)
#XII
for j in range(0,len(Tfirst)):
time_index=0
time_index=int(((Tfirst[j]-T_first)/dt))
if float(Tfirst[j]-T_first) >= (T_int_first[time_index] - dt / 2) and float(Tfirst[j]-T_first) < (T_int_first[time_index] + dt / 2):
E[time_index]=float(E[time_index])+float(Etot[j])
pom=pom+1
for l in range(0,len(T_int_first)):
T_int_first[l]=T_int_first[l]+T_first
caption, T_int_first = energy_in_time_hist(T_int_first, E, figure_E_in_time_hist, t_plasma_start, t_plasma_end, is_plasma, dt)
return dt, caption, T_int_first, E
def energy_in_time_hist(T_int_first, E,figure_E_in_time_hist, t_plasma_start, t_plasma_end, is_plasma, dt):
plt.rcParams.update({'font.size': 20})
fig, ax = plt.subplots(figsize =(10, 7))
for k in range(0,len(T_int_first)):
T_int_first[k] = T_int_first[k] / 1000000
plt.plot(T_int_first, E, drawstyle='steps-mid')
plt.title(detector+', #'+str(shot_no))
plt.xlabel('Time [ms]')
plt.ylabel('Energy [keV]')
if is_plasma == 1:
for t in (t_plasma_start, t_plasma_end):
plt.axvline(t, color='k', linestyle='--')
plt.xlim([0, (t_plasma_start + t_plasma_end)])
else:
plt.xlim(0,)
plt.ylim(0,) #10 000 keV
plt.savefig(figure_E_in_time_hist, dpi = 1000)
caption = '# x = time in ms, count = energy in keV, dT= '+str(dt)+' ns'
return caption, T_int_first
def hits_in_time_hist_new(T, dt, t_plasma_start, t_plasma_end, is_plasma,figure_count_in_time_hist):
pom = 0
T_first=0 #cas, kdy prisel trigger a yacalo mereni
T_last=(max(T)) #posledni z Tfirst
Delta_T = T_last - T_first
poc = int(int(Delta_T) / float(dt)) + 1 #pocet casovych oken
T_hit=[] #cas
count=[] #energie
for i in range(0,poc):
T_hit.append((i*dt) + dt/2)
count.append(0)
for j in range(0,len(T)):
time_index=0
time_index=int(((T[j]-T_first)/dt))
k=time_index
for j in range(0,len(T)):
time_index=0
time_index=int(((T[j]-T_first)/dt))
if float(T[j]-T_first) >= (T_hit[time_index] - dt / 2) and float(T[j]-T_first) < (T_hit[time_index] + dt / 2):
count[time_index] = count[time_index] + 1
pom=pom+1
for l in range(0,len(T_hit)):
T_hit[l]=T_hit[l]+T_first
plt.rcParams.update({'font.size': 20})
fig, ax = plt.subplots(figsize =(10, 7))
for k in range(0,len(T_hit)):
T_hit[k] = T_hit[k] / 1000000
#plt.plot(T_hit, count)
plt.plot(T_hit, count, drawstyle='steps-mid')
plt.title(detector+', #'+str(shot_no))
plt.xlabel('Time [ms]')
plt.ylabel('Count')
if is_plasma == 1:
for t in (t_plasma_start, t_plasma_end):
plt.axvline(t, color='k', linestyle='--')
plt.xlim([0, (t_plasma_start + t_plasma_end)])
else:
plt.xlim(0,)
plt.ylim(0,) #10 000 keV
plt.savefig(figure_count_in_time_hist, dpi = 1000)
caption = '# x = time in ms, dT= '+str(dt)+' ns'
return caption, T_hit,count
def energy_spectrum(Etot):
E_min=0
dE=5 #keV
E_max=max(Etot)
pocet=(E_max//dE) + 3
pocet=int(pocet)
E_max=float(dE*pocet)
xle=[]
xre=[]
xmean=[]
for p in range (0,pocet):
xle.append(E_min + (p * (E_max - E_min)) / pocet)
xre.append(xle[p]+dE)
xmean.append((xle[p] + xre[p]) / 2)
count=[]
for l in range(0,pocet):
count.append(0)
#XII
for i in range(0,len(Etot)):
E_index=int(((Etot[i]-E_min)/dE))
if ((xle[E_index] <= Etot[i]) and (Etot[i] < xre[E_index])):
count[E_index]=count[E_index]+1
plt.rcParams.update({'font.size': 20})
fig, ax = plt.subplots(figsize =(10, 7))
#ax.hist(Etot, bins = xle)
plt.fill_between(xmean, count,step='mid') #pre mid post
plt.plot(xmean, count, drawstyle='steps-mid')
plt.title(detector+', #'+str(shot_no))
plt.xlabel('Energy [keV]')
plt.ylabel('Count')
plt.xlim(0,)
ax.set_yscale('log') #log scale y
caption = '# x = energy in keV, dE= '+str(dE)+' keV'
plt.savefig(figure_E_hist, dpi = 1000)
return caption, xmean,count, xle, Etot
def hist_file(file_hist, xmean, count, caption ):
with open(file_hist, "w", encoding="utf-8") as hist:
hist.write('#\n')
hist.write('#'+str(caption)+'\n')
hist.write('# x_mean count\n')
hist.write('\n')
for m in range(0,len(xmean)):
hist.write(str(xmean[m])+' '+str(count[m])+'\n')
hist.close
return T_first, E_tot
def multiplot(icon_fig, x1,y1,x2,y2):
plt.rcParams.update({'font.size': 20})
fig, ax = plt.subplots(nrows=2,figsize =(10, 7))
ax[0].plot(x1, y1, drawstyle='steps-mid')
ax[0].set_xlabel('Time [ms]')
ax[0].set_ylabel('Energy [keV]')
if is_plasma == 1:
for t in (t_plasma_start, t_plasma_end):
ax[0].axvline(t, color='k', linestyle='--')
ax[0].set_xlim([0, (t_plasma_start + t_plasma_end)])
else:
ax[0].set_xlim(0,)
ax[0].set_ylim(0,) #keV
#ax[1].hist(y2, bins = x2)
ax[1].fill_between(x2, y2,step='mid') #pre mid post
ax[1].plot(x2, y2, drawstyle='steps-mid')
ax[1].set_xlabel('Energy [keV]')
ax[1].set_ylabel('Count')
ax[1].set_xlim(0,)
#ax[1].set_ylim(0,)
ax[1].set_yscale('log') #log scale y
fig.subplots_adjust(hspace=0.3)
plt.savefig(icon_fig, dpi = 1000)
return
def single_interaction(eventNo,Etot, Tfirst, ECl, TCl, RowNoCl, ClmNoCl,path): # ver XV
#tuto funkci volam ve funkci file_t3pa_cls_new(file_t3pa_cls,T):
#This function is calling in function file_t3pa_cls_new(file_t3pa_cls,T)
high_E = 1500 #[keV] - zadani, jaka energie je pro me vysoka
if(Etot>=high_E or len(ECl)>15):
#if (len(ECl)>15): #len(ECl) = pocet pixelu dane interakce
print("Total energy of track: "+str(Etot)+" keV\n")
A, B, C, D, sigma_A, sigma_B, sigma_C, sigma_D = Timewalk_parameters_Si()
######################
#SI - rekonstrukce z(t) - parametry
a=0.0193947
b=-0.0273934
sigma_a=0.0004163
sigma_b=0.009832
#######################
time=[]
sigma_time=[]
time_min = []
time_max=[]
z_rec=[]
z_rec_min=[]
z_rec_max=[]
sigma_z_rec=[]
for i in range(0, len(TCl)):
time.append(TCl[i] - Tfirst)
#chyba urceni casu = chyba timewalk ->
sigma_time.append(np.sqrt(((sigma_C / (pow((ECl[i] - B), D)))*(sigma_C / (pow((ECl[i] - B), D)))) + (((sigma_B*C*D) / (pow((ECl[i] - B), (D + 1))))*((sigma_B*C*D) / (pow((ECl[i] - B), (D + 1))))) + (((sigma_D*C*math.log(ECl[i] - B)) / (pow((ECl[i] - B), D)))* ((sigma_D*C*math.log(ECl[i] - B)) / (pow((ECl[i] - B), D)))) + (sigma_A*sigma_A)))
time_min.append(time[i] - sigma_time[i])
time_max.append(time[i] + sigma_time[i])
#//
#//rekonstrukce hloubky interakce
z_rec.append(a * time[i] + (b))
sigma_z_rec.append(np.sqrt(((time[i]*time[i])*(sigma_a*sigma_a)) + (sigma_b*sigma_b) + (a*a)*(sigma_time[i]*sigma_time[i])))
z_rec_min.append(z_rec[i] - sigma_z_rec[i])
z_rec_max.append(z_rec[i] + sigma_z_rec[i])
#//
single_interaction_file=str(path)+'event'+str(eventNo)+'.txt'
single_interaction_2D_fig=str(path)+'2D_event'+str(eventNo)+'.png'
single_interaction_3D_fig=str(path)+'3D_event'+str(eventNo)+'.png'
with open(single_interaction_file, "w", encoding="utf-8") as f:
f.write('#\n')
f.write('# x_mean y_mean z_rec z_rec_min z_rec_max sigma_z_rec\n')
f.write('#E_tot='+str(Etot)+'\n')
f.write('\n')
for m in range(0,len(TCl)):
#print(str(RowNoCl[m])+' '+str(ClmNoCl[m])+' '+str(z_rec[m])+' '+str(z_rec_min[m])+' '+str(z_rec_max[m])+' '+str(sigma_z_rec[m])+' '+str(ECl[m])+'\n')
f.write(str(RowNoCl[m])+' '+str(ClmNoCl[m])+' '+str(z_rec[m])+' '+str(z_rec_min[m])+' '+str(z_rec_max[m])+' '+str(sigma_z_rec[m])+' '+str(ECl[m])+'\n')
f.close
############################### plot
#binwidth=1
if ((max(RowNoCl)-min(RowNoCl))>=(max(ClmNoCl)-min(ClmNoCl))):
rang=max(RowNoCl)-min(RowNoCl)
#bins=(range((min(RowNoCl)-1), (max(RowNoCl)+3), binwidth), range((min(ClmNoCl)-1), (min(ClmNoCl)+rang+3), binwidth))
x_min=min(RowNoCl)-1
x_max=max(RowNoCl)+2
y_min=min(ClmNoCl)-1
y_max=min(ClmNoCl)+rang+2
else:
rang = max(ClmNoCl)-min(ClmNoCl)
#bins=(range((min(RowNoCl)-1), (min(RowNoCl)+rang+3), binwidth), range((min(ClmNoCl)-1), (max(ClmNoCl)+3), binwidth))
x_min=min(RowNoCl)-1
x_max=min(RowNoCl)+rang+2
y_min=min(ClmNoCl)-1
y_max=max(ClmNoCl)+2
###############$$$$$$$$$$$$$$$$$$$$
rows, cols = (x_max-x_min, x_max-x_min)
#arrECl = [[0]*cols]*rows
arrECl= [[0] * cols for _ in range(rows)]
for i in range (x_min,x_max):
for j in range (y_min,y_max):
for k in range(0,len(RowNoCl)):
if ((i==RowNoCl[k]) and (j==ClmNoCl[k])):
#print(str(i)+" "+str(j)+" "+str(RowNoCl[k])+" "+str(ClmNoCl[k])+"\n")
arrECl[i-x_min][j-y_min]=ECl[k]
arrECl=np.transpose(arrECl)
arrECl[arrECl == 0] = np.nan
#2D plot
plt.imshow(arrECl,cmap='jet', interpolation='none', origin=[(x_min-0.2),(y_min-0.2)], aspect='equal', extent=[x_min-0.2,x_max,y_min-0.2,y_max])
###############$$$$$$$$$$$$$$$$$$$$
cb=plt.colorbar(pad=0.005)
plt.tick_params(axis="x",direction="in")
plt.tick_params(axis="y",direction="in")
cb.ax.tick_params(axis='y', direction='in')
cb.set_label('Energy in pixel [keV]')
plt.xlabel('x [pixel]')
plt.ylabel('y [pixel]')
plt.title('$E_{tot}$ = '+str(round(Etot, 2))+' keV, $N_{tot}$ = '+str(len(ECl)))
plt.savefig(single_interaction_2D_fig, dpi = 1000)
plt.show()
plt.close()
############################### plot
############## 3D plot
# Creating figure
fig = plt.figure(figsize = (16, 9))
ax = plt.axes(projection ="3d")
# Add x, y gridlines
ax.grid(b = True, color ='grey', #
linestyle ='-.', linewidth = 0.3,
alpha = 0.2)
# Creating plot
sctt = ax.scatter3D(RowNoCl, ClmNoCl, z_rec,
alpha = 0.8,
c = ECl,
cmap = 'jet',
s = 4000, #size of bubbles in plot
marker ='o')
plt.title('$E_{tot}$ = '+str(round(Etot, 2))+' keV, $N_{tot}$ = '+str(len(ECl)))
ax.set_xlabel('x [pixel]', fontweight ='bold')
ax.set_ylabel('y [pixel]', fontweight ='bold')
ax.set_zlabel('z [mm]', fontweight ='bold')
cb=fig.colorbar(sctt, ax = ax, shrink = 0.5,aspect = 10,pad=0.00005) #
cb.ax.tick_params(axis='y', direction='in')
cb.set_label('Energy in pixel [keV]', fontweight ='bold')
plt.savefig(single_interaction_3D_fig, dpi = 1000)
# show plot
plt.show()
plt.close()
############## 3D plot
eventNo=eventNo+1
return eventNo
def size_of_interactions_average(Etot, Ntot,file_hist): #ver XV
E_min=0
dE=5 #keV
E_max=max(Etot)
pocet=(E_max//dE) + 3
pocet=int(pocet)
E_max=float(dE*pocet)
xle=[]
xre=[]
xmean=[]
count=[]
nop=[] #number of pixels
nop_mean=[] #mean number of pixels in dE
sigma=[] #root mean square error of the mean - stredni kvadraticka chyba prumeru
for p in range (0,pocet):
xle.append(E_min + (p * (E_max - E_min)) / pocet)
xre.append(xle[p]+dE)
xmean.append((xle[p] + xre[p]) / 2)
count.append(0)
nop.append(0)
nop_mean.append(0)
sigma.append(0)
#XII
for i in range(0,len(Etot)):
E_index=int(((Etot[i]-E_min)/dE))
if ((xle[E_index] <= Etot[i]) and (Etot[i] < xre[E_index])):
count[E_index]=count[E_index]+1
nop[E_index]=nop[E_index]+Ntot[i] #ver XV
for l in range(0,pocet):
if nop[l]!=0:
nop_mean[l]=float(nop[l])/float(count[l])
#####Computing sigma
for i in range(0,len(Etot)):
E_index=int(((Etot[i]-E_min)/dE))
if ((xle[E_index] <= Etot[i]) and (Etot[i] < xre[E_index])):
if nop_mean[E_index]!=0:
sigma[E_index]=sigma[E_index]+((float(Ntot[i])-float(nop_mean[E_index]))*(float(Ntot[i])-float(nop_mean[E_index])))
for l in range(0,pocet):
if nop[l]!=0 and count[l]>1:
sigma[l]=np.sqrt(sigma[l]/(float(count[l])*(float(count[l])-1)))
if nop[l]!=0 and count[l]==1:
sigma[l]=10
#####Computing sigma
#####write to file
with open(file_hist, "w", encoding="utf-8") as hist:
hist.write('# x_mean [keV] mean_size_of_interaction [pixel] sigma_mean_size_of_interaction\n')
for m in range(0,len(xmean)):
hist.write(str(xmean[m])+' '+str(nop_mean[m])+' '+str(sigma[m])+'\n')
hist.close
#####write to file
plt.rcParams.update({'font.size': 20})
fig, ax = plt.subplots(figsize =(10, 7))
#plt.fill_between(xmean, nop,step='mid',color='blue', alpha=0.3) #pre mid post
#plt.fill_between(xmean, nop,step='mid') #pre mid post
plt.plot(xmean, nop_mean, drawstyle='steps-mid')
plt.errorbar(xmean, nop_mean, yerr = sigma,fmt ='.', linewidth=0.7)
plt.title(detector+', #'+str(shot_no))
plt.xlabel('Energy [keV]')
plt.ylabel('Average size of interaction [pixel]')
plt.xlim(0,500)
plt.ylim(0,17)
#ax.set_yscale('log') #log scale y
caption = '# x = energy in keV, dE= '+str(dE)+' keV'
plt.savefig(figure_size_interaction, dpi = 1000)
return
def energy_spectra_doublebreakdown(Etot, Tfirst, file_hist):
#this function separates discharge into two parts acording to time Tsep and creates energy spectrum for each part.
#This is for discharges with double brakdown
Tsep=14636000 # [ns]
E_min=0
dE=5 #keV
E_max=max(Etot)
pocet=(E_max//dE) + 3
pocet=int(pocet)
E_max=float(dE*pocet)
xle=[]
xre=[]
xmean=[]
for p in range (0,pocet):
xle.append(E_min + (p * (E_max - E_min)) / pocet)
xre.append(xle[p]+dE)
xmean.append((xle[p] + xre[p]) / 2)
count_first=[]
count_second=[]
for l in range(0,pocet):
count_first.append(0)
count_second.append(0)
#XII
for i in range(0,len(Etot)):
E_index=int(((Etot[i]-E_min)/dE))
if ((xle[E_index] <= Etot[i]) and (Etot[i] < xre[E_index])):
if(Tfirst[i]<Tsep):
count_first[E_index]=count_first[E_index]+1
else:
count_second[E_index]=count_second[E_index]+1
caption = '# x = energy in keV, dE= '+str(dE)+' keV'
with open(file_hist, "w", encoding="utf-8") as hist:
hist.write('#\n')
hist.write('#'+str(caption)+'\n')
hist.write('# x_mean count_before_2nd_breakdown count_2nd_breakdown\n')
hist.write('\n')
for m in range(0,len(xmean)):
hist.write(str(xmean[m])+' '+str(count_first[m])+' '+str(count_second[m])+'\n')
hist.close
plt.rcParams.update({'font.size': 20})
fig, ax = plt.subplots(figsize =(10, 7))
#plt.fill_between(xmean, count_first,step='mid') #pre mid post
plt.plot(xmean, count_first, label='Before 2nd breakdown', drawstyle='steps-mid')
plt.plot(xmean, count_second, label='2nd breakdown', drawstyle='steps-mid')
plt.legend(loc='best')
plt.title(detector+', #'+str(shot_no))
plt.xlabel('Energy [keV]')
plt.ylabel('Count')
plt.xlim(0,500)
ax.set_yscale('log') #log scale y
plt.savefig(figure_energy_spectra_doublebreakdown, dpi = 1000)
return
#soubory, ktere ctu
#read files
t3pa=get_file(shot, identifier)
name_calib='caliba'
caliba=get_file_calib(name_calib)
name_calib='calibb'
calibb=get_file_calib(name_calib)
name_calib='calibc'
calibc=get_file_calib(name_calib)
name_calib='calibt'
calibt=get_file_calib(name_calib)
#vytvorene soubory:
#created files
t3pa_cls= 'H03-W0051_shot_'+str(shot)+'_450V.t3pa_cls'
E_hist= 'H03-W0051_shot_'+str(shot)+'_450V_E_hist.txt'
E_in_time_hist= 'H03-W0051_shot_'+str(shot)+'_450V_discharge_energy.txt'
count_in_time_hist= 'H03-W0051_shot_'+str(shot)+'_450V_discharge_hits.txt'
size_interaction= 'H03-W0051_shot_'+str(shot)+'size_interaction.txt'
file_energy_spectra_doublebreakdown= 'H03-W0051_shot_'+str(shot)+'energy_spectra_doublebreakdown.txt'
#created figures
icon_fig='icon-fig'
figure_E_in_time_hist='discharge_energy'
figure_count_in_time_hist='discharge_hits'
figure_E_hist='Energy_spectrum'
hit_map_fig='hit-map'
figure_size_interaction= 'H03-W0051_shot_'+str(shot)+'size_interaction'
figure_energy_spectra_doublebreakdown= 'H03-W0051_shot_'+str(shot)+'energy_spectra_doublebreakdown'
#nactu jednotlive kalibracni matice - abych to nemusel delat v kazde funkci
a=load_calib(caliba)
b=load_calib(calibb)
c=load_calib(calibc)
t=load_calib(calibt)
#nactu a urcim jednotlive hodnoty - abych to nemusel delat v kazde funkci
index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti = load_t3pa_file(t3pa)
index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti, RowNo, ClmNo = t3pa_data(pocet_udalosti,index, matrix_index, ToA, ToT, FToA, overflow)
raw data
#hit map
hit_map(detector,hit_map_fig,RowNo,ClmNo)
Energy and time calculation from raw data.
E=energy(a, b, c, t, ToT, pocet_udalosti, RowNo, ClmNo)
T=Time(ToA, FToA, pocet_udalosti, RowNo, ClmNo)
index, matrix_index, ToA, ToT, FToA, overflow, RowNo, ClmNo, E, T = remove_interactions_with_zero_energy(index, matrix_index, ToA, ToT, FToA, overflow, RowNo, ClmNo, E, T)
E,T=Timewalk(E,T)
#sort by time
T, index, matrix_index, ToA, ToT, FToA, overflow, RowNo, ClmNo, E = (list(t) for t in zip(*sorted(zip(T, index, matrix_index, ToA, ToT, FToA, overflow, RowNo, ClmNo, E), reverse=True))) #serazeni od nejvetsiho po nejmensi
T_pom=T.copy()
#save to file
T_first, E_tot, Ntot = file_t3pa_cls_new(t3pa_cls,T)
dt, caption, T_int_first, E = energy_spectrum_in_time(T_first, E_tot)
hist_file(E_in_time_hist, T_int_first, E, caption);
([4776952.875113257, 4895203.125, 4902313.439207066, 4918370.3463986525, 4928813.835781327, 5009754.570903925, 5009798.4375, 5058937.5, 5068546.336752432, 5107922.29156841, 5138338.83618591, 5141103.7201111335, 5142093.630132496, 5183168.451774551, 5191608.104353262, 5191773.402720386, 5191780.987260822, 5222631.25, 5224622.717775685, 5259585.7094326615, 5261620.774390866, 5279324.746230076, 5290349.4303725185, 5319530.610844067, 5338303.125, 5411706.211131014, 5529841.0580792995, 5557703.125, 5585183.07673634, 5597354.6875, 5603005.175293214, 5604051.5625, 5624089.0625, 5627004.171146625, 5645097.338907017, 5646314.224994885, 5654024.285793076, 5685637.4392698705, 5689175.0, 5713803.456175911, 5748245.3125, 5775703.125, 5804322.767609308, 5811193.074990998, 5832433.18048197, 5856999.096193644, 5876521.042827411, 5893271.089022694, 5895060.022001899, 5904632.8125, 5905733.3730037715, 5906556.25, 5923592.173453831, 5930281.25, 5932549.049745613, 5932579.6875, 5934223.933893293, 5962064.010745159, 5986931.898592596, 5987918.533382542, 5996951.5625, 5997551.5625, 6026834.375, 6028142.018527294, 6053053.890386566, 6060033.750419544, 6071168.75, 6083846.564609845, 6086118.75, 6100814.627748987, 6105106.145812002, 6109384.369067941, 6111695.112578524, 6112315.315222761, 6117145.820644028, 6117323.4375, 6134307.8125, 6146531.115213923, 6147493.75, 6160580.374714226, 6181267.18791476, 6182954.937814165, 6184174.410926499, 6185837.719814252, 6186055.826090367, 6194517.1875, 6199032.38695352, 6218148.4375, 6226693.414349949, 6230601.5625, 6234075.595047699, 6234305.523535072, 6241490.376591154, 6246457.3141573705, 6256090.355368591, 6264056.25, 6278761.779692584, 6280464.0625, 6290441.993610382, 6291776.453218724, 6298510.9375, 6298643.520152501, 6299395.156757125, 6319020.3125, 6322850.014501781, 6340230.522045199, 6350993.75, 6358636.0349780945, 6361818.613285567, 6363172.5412307065, 6363176.5625, 6435826.371085886, 6439009.226957196, 6439272.583262475, 6442605.363564005, 6452225.358742549, 6465578.125, 6479993.162412182, 6485148.177431223, 6485150.0, 6517801.855290965, 6528781.25, 6534385.926735207, 6537668.75, 6567404.6875, 6596648.4375, 6602970.536273112, 6616518.575892542, 6621423.4375, 6625696.506652342, 6633987.5, 6671489.996526208, 6697763.156991092, 6719314.588811892, 6720092.157325456, 6720214.699675804, 6724028.11746702, 6740256.122289702, 6772806.0989182, 6784762.5, 6788409.103372233, 6791924.705582991, 6793990.642450514, 6794047.697309677, 6802998.4375, 6821747.607447544, 6850031.939200299, 6859010.169319047, 6866578.304599038, 6917019.638545338, 6998252.838579258, 7078173.977847958, 8044317.668746939, 8730019.452616522, 8852364.0625, 8899064.0625, 8900459.360950643, 8928197.005626613, 8929851.562721126, 8947012.400331037, 8955000.411422217, 8959940.625, 8961613.14463107, 8970903.06443122, 8970909.222436126, 8971477.778393647, 8972808.608360803, 8973148.003856486, 8973162.201923512, 8973828.918085424, 8975073.101046117, 8976453.024259806, 8978910.9375, 8985251.745752411, 8985799.240774946, 8985869.60202736, 8988701.777978182, 8988892.1875, 8993500.509132441, 8995136.631586436, 8997954.6875, 8999444.806311565, 8999811.13972541, 9001199.794495646, 9001200.370972041, 9007713.095088214, 9007737.5, 9008659.608088534, 9164684.375, 9165029.375578789, 9166286.750539953, 9167017.823621916, 9167646.875, 9191357.558213104, 9193455.20068294, 9197809.273969792, 9252148.101617495, 9252618.454451362, 9252834.206421213, 9252889.0625, 9252907.8125, 9253100.62069253, 9253156.424926506, 9253357.631206863, 9253400.0, 9253582.8125, 9253723.4375, 9253737.868427714, 9253998.4375, 9254190.558063963, 9254317.739918947, 9254392.485331144, 9254443.75, 9254451.5625, 9254463.718119333, 9255077.475428853, 9256666.800272366, 9256993.329091344, 9257789.0625, 9258843.75, 9259187.20591748, 9264743.978650142, 9265242.1875, 9265353.929870853, 9266032.592869008, 9266313.736630611, 9267533.86022588, 9269915.943176763, 9270477.012799073, 9270628.935812905, 9271168.75, 9271577.625591367, 9271925.0, 9271939.0625, 9271946.011361916, 9272403.37086154, 9272462.322089883, 9272490.141268162, 9273698.4375, 9274415.625, 9275188.31783982, 9277618.623101857, 9277654.6875, 9278068.826325897, 9278078.761407502, 9279483.059090592, 9280591.091178965, 9281264.146505808, 9282693.101328617, 9282814.059962444, 9284115.291048406, 9284498.753849525, 9284539.06177685, 9284559.375, 9284849.035929793, 9285037.5, 9288635.058292337, 9288812.505132362, 9289926.5625, 9290003.723755216, 9290771.367018957, 9291048.868266748, 9291218.75, 9291646.231010837, 9291946.875, 9292056.223935379, 9293434.203973614, 9296126.709807334, 9296835.9375, 9296939.0625, 9309698.278228428, 9309718.51176159, 9309773.0094748, 9309846.875, 9310078.870591521, 9310084.455966279, 9311121.875, 9312110.508313833, 9321388.456464592, 9321423.4556863, 9321424.722334208, 9321429.930416249, 9321457.8125, 9321464.0625, 9321484.9394945, 9321490.987240387, 9321514.83709215, 9321543.814473866, 9321580.045649957, 9321606.25, 9321628.191975959, 9321645.934983416, 9321728.06274702, 9321777.883292628, 9321795.090962267, 9321803.125, 9321835.5867778, 9321993.588527933, 9322014.026833367, 9322019.698564736, 9322021.504327789, 9322128.539635256, 9322149.865335574, 9322202.469631514, 9322249.051230505, 9322440.102877812, 9322467.1875, 9322507.431862406, 9322555.255586643, 9322622.582692614, 9322641.301963365, 9322949.023819907, 9323684.375, 9323937.5, 9323976.25098698, 9323984.579508994, 9324096.846267354, 585129089.1929841], [31.622598281734973, 36.53855559793233, 20.34545839762884, 14.938347200047236, 9.146785175095825, 50.175563688077006, 61.4800208829054, 87.94722220793672, 21.11986063998643, 12.434553176839229, 79.71695303927818, 17.826948284536503, 55.50907351821966, 23.77343558165808, 22.97279144064722, 11.073775733850322, 32.05766724469154, 63.86927470584935, 27.649200415372896, 24.715228877658475, 8.54693161972253, 24.359792294804443, 13.13931381280117, 10.256782742058606, 38.29118809408808, 27.77830553370348, 65.99691242584736, 66.6441130073792, 35.73995084119351, 36.9232715145173, 17.111572099162345, 117.31377094357266, 57.01229809101287, 195.83817693335817, 6.5623576811268665, 142.3594206718378, 12.775323645385482, 16.59982980087432, 85.52574984359879, 75.13588514911409, 65.61480757680211, 73.2839976164492, 5.319479298077053, 19.9085322340349, 72.68478975485462, 17.57315691864185, 43.25641083586764, 12.605591144939204, 18.154775899500383, 46.520793250028944, 17.616822727437587, 61.43946219112449, 14.888240918767838, 50.247585510382216, 6.3477794338245115, 31.03883872226765, 73.05359854544967, 58.11003721015274, 5.565409167686342, 15.991458009283377, 68.48704830717834, 134.77808509268954, 125.2568183581239, 30.109527602437645, 41.55627702261302, 29.990751073307322, 45.484091800686826, 13.877179517584532, 51.32480350838127, 6.579506391778608, 32.343126828969325, 13.324919872866873, 25.119215132678978, 21.37609544970794, 32.62919296313976, 76.48879452333995, 73.79235163733543, 31.917904643209383, 53.72995616097905, 12.403683528871287, 94.6054733465303, 26.50877748730644, 34.24248913099041, 7.684723813139942, 34.04482963818732, 59.559189068886674, 5.680199965236418, 192.2953478608743, 9.062850922015286, 67.36986905292301, 17.826557046225084, 47.20962990537072, 24.432902615915207, 21.50964933897408, 24.146567302491707, 36.33092797904082, 33.722709783795366, 32.72787897253687, 25.207885245281645, 36.559851903406305, 60.65770322577077, 165.66556763632465, 46.41477745086863, 67.47406190786275, 27.42945368283339, 35.75628726023332, 91.1033686224797, 5.294107813956517, 41.28880560998407, 9.966347464815104, 138.77300082262656, 54.26063787490153, 10.90393107795187, 128.41513793567165, 14.872689173180367, 13.685601436365399, 68.80890184687463, 91.01625943447156, 24.2745700633712, 162.95585376599035, 7.712682922458044, 160.81060316513958, 15.426070603276948, 38.2254580121776, 42.25358278769964, 47.72939509697924, 83.40446014880169, 25.504074027655143, 52.61924621692218, 34.05643277378958, 54.269436431424346, 7.980021752153238, 12.337570039135503, 5.260118384533156, 27.941349982591152, 24.75798148418074, 12.466977759000924, 25.23934105738732, 60.240879623256596, 69.31021723276083, 26.201068939441342, 13.926710437890248, 11.15509307142385, 6.014365896941412, 129.92354866849507, 29.896759025775346, 18.433354084452404, 28.301102608799248, 47.844873705686545, 5.226666241805546, 13.95169962614409, 17.497431869832496, 11.685986561912042, 91.43013374876361, 55.40338873265104, 73.4913557243023, 17.240157116904516, 9.444352943886425, 63.90421578827101, 26.698187576834002, 16.98845162587069, 51.44952227850707, 12.310843488838906, 11.034335525764272, 57.002511038196914, 23.173122461060096, 81.74807435038932, 10.511404547993164, 9.091469340125563, 7.917693876890929, 51.5715445819202, 5.930680214700637, 51.58987486015139, 81.60909914286195, 19.24589677428907, 19.274175613150135, 9.520499638461205, 62.116188706324785, 20.47366154714223, 61.06059960024663, 79.16879088007619, 26.678973098514753, 6.519266076989702, 6.241578884949418, 42.36706479840932, 6.888425956476199, 51.92382015413652, 29.041164691632762, 36.00512381883256, 24.679413677175376, 44.71004354877824, 5.311149529474626, 63.42447778561754, 24.352770328838943, 6.570663096455823, 26.67514294923778, 48.55961623706493, 15.173037439970935, 89.19926084493169, 34.53341544528609, 45.55269685192454, 12.259584792927038, 11.412598006686993, 5.800686807297049, 72.29779225243983, 68.03777308382028, 32.150884283870326, 8.491515994214911, 59.40343951333991, 27.26700813615612, 5.050977755793549, 16.21278159654033, 34.8223681912918, 42.976150660910335, 10.62894978646258, 43.577602950386265, 15.67387313553266, 20.174996775840967, 72.27769979767362, 72.65190449465535, 52.30953034104439, 42.473821874488934, 79.64537209125753, 19.25792918218745, 6.720437024558537, 91.32080763380922, 62.34210169930709, 28.269571186418638, 16.989242798338687, 5.083943427845124, 49.93971424549246, 34.896130542995394, 55.54619614886129, 58.489283661785166, 8.69429185753614, 9.548320967988122, 7.075456848237525, 21.65693351558484, 106.43742192370706, 56.351177377825564, 8.772237150421788, 22.001356870825894, 31.860444413019025, 62.981364241212546, 13.39792173376667, 7.694928518126056, 17.07599091842685, 15.271668402170604, 76.77040283444214, 110.27441699791873, 70.71055388240941, 7.20716975631694, 28.51090388462458, 89.93645067492474, 17.847448113586022, 35.31571074606291, 18.889153707607424, 109.69432949126652, 64.72673736239827, 48.899770755619826, 10.416813734548674, 16.88414905789587, 40.7408920896649, 32.84286834875316, 78.70640710034793, 61.244615109676374, 63.874726160636854, 11.366037937431155, 73.35153695653976, 37.66235853365536, 128.36925420200402, 24.573076692784788, 10.518673334667028, 31.866010442176815, 35.898436711404784, 30.113941630328274, 47.003365184743636, 13.52426481012215, 8.866645329665221, 30.502992835313236, 9.107161169671567, 19.451422401984082, 83.40222859087254, 44.187845191340266, 36.28325295051677, 9.657706794515297, 10.085205172589273, 15.193083113924825, 15.41271083775586, 54.67118972809719, 14.696083369796547, 17.997913710455837, 57.88331943758713, 96.59027592311801, 14.159385361598368, 45.660639942752965, 19.46818661058742, 23.03685921313865, 74.86824263401458, 20.427150207664887, 6.691694258229681, 27.957449524162413, 56.378381694389304, 10.237586726547823, 26.580275255611518, 13.265864179018775, 30.383313879404163, 22.772603457288188, 17.662301744548298, 6.360951726166169, 5.566863208439878, 26.440604352992402, 59.6966101758396, 67.56784487306946, 90.93411339244525, 45.12249900616752, 27.968609006987304, 249.44084106463217])
caption, xmean,count, xle, Etot = energy_spectrum(E_tot)
hist_file(E_hist, xmean, count, caption);
([4776952.875113257, 4895203.125, 4902313.439207066, 4918370.3463986525, 4928813.835781327, 5009754.570903925, 5009798.4375, 5058937.5, 5068546.336752432, 5107922.29156841, 5138338.83618591, 5141103.7201111335, 5142093.630132496, 5183168.451774551, 5191608.104353262, 5191773.402720386, 5191780.987260822, 5222631.25, 5224622.717775685, 5259585.7094326615, 5261620.774390866, 5279324.746230076, 5290349.4303725185, 5319530.610844067, 5338303.125, 5411706.211131014, 5529841.0580792995, 5557703.125, 5585183.07673634, 5597354.6875, 5603005.175293214, 5604051.5625, 5624089.0625, 5627004.171146625, 5645097.338907017, 5646314.224994885, 5654024.285793076, 5685637.4392698705, 5689175.0, 5713803.456175911, 5748245.3125, 5775703.125, 5804322.767609308, 5811193.074990998, 5832433.18048197, 5856999.096193644, 5876521.042827411, 5893271.089022694, 5895060.022001899, 5904632.8125, 5905733.3730037715, 5906556.25, 5923592.173453831, 5930281.25, 5932549.049745613, 5932579.6875, 5934223.933893293, 5962064.010745159, 5986931.898592596, 5987918.533382542, 5996951.5625, 5997551.5625, 6026834.375, 6028142.018527294, 6053053.890386566, 6060033.750419544, 6071168.75, 6083846.564609845, 6086118.75, 6100814.627748987, 6105106.145812002, 6109384.369067941, 6111695.112578524, 6112315.315222761, 6117145.820644028, 6117323.4375, 6134307.8125, 6146531.115213923, 6147493.75, 6160580.374714226, 6181267.18791476, 6182954.937814165, 6184174.410926499, 6185837.719814252, 6186055.826090367, 6194517.1875, 6199032.38695352, 6218148.4375, 6226693.414349949, 6230601.5625, 6234075.595047699, 6234305.523535072, 6241490.376591154, 6246457.3141573705, 6256090.355368591, 6264056.25, 6278761.779692584, 6280464.0625, 6290441.993610382, 6291776.453218724, 6298510.9375, 6298643.520152501, 6299395.156757125, 6319020.3125, 6322850.014501781, 6340230.522045199, 6350993.75, 6358636.0349780945, 6361818.613285567, 6363172.5412307065, 6363176.5625, 6435826.371085886, 6439009.226957196, 6439272.583262475, 6442605.363564005, 6452225.358742549, 6465578.125, 6479993.162412182, 6485148.177431223, 6485150.0, 6517801.855290965, 6528781.25, 6534385.926735207, 6537668.75, 6567404.6875, 6596648.4375, 6602970.536273112, 6616518.575892542, 6621423.4375, 6625696.506652342, 6633987.5, 6671489.996526208, 6697763.156991092, 6719314.588811892, 6720092.157325456, 6720214.699675804, 6724028.11746702, 6740256.122289702, 6772806.0989182, 6784762.5, 6788409.103372233, 6791924.705582991, 6793990.642450514, 6794047.697309677, 6802998.4375, 6821747.607447544, 6850031.939200299, 6859010.169319047, 6866578.304599038, 6917019.638545338, 6998252.838579258, 7078173.977847958, 8044317.668746939, 8730019.452616522, 8852364.0625, 8899064.0625, 8900459.360950643, 8928197.005626613, 8929851.562721126, 8947012.400331037, 8955000.411422217, 8959940.625, 8961613.14463107, 8970903.06443122, 8970909.222436126, 8971477.778393647, 8972808.608360803, 8973148.003856486, 8973162.201923512, 8973828.918085424, 8975073.101046117, 8976453.024259806, 8978910.9375, 8985251.745752411, 8985799.240774946, 8985869.60202736, 8988701.777978182, 8988892.1875, 8993500.509132441, 8995136.631586436, 8997954.6875, 8999444.806311565, 8999811.13972541, 9001199.794495646, 9001200.370972041, 9007713.095088214, 9007737.5, 9008659.608088534, 9164684.375, 9165029.375578789, 9166286.750539953, 9167017.823621916, 9167646.875, 9191357.558213104, 9193455.20068294, 9197809.273969792, 9252148.101617495, 9252618.454451362, 9252834.206421213, 9252889.0625, 9252907.8125, 9253100.62069253, 9253156.424926506, 9253357.631206863, 9253400.0, 9253582.8125, 9253723.4375, 9253737.868427714, 9253998.4375, 9254190.558063963, 9254317.739918947, 9254392.485331144, 9254443.75, 9254451.5625, 9254463.718119333, 9255077.475428853, 9256666.800272366, 9256993.329091344, 9257789.0625, 9258843.75, 9259187.20591748, 9264743.978650142, 9265242.1875, 9265353.929870853, 9266032.592869008, 9266313.736630611, 9267533.86022588, 9269915.943176763, 9270477.012799073, 9270628.935812905, 9271168.75, 9271577.625591367, 9271925.0, 9271939.0625, 9271946.011361916, 9272403.37086154, 9272462.322089883, 9272490.141268162, 9273698.4375, 9274415.625, 9275188.31783982, 9277618.623101857, 9277654.6875, 9278068.826325897, 9278078.761407502, 9279483.059090592, 9280591.091178965, 9281264.146505808, 9282693.101328617, 9282814.059962444, 9284115.291048406, 9284498.753849525, 9284539.06177685, 9284559.375, 9284849.035929793, 9285037.5, 9288635.058292337, 9288812.505132362, 9289926.5625, 9290003.723755216, 9290771.367018957, 9291048.868266748, 9291218.75, 9291646.231010837, 9291946.875, 9292056.223935379, 9293434.203973614, 9296126.709807334, 9296835.9375, 9296939.0625, 9309698.278228428, 9309718.51176159, 9309773.0094748, 9309846.875, 9310078.870591521, 9310084.455966279, 9311121.875, 9312110.508313833, 9321388.456464592, 9321423.4556863, 9321424.722334208, 9321429.930416249, 9321457.8125, 9321464.0625, 9321484.9394945, 9321490.987240387, 9321514.83709215, 9321543.814473866, 9321580.045649957, 9321606.25, 9321628.191975959, 9321645.934983416, 9321728.06274702, 9321777.883292628, 9321795.090962267, 9321803.125, 9321835.5867778, 9321993.588527933, 9322014.026833367, 9322019.698564736, 9322021.504327789, 9322128.539635256, 9322149.865335574, 9322202.469631514, 9322249.051230505, 9322440.102877812, 9322467.1875, 9322507.431862406, 9322555.255586643, 9322622.582692614, 9322641.301963365, 9322949.023819907, 9323684.375, 9323937.5, 9323976.25098698, 9323984.579508994, 9324096.846267354, 585129089.1929841], [31.622598281734973, 36.53855559793233, 20.34545839762884, 14.938347200047236, 9.146785175095825, 50.175563688077006, 61.4800208829054, 87.94722220793672, 21.11986063998643, 12.434553176839229, 79.71695303927818, 17.826948284536503, 55.50907351821966, 23.77343558165808, 22.97279144064722, 11.073775733850322, 32.05766724469154, 63.86927470584935, 27.649200415372896, 24.715228877658475, 8.54693161972253, 24.359792294804443, 13.13931381280117, 10.256782742058606, 38.29118809408808, 27.77830553370348, 65.99691242584736, 66.6441130073792, 35.73995084119351, 36.9232715145173, 17.111572099162345, 117.31377094357266, 57.01229809101287, 195.83817693335817, 6.5623576811268665, 142.3594206718378, 12.775323645385482, 16.59982980087432, 85.52574984359879, 75.13588514911409, 65.61480757680211, 73.2839976164492, 5.319479298077053, 19.9085322340349, 72.68478975485462, 17.57315691864185, 43.25641083586764, 12.605591144939204, 18.154775899500383, 46.520793250028944, 17.616822727437587, 61.43946219112449, 14.888240918767838, 50.247585510382216, 6.3477794338245115, 31.03883872226765, 73.05359854544967, 58.11003721015274, 5.565409167686342, 15.991458009283377, 68.48704830717834, 134.77808509268954, 125.2568183581239, 30.109527602437645, 41.55627702261302, 29.990751073307322, 45.484091800686826, 13.877179517584532, 51.32480350838127, 6.579506391778608, 32.343126828969325, 13.324919872866873, 25.119215132678978, 21.37609544970794, 32.62919296313976, 76.48879452333995, 73.79235163733543, 31.917904643209383, 53.72995616097905, 12.403683528871287, 94.6054733465303, 26.50877748730644, 34.24248913099041, 7.684723813139942, 34.04482963818732, 59.559189068886674, 5.680199965236418, 192.2953478608743, 9.062850922015286, 67.36986905292301, 17.826557046225084, 47.20962990537072, 24.432902615915207, 21.50964933897408, 24.146567302491707, 36.33092797904082, 33.722709783795366, 32.72787897253687, 25.207885245281645, 36.559851903406305, 60.65770322577077, 165.66556763632465, 46.41477745086863, 67.47406190786275, 27.42945368283339, 35.75628726023332, 91.1033686224797, 5.294107813956517, 41.28880560998407, 9.966347464815104, 138.77300082262656, 54.26063787490153, 10.90393107795187, 128.41513793567165, 14.872689173180367, 13.685601436365399, 68.80890184687463, 91.01625943447156, 24.2745700633712, 162.95585376599035, 7.712682922458044, 160.81060316513958, 15.426070603276948, 38.2254580121776, 42.25358278769964, 47.72939509697924, 83.40446014880169, 25.504074027655143, 52.61924621692218, 34.05643277378958, 54.269436431424346, 7.980021752153238, 12.337570039135503, 5.260118384533156, 27.941349982591152, 24.75798148418074, 12.466977759000924, 25.23934105738732, 60.240879623256596, 69.31021723276083, 26.201068939441342, 13.926710437890248, 11.15509307142385, 6.014365896941412, 129.92354866849507, 29.896759025775346, 18.433354084452404, 28.301102608799248, 47.844873705686545, 5.226666241805546, 13.95169962614409, 17.497431869832496, 11.685986561912042, 91.43013374876361, 55.40338873265104, 73.4913557243023, 17.240157116904516, 9.444352943886425, 63.90421578827101, 26.698187576834002, 16.98845162587069, 51.44952227850707, 12.310843488838906, 11.034335525764272, 57.002511038196914, 23.173122461060096, 81.74807435038932, 10.511404547993164, 9.091469340125563, 7.917693876890929, 51.5715445819202, 5.930680214700637, 51.58987486015139, 81.60909914286195, 19.24589677428907, 19.274175613150135, 9.520499638461205, 62.116188706324785, 20.47366154714223, 61.06059960024663, 79.16879088007619, 26.678973098514753, 6.519266076989702, 6.241578884949418, 42.36706479840932, 6.888425956476199, 51.92382015413652, 29.041164691632762, 36.00512381883256, 24.679413677175376, 44.71004354877824, 5.311149529474626, 63.42447778561754, 24.352770328838943, 6.570663096455823, 26.67514294923778, 48.55961623706493, 15.173037439970935, 89.19926084493169, 34.53341544528609, 45.55269685192454, 12.259584792927038, 11.412598006686993, 5.800686807297049, 72.29779225243983, 68.03777308382028, 32.150884283870326, 8.491515994214911, 59.40343951333991, 27.26700813615612, 5.050977755793549, 16.21278159654033, 34.8223681912918, 42.976150660910335, 10.62894978646258, 43.577602950386265, 15.67387313553266, 20.174996775840967, 72.27769979767362, 72.65190449465535, 52.30953034104439, 42.473821874488934, 79.64537209125753, 19.25792918218745, 6.720437024558537, 91.32080763380922, 62.34210169930709, 28.269571186418638, 16.989242798338687, 5.083943427845124, 49.93971424549246, 34.896130542995394, 55.54619614886129, 58.489283661785166, 8.69429185753614, 9.548320967988122, 7.075456848237525, 21.65693351558484, 106.43742192370706, 56.351177377825564, 8.772237150421788, 22.001356870825894, 31.860444413019025, 62.981364241212546, 13.39792173376667, 7.694928518126056, 17.07599091842685, 15.271668402170604, 76.77040283444214, 110.27441699791873, 70.71055388240941, 7.20716975631694, 28.51090388462458, 89.93645067492474, 17.847448113586022, 35.31571074606291, 18.889153707607424, 109.69432949126652, 64.72673736239827, 48.899770755619826, 10.416813734548674, 16.88414905789587, 40.7408920896649, 32.84286834875316, 78.70640710034793, 61.244615109676374, 63.874726160636854, 11.366037937431155, 73.35153695653976, 37.66235853365536, 128.36925420200402, 24.573076692784788, 10.518673334667028, 31.866010442176815, 35.898436711404784, 30.113941630328274, 47.003365184743636, 13.52426481012215, 8.866645329665221, 30.502992835313236, 9.107161169671567, 19.451422401984082, 83.40222859087254, 44.187845191340266, 36.28325295051677, 9.657706794515297, 10.085205172589273, 15.193083113924825, 15.41271083775586, 54.67118972809719, 14.696083369796547, 17.997913710455837, 57.88331943758713, 96.59027592311801, 14.159385361598368, 45.660639942752965, 19.46818661058742, 23.03685921313865, 74.86824263401458, 20.427150207664887, 6.691694258229681, 27.957449524162413, 56.378381694389304, 10.237586726547823, 26.580275255611518, 13.265864179018775, 30.383313879404163, 22.772603457288188, 17.662301744548298, 6.360951726166169, 5.566863208439878, 26.440604352992402, 59.6966101758396, 67.56784487306946, 90.93411339244525, 45.12249900616752, 27.968609006987304, 249.44084106463217])
caption, T_hit,count1 = hits_in_time_hist_new(T_pom, dt, t_plasma_start, t_plasma_end, is_plasma, figure_count_in_time_hist)
hist_file(count_in_time_hist, T_hit, count1, caption);
([4776952.875113257, 4895203.125, 4902313.439207066, 4918370.3463986525, 4928813.835781327, 5009754.570903925, 5009798.4375, 5058937.5, 5068546.336752432, 5107922.29156841, 5138338.83618591, 5141103.7201111335, 5142093.630132496, 5183168.451774551, 5191608.104353262, 5191773.402720386, 5191780.987260822, 5222631.25, 5224622.717775685, 5259585.7094326615, 5261620.774390866, 5279324.746230076, 5290349.4303725185, 5319530.610844067, 5338303.125, 5411706.211131014, 5529841.0580792995, 5557703.125, 5585183.07673634, 5597354.6875, 5603005.175293214, 5604051.5625, 5624089.0625, 5627004.171146625, 5645097.338907017, 5646314.224994885, 5654024.285793076, 5685637.4392698705, 5689175.0, 5713803.456175911, 5748245.3125, 5775703.125, 5804322.767609308, 5811193.074990998, 5832433.18048197, 5856999.096193644, 5876521.042827411, 5893271.089022694, 5895060.022001899, 5904632.8125, 5905733.3730037715, 5906556.25, 5923592.173453831, 5930281.25, 5932549.049745613, 5932579.6875, 5934223.933893293, 5962064.010745159, 5986931.898592596, 5987918.533382542, 5996951.5625, 5997551.5625, 6026834.375, 6028142.018527294, 6053053.890386566, 6060033.750419544, 6071168.75, 6083846.564609845, 6086118.75, 6100814.627748987, 6105106.145812002, 6109384.369067941, 6111695.112578524, 6112315.315222761, 6117145.820644028, 6117323.4375, 6134307.8125, 6146531.115213923, 6147493.75, 6160580.374714226, 6181267.18791476, 6182954.937814165, 6184174.410926499, 6185837.719814252, 6186055.826090367, 6194517.1875, 6199032.38695352, 6218148.4375, 6226693.414349949, 6230601.5625, 6234075.595047699, 6234305.523535072, 6241490.376591154, 6246457.3141573705, 6256090.355368591, 6264056.25, 6278761.779692584, 6280464.0625, 6290441.993610382, 6291776.453218724, 6298510.9375, 6298643.520152501, 6299395.156757125, 6319020.3125, 6322850.014501781, 6340230.522045199, 6350993.75, 6358636.0349780945, 6361818.613285567, 6363172.5412307065, 6363176.5625, 6435826.371085886, 6439009.226957196, 6439272.583262475, 6442605.363564005, 6452225.358742549, 6465578.125, 6479993.162412182, 6485148.177431223, 6485150.0, 6517801.855290965, 6528781.25, 6534385.926735207, 6537668.75, 6567404.6875, 6596648.4375, 6602970.536273112, 6616518.575892542, 6621423.4375, 6625696.506652342, 6633987.5, 6671489.996526208, 6697763.156991092, 6719314.588811892, 6720092.157325456, 6720214.699675804, 6724028.11746702, 6740256.122289702, 6772806.0989182, 6784762.5, 6788409.103372233, 6791924.705582991, 6793990.642450514, 6794047.697309677, 6802998.4375, 6821747.607447544, 6850031.939200299, 6859010.169319047, 6866578.304599038, 6917019.638545338, 6998252.838579258, 7078173.977847958, 8044317.668746939, 8730019.452616522, 8852364.0625, 8899064.0625, 8900459.360950643, 8928197.005626613, 8929851.562721126, 8947012.400331037, 8955000.411422217, 8959940.625, 8961613.14463107, 8970903.06443122, 8970909.222436126, 8971477.778393647, 8972808.608360803, 8973148.003856486, 8973162.201923512, 8973828.918085424, 8975073.101046117, 8976453.024259806, 8978910.9375, 8985251.745752411, 8985799.240774946, 8985869.60202736, 8988701.777978182, 8988892.1875, 8993500.509132441, 8995136.631586436, 8997954.6875, 8999444.806311565, 8999811.13972541, 9001199.794495646, 9001200.370972041, 9007713.095088214, 9007737.5, 9008659.608088534, 9164684.375, 9165029.375578789, 9166286.750539953, 9167017.823621916, 9167646.875, 9191357.558213104, 9193455.20068294, 9197809.273969792, 9252148.101617495, 9252618.454451362, 9252834.206421213, 9252889.0625, 9252907.8125, 9253100.62069253, 9253156.424926506, 9253357.631206863, 9253400.0, 9253582.8125, 9253723.4375, 9253737.868427714, 9253998.4375, 9254190.558063963, 9254317.739918947, 9254392.485331144, 9254443.75, 9254451.5625, 9254463.718119333, 9255077.475428853, 9256666.800272366, 9256993.329091344, 9257789.0625, 9258843.75, 9259187.20591748, 9264743.978650142, 9265242.1875, 9265353.929870853, 9266032.592869008, 9266313.736630611, 9267533.86022588, 9269915.943176763, 9270477.012799073, 9270628.935812905, 9271168.75, 9271577.625591367, 9271925.0, 9271939.0625, 9271946.011361916, 9272403.37086154, 9272462.322089883, 9272490.141268162, 9273698.4375, 9274415.625, 9275188.31783982, 9277618.623101857, 9277654.6875, 9278068.826325897, 9278078.761407502, 9279483.059090592, 9280591.091178965, 9281264.146505808, 9282693.101328617, 9282814.059962444, 9284115.291048406, 9284498.753849525, 9284539.06177685, 9284559.375, 9284849.035929793, 9285037.5, 9288635.058292337, 9288812.505132362, 9289926.5625, 9290003.723755216, 9290771.367018957, 9291048.868266748, 9291218.75, 9291646.231010837, 9291946.875, 9292056.223935379, 9293434.203973614, 9296126.709807334, 9296835.9375, 9296939.0625, 9309698.278228428, 9309718.51176159, 9309773.0094748, 9309846.875, 9310078.870591521, 9310084.455966279, 9311121.875, 9312110.508313833, 9321388.456464592, 9321423.4556863, 9321424.722334208, 9321429.930416249, 9321457.8125, 9321464.0625, 9321484.9394945, 9321490.987240387, 9321514.83709215, 9321543.814473866, 9321580.045649957, 9321606.25, 9321628.191975959, 9321645.934983416, 9321728.06274702, 9321777.883292628, 9321795.090962267, 9321803.125, 9321835.5867778, 9321993.588527933, 9322014.026833367, 9322019.698564736, 9322021.504327789, 9322128.539635256, 9322149.865335574, 9322202.469631514, 9322249.051230505, 9322440.102877812, 9322467.1875, 9322507.431862406, 9322555.255586643, 9322622.582692614, 9322641.301963365, 9322949.023819907, 9323684.375, 9323937.5, 9323976.25098698, 9323984.579508994, 9324096.846267354, 585129089.1929841], [31.622598281734973, 36.53855559793233, 20.34545839762884, 14.938347200047236, 9.146785175095825, 50.175563688077006, 61.4800208829054, 87.94722220793672, 21.11986063998643, 12.434553176839229, 79.71695303927818, 17.826948284536503, 55.50907351821966, 23.77343558165808, 22.97279144064722, 11.073775733850322, 32.05766724469154, 63.86927470584935, 27.649200415372896, 24.715228877658475, 8.54693161972253, 24.359792294804443, 13.13931381280117, 10.256782742058606, 38.29118809408808, 27.77830553370348, 65.99691242584736, 66.6441130073792, 35.73995084119351, 36.9232715145173, 17.111572099162345, 117.31377094357266, 57.01229809101287, 195.83817693335817, 6.5623576811268665, 142.3594206718378, 12.775323645385482, 16.59982980087432, 85.52574984359879, 75.13588514911409, 65.61480757680211, 73.2839976164492, 5.319479298077053, 19.9085322340349, 72.68478975485462, 17.57315691864185, 43.25641083586764, 12.605591144939204, 18.154775899500383, 46.520793250028944, 17.616822727437587, 61.43946219112449, 14.888240918767838, 50.247585510382216, 6.3477794338245115, 31.03883872226765, 73.05359854544967, 58.11003721015274, 5.565409167686342, 15.991458009283377, 68.48704830717834, 134.77808509268954, 125.2568183581239, 30.109527602437645, 41.55627702261302, 29.990751073307322, 45.484091800686826, 13.877179517584532, 51.32480350838127, 6.579506391778608, 32.343126828969325, 13.324919872866873, 25.119215132678978, 21.37609544970794, 32.62919296313976, 76.48879452333995, 73.79235163733543, 31.917904643209383, 53.72995616097905, 12.403683528871287, 94.6054733465303, 26.50877748730644, 34.24248913099041, 7.684723813139942, 34.04482963818732, 59.559189068886674, 5.680199965236418, 192.2953478608743, 9.062850922015286, 67.36986905292301, 17.826557046225084, 47.20962990537072, 24.432902615915207, 21.50964933897408, 24.146567302491707, 36.33092797904082, 33.722709783795366, 32.72787897253687, 25.207885245281645, 36.559851903406305, 60.65770322577077, 165.66556763632465, 46.41477745086863, 67.47406190786275, 27.42945368283339, 35.75628726023332, 91.1033686224797, 5.294107813956517, 41.28880560998407, 9.966347464815104, 138.77300082262656, 54.26063787490153, 10.90393107795187, 128.41513793567165, 14.872689173180367, 13.685601436365399, 68.80890184687463, 91.01625943447156, 24.2745700633712, 162.95585376599035, 7.712682922458044, 160.81060316513958, 15.426070603276948, 38.2254580121776, 42.25358278769964, 47.72939509697924, 83.40446014880169, 25.504074027655143, 52.61924621692218, 34.05643277378958, 54.269436431424346, 7.980021752153238, 12.337570039135503, 5.260118384533156, 27.941349982591152, 24.75798148418074, 12.466977759000924, 25.23934105738732, 60.240879623256596, 69.31021723276083, 26.201068939441342, 13.926710437890248, 11.15509307142385, 6.014365896941412, 129.92354866849507, 29.896759025775346, 18.433354084452404, 28.301102608799248, 47.844873705686545, 5.226666241805546, 13.95169962614409, 17.497431869832496, 11.685986561912042, 91.43013374876361, 55.40338873265104, 73.4913557243023, 17.240157116904516, 9.444352943886425, 63.90421578827101, 26.698187576834002, 16.98845162587069, 51.44952227850707, 12.310843488838906, 11.034335525764272, 57.002511038196914, 23.173122461060096, 81.74807435038932, 10.511404547993164, 9.091469340125563, 7.917693876890929, 51.5715445819202, 5.930680214700637, 51.58987486015139, 81.60909914286195, 19.24589677428907, 19.274175613150135, 9.520499638461205, 62.116188706324785, 20.47366154714223, 61.06059960024663, 79.16879088007619, 26.678973098514753, 6.519266076989702, 6.241578884949418, 42.36706479840932, 6.888425956476199, 51.92382015413652, 29.041164691632762, 36.00512381883256, 24.679413677175376, 44.71004354877824, 5.311149529474626, 63.42447778561754, 24.352770328838943, 6.570663096455823, 26.67514294923778, 48.55961623706493, 15.173037439970935, 89.19926084493169, 34.53341544528609, 45.55269685192454, 12.259584792927038, 11.412598006686993, 5.800686807297049, 72.29779225243983, 68.03777308382028, 32.150884283870326, 8.491515994214911, 59.40343951333991, 27.26700813615612, 5.050977755793549, 16.21278159654033, 34.8223681912918, 42.976150660910335, 10.62894978646258, 43.577602950386265, 15.67387313553266, 20.174996775840967, 72.27769979767362, 72.65190449465535, 52.30953034104439, 42.473821874488934, 79.64537209125753, 19.25792918218745, 6.720437024558537, 91.32080763380922, 62.34210169930709, 28.269571186418638, 16.989242798338687, 5.083943427845124, 49.93971424549246, 34.896130542995394, 55.54619614886129, 58.489283661785166, 8.69429185753614, 9.548320967988122, 7.075456848237525, 21.65693351558484, 106.43742192370706, 56.351177377825564, 8.772237150421788, 22.001356870825894, 31.860444413019025, 62.981364241212546, 13.39792173376667, 7.694928518126056, 17.07599091842685, 15.271668402170604, 76.77040283444214, 110.27441699791873, 70.71055388240941, 7.20716975631694, 28.51090388462458, 89.93645067492474, 17.847448113586022, 35.31571074606291, 18.889153707607424, 109.69432949126652, 64.72673736239827, 48.899770755619826, 10.416813734548674, 16.88414905789587, 40.7408920896649, 32.84286834875316, 78.70640710034793, 61.244615109676374, 63.874726160636854, 11.366037937431155, 73.35153695653976, 37.66235853365536, 128.36925420200402, 24.573076692784788, 10.518673334667028, 31.866010442176815, 35.898436711404784, 30.113941630328274, 47.003365184743636, 13.52426481012215, 8.866645329665221, 30.502992835313236, 9.107161169671567, 19.451422401984082, 83.40222859087254, 44.187845191340266, 36.28325295051677, 9.657706794515297, 10.085205172589273, 15.193083113924825, 15.41271083775586, 54.67118972809719, 14.696083369796547, 17.997913710455837, 57.88331943758713, 96.59027592311801, 14.159385361598368, 45.660639942752965, 19.46818661058742, 23.03685921313865, 74.86824263401458, 20.427150207664887, 6.691694258229681, 27.957449524162413, 56.378381694389304, 10.237586726547823, 26.580275255611518, 13.265864179018775, 30.383313879404163, 22.772603457288188, 17.662301744548298, 6.360951726166169, 5.566863208439878, 26.440604352992402, 59.6966101758396, 67.56784487306946, 90.93411339244525, 45.12249900616752, 27.968609006987304, 249.44084106463217])
Detected energies during the discharge + Energy spectrum
multiplot(icon_fig, T_int_first,E,xmean,count)
size_of_interactions_average(Etot, Ntot,size_interaction)
#energy_spectra_doublebreakdown(Etot, T_first, file_energy_spectra_doublebreakdown)