# -*- coding: utf-8 -*-
"""
Created on Mon Apr 26 23:41:04 2021
@author: Stepan
"""
import numpy as np
#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
#from urllib.request import urlopen
#############################################################################################################
#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 = 36601 #test discharge for which the notebook will definitely work
shot = shot_no
identifier='D08-W0044_shot_'+str(shot)+'_450V'
def get_file(shot, identifier):
#Pick the discharge to analyse
URL = 'http://golem.fjfi.cvut.cz/shots/{shot}/Diagnostics/TimepixDetector/TimePix-b/{identifier}.t3pa'
url = URL.format(shot=shot, identifier=identifier)
print(url)
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/TimePix-b/{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 create_t3pa_cls(shot, identifier, file_t3pa_cls,T_cl, E_cl, index_cl, matrix_index_cl, ToA_cl, ToT_cl, FToA_cl, RowNo_cl, ClmNo_cl, overflow_cl,pocet_cl, Tfirst, Tlast, Etot, dT):
fileName=str(identifier)+'.t3pa_cls'
t3pa_cls = open(fileName,"w", encoding="utf-8")
url = urlopen('http://golem.fjfi.cvut.cz/shots/'+str(shot)+'/Diagnostics/TimepixDetector/')
#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')
for i in range(0,len(T_cl)):
t3pa_cls.write('# '+str(i+1)+', Nunmasked = '+str(pocet_cl[i])+', Nmasked = 0, Ntot = '+str(pocet_cl[i])+'\n')
t3pa_cls.write('# Tfirst = '+str(Tfirst[i])+' ns, Tlast = '+str(Tlast[i])+' ns, dT = '+str(dT[i])+' ns, Etot = '+str(Etot[i])+' keV\n')
for j in range(0,pocet_cl[i]):
t3pa_cls.write(str(index_cl[i][j])+' '+str(matrix_index_cl[i][j])+' [ '+str(RowNo_cl[i][j])+', '+str(ClmNo_cl[i][j])+' ] '+str(ToA_cl[i][j])+' '+str(FToA_cl[i][j])+' ( '+str(T_cl[i][j])+' ns ) '+str(ToT_cl[i][j])+' ( '+str(E_cl[i][j])+' keV ) '+str(overflow_cl[i][j])+'\n')
t3pa_cls.write('\n')
t3pa_cls.close
for line in url:
file.write(line + '\n')
file.close()
return
'''
#################################################################################################################
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 24 14:03:01 2021
@author: Stepan
"""
import numpy as np
#import pandas as pd
import matplotlib.pyplot as plt
def load_calib(file_calib):
with urllib.request.urlopen(file_calib) as fc:
#with open(file_calib, "r", encoding="utf-8") as fc:
#### vytvoreni 2D pole
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
#### mam pole calib 255x255 (0-255) vyplnene nulami
for i in range(0,256): #nacteni calib matice do pole calib
line = fc.readline()
line = line.decode('utf‐8')
word=line.strip().split(' ')
#print(word)
for j in range(0,256):
calib[i][j]=float(word[j]) #i = radek, j = sloupec0
#print(calib[i][j])
'''
if calib[i][j]==0:
print(calib[i][j])
print(i)
print(j)
'''
fc.close
print('load calib')
return calib
def load_t3pa_file(file_t3pa):
index=[]
matrix_index=[]
ToA=[]
ToT=[]
FToA=[]
overflow=[]
#RowNo=[]
#ClmNo=[]
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
#print(word)
#poc=0
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
#print(ToT[pocet_udalosti-1])
#RowNo.append(int(int(word[1]))//int(256))
#ClmNo.append(int(int(word[1]))%int(256))
#print(noise_matrix_index)
#word=line.strip().split(' ')
ft3pa.close
print('pocet udalosti: '+str(pocet_udalosti))
#print(len(index))
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
#print(konst)
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>=5: #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()
#print('noise pixels:')
#print(noise_matrix_index)
#print(len(noise_matrix_index))
#print(pocet)
#print('pocet udalosti:'+str(len(index)))
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]
#print(len(index))
pocet_udalosti=pocet_udalosti-1
continue
#print(pocet_udalosti)
#print(len(index))
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, pocet_udalosti, noise_matrix_index, index, matrix_index, ToA, ToT, FToA, overflow=noise(index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti)
pocet_udalosti,index, matrix_index, ToA, ToT, FToA, overflow=noise(index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti)
print('pocet udalosti bez sum pixelu: '+str(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))
#print('pocet udalosti bez sum pixelu: '+str(pocet_udalosti))
return index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti, RowNo, ClmNo
def energy(a, b, c, t, ToT, pocet_udalosti, RowNo, ClmNo):
E=[] #energy in keV
print(pocet_udalosti)
for i in range (0,pocet_udalosti):
sqrt=float(0.0)
e1=float(0.0)
e2=float(0.0)
#e=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]))**2) - float(4)*float(a[RowNo[i]][ClmNo[i]])*(float(b[RowNo[i]][ClmNo[i]])*float(t[RowNo[i]][ClmNo[i]])-float(c[RowNo[i]][ClmNo[i]])-float(t[RowNo[i]][ClmNo[i]])*float(ToT[i])))
if float(sqrt)<=float(0):
#e=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(b[RowNo[i]][ClmNo[i]])*float(t[RowNo[i]][ClmNo[i]])-float(c[RowNo[i]][ClmNo[i]])-float(t[RowNo[i]][ClmNo[i]])*float(ToT[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(b[RowNo[i]][ClmNo[i]])*float(t[RowNo[i]][ClmNo[i]])-float(c[RowNo[i]][ClmNo[i]])-float(t[RowNo[i]][ClmNo[i]])*float(ToT[i])))/(float(2)*np.sqrt(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]]))
#print(str(e1)+' '+str(e2))
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))
#print(E[i])
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))
#print (T[i])
'''
print(len(T))
print(T[len(T)-1])
for i in range(len(T)-2,len(T)):
print(T[i])
'''
return T
def time_clustering(index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti, RowNo, ClmNo, E, T):
#### vytvoreni 2D pole
#calib=[] #vytvoreni 1D pole
dT=float(50) #ns - 2dT je casove okno ze ktereho sbiram udalosti a davam je do jednoho clusteru
'''
indexNew=[]
matrix_indexNew=[]
ToANew=[]
ToTNew=[]
FToANew=[]
overflowNew=[]
RowNoNew=[]
ClmNoNew=[]
ENew=[]
TNew=[]
'''
index_tcl=[] #casove clustery
matrix_index_tcl=[]
ToA_tcl=[]
ToT_tcl=[]
FToA_tcl=[]
overflow_tcl=[]
RowNo_tcl=[]
ClmNo_tcl=[]
E_tcl=[]
T_tcl=[]
pocet=[] #pocet prvku v danem casovem clusteru
print('Number of measurement events (without noise pixels): '+str(len(T)))
#print(T[len(T)-1])
for i in range(0,len(T)):
ENew=[] # docasne pole
indexNew=[]
matrix_indexNew=[]
ToANew=[]
ToTNew=[]
FToANew=[]
overflowNew=[]
RowNoNew=[]
ClmNoNew=[]
TNew=[]
'''
if T[i]==-1:
continue
'''
if i>=len(T):
continue
TNew.append(float(T[i]))
ENew.append(float(E[i]))
indexNew.append(int(index[i]))
matrix_indexNew.append(int(matrix_index[i]))
ToANew.append(float(ToA[i]))
ToTNew.append(float(ToT[i]))
FToANew.append(float(FToA[i]))
overflowNew.append(float(overflow[i]))
RowNoNew.append(int(RowNo[i]))
ClmNoNew.append(int(ClmNo[i]))
del T[i]
del E[i]
del index[i]
del matrix_index[i]
del ToA[i]
del ToT[i]
del FToA[i]
del overflow[i]
del RowNo[i]
del ClmNo[i]
#T[i]=-1 # je to blby, ale zatim nevim, jak to udelat jinak - kdyz danou udalost prepisu na -1, je jiste ze
# uz ji nezapocitam znovu, smazani udalosti mi zatim nefunguje a hazi chyby
for k in range(0,len(TNew)):
for j in range(1,len(T)):
if j>=len(T):
continue
if T[j]>=(TNew[k]-dT) and T[j]<=(TNew[k]+dT):
TNew.append(float(T[j]))
ENew.append(float(E[j]))
indexNew.append(int(index[j]))
matrix_indexNew.append(int(matrix_index[j]))
ToANew.append(float(ToA[j]))
ToTNew.append(float(ToT[j]))
FToANew.append(float(FToA[j]))
overflowNew.append(float(overflow[j]))
RowNoNew.append(int(RowNo[j]))
ClmNoNew.append(int(ClmNo[j]))
del T[j]
del E[j]
del index[j]
del matrix_index[j]
del ToA[j]
del ToT[j]
del FToA[j]
del overflow[j]
del RowNo[j]
del ClmNo[j]
continue
T_tcl.append(TNew)
E_tcl.append(ENew)
index_tcl.append(indexNew)
matrix_index_tcl.append(matrix_indexNew)
ToA_tcl.append(ToANew)
ToT_tcl.append(ToTNew)
FToA_tcl.append(FToANew)
RowNo_tcl.append(RowNoNew)
ClmNo_tcl.append(ClmNoNew)
overflow_tcl.append(overflowNew)
pocet.append(int(len(TNew)))
#jen vypis (prochazeni casovych clusteru)
'''
for v in range(0,len(T_tcl)):
for b in range(0, pocet[v]):
print('sour ['+str(v)+'] ['+str(b)+']')
#print('T '+str(T_cl[v][b])+' E '+str(E_cl[v][b]))
print('T '+str(T_tcl[v][b])+' E '+str(E_tcl[v][b])+' ['+str(RowNo_tcl[v][b])+','+str(ClmNo_tcl[v][b])+']')
print('')
'''
print('time clusters end')
TNew.clear()
ENew.clear()
RowNoNew.clear()
ClmNoNew.clear()
indexNew.clear()
matrix_indexNew.clear()
ToANew.clear()
ToTNew.clear()
FToANew.clear()
overflowNew.clear()
return T_tcl, E_tcl, index_tcl, matrix_index_tcl,ToA_tcl, ToT_tcl, FToA_tcl, RowNo_tcl, ClmNo_tcl, overflow_tcl, pocet
def clustering (T_tcl, E_tcl, index_tcl, matrix_index_tcl,ToA_tcl, ToT_tcl, FToA_tcl, RowNo_tcl, ClmNo_tcl, overflow_tcl, pocet):
'''
for v in range(0,len(T_tcl)):
for b in range(0, pocet[v]):
print('sour ['+str(v)+'] ['+str(b)+']')
#print('T '+str(T_cl[v][b])+' E '+str(E_cl[v][b]))
print('T '+str(T_tcl[v][b])+' E '+str(E_tcl[v][b])+' ['+str(RowNo_tcl[v][b])+','+str(ClmNo_tcl[v][b])+']')
print('')
'''
index_cl=[]
matrix_index_cl=[]
ToA_cl=[]
ToT_cl=[]
FToA_cl=[]
overflow_cl=[]
RowNo_cl=[]
ClmNo_cl=[]
E_cl=[]
T_cl=[]
Tfirst=[]
Tlast=[]
Etot=[]
dT=[]
pocet_cl=[] #pocet prvku v danem clusteru
for i in range(0,len(T_tcl)):
for j in range(0, pocet[i]):
ENew=[] # docasne pole
indexNew=[]
matrix_indexNew=[]
ToANew=[]
ToTNew=[]
FToANew=[]
overflowNew=[]
RowNoNew=[]
ClmNoNew=[]
TNew=[]
if T_tcl[i][j]==-1:
continue
TNew.append(float(T_tcl[i][j]))
ENew.append(float(E_tcl[i][j]))
indexNew.append(int(index_tcl[i][j]))
matrix_indexNew.append(int(matrix_index_tcl[i][j]))
ToANew.append(float(ToA_tcl[i][j]))
ToTNew.append(float(ToT_tcl[i][j]))
FToANew.append(float(FToA_tcl[i][j]))
overflowNew.append(float(overflow_tcl[i][j]))
RowNoNew.append(int(RowNo_tcl[i][j]))
ClmNoNew.append(int(ClmNo_tcl[i][j]))
T_tcl[i][j]=-1
for m in range(pocet[i]):
for k in range(0,len(TNew)):
#for l in range(0,pocet[i]):
for l in range(0,pocet[i]):
#for k in range(0,len(TNew)):
if T_tcl[i][l]==-1:
continue
if RowNo_tcl[i][l]<=RowNoNew[k]+1 and RowNo_tcl[i][l]>=RowNoNew[k]-1 and ClmNo_tcl[i][l]<=ClmNoNew[k]+1 and ClmNo_tcl[i][l]>=ClmNoNew[k]-1:
TNew.append(float(T_tcl[i][l]))
ENew.append(float(E_tcl[i][l]))
indexNew.append(int(index_tcl[i][l]))
matrix_indexNew.append(int(matrix_index_tcl[i][l]))
ToANew.append(float(ToA_tcl[i][l]))
ToTNew.append(float(ToT_tcl[i][l]))
FToANew.append(float(FToA_tcl[i][l]))
overflowNew.append(float(overflow_tcl[i][l]))
RowNoNew.append(int(RowNo_tcl[i][l]))
ClmNoNew.append(int(ClmNo_tcl[i][l]))
T_tcl[i][l]=-1
'''
#for k in range(0,len(TNew)):
for l in range(0,pocet[i]):
#for l in range(0,pocet[i]):
for k in range(0,len(TNew)):
if T_tcl[i][l]==-1:
continue
if RowNo_tcl[i][l]<=RowNoNew[k]+1 and RowNo_tcl[i][l]>=RowNoNew[k]-1 and ClmNo_tcl[i][l]<=ClmNoNew[k]+1 and ClmNo_tcl[i][l]>=ClmNoNew[k]-1:
TNew.append(float(T_tcl[i][l]))
ENew.append(float(E_tcl[i][l]))
indexNew.append(int(index_tcl[i][l]))
matrix_indexNew.append(int(matrix_index_tcl[i][l]))
ToANew.append(float(ToA_tcl[i][l]))
ToTNew.append(float(ToT_tcl[i][l]))
FToANew.append(float(FToA_tcl[i][l]))
overflowNew.append(float(overflow_tcl[i][l]))
RowNoNew.append(int(RowNo_tcl[i][l]))
ClmNoNew.append(int(ClmNo_tcl[i][l]))
T_tcl[i][l]=-1
'''
T_cl.append(TNew)
E_cl.append(ENew)
index_cl.append(indexNew)
matrix_index_cl.append(matrix_indexNew)
ToA_cl.append(ToANew)
ToT_cl.append(ToTNew)
FToA_cl.append(FToANew)
RowNo_cl.append(RowNoNew)
ClmNo_cl.append(ClmNoNew)
overflow_cl.append(overflowNew)
pocet_cl.append(int(len(TNew)))
#print(T_cl)
for n in range(0,len(T_cl)):
Tfirst.append(float(min(T_cl[n])))
Tlast.append(float(max(T_cl[n])))
Etot.append(float(sum(E_cl[n])))
dT.append(float(Tlast[n])-float(Tfirst[n]))
'''
for v in range(0,len(T_cl)):
print('Tfirst='+str(T_first[v])+' Tlast='+str(T_last[v])+' Etot='+str(Etot[v])+' dT='+str(dT[v]))
for b in range(0, pocet_cl[v]):
print('cluster ['+str(v)+'] ['+str(b)+']')
#print('T '+str(T_cl[v][b])+' E '+str(E_cl[v][b]))
print('T '+str(T_cl[v][b])+' E '+str(E_cl[v][b])+' ['+str(RowNo_cl[v][b])+','+str(ClmNo_cl[v][b])+']')
print('')
'''
print('clusters end')
return T_cl, E_cl, index_cl, matrix_index_cl, ToA_cl, ToT_cl, FToA_cl, RowNo_cl, ClmNo_cl, overflow_cl,pocet_cl, Tfirst, Tlast, Etot, dT
def file_t3pa_cls(file_t3pa_cls,T_cl, E_cl, index_cl, matrix_index_cl, ToA_cl, ToT_cl, FToA_cl, RowNo_cl, ClmNo_cl, overflow_cl,pocet_cl, Tfirst, Tlast, Etot, dT):
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')
for i in range(0,len(T_cl)):
t3pa_cls.write('# '+str(i+1)+', Nunmasked = '+str(pocet_cl[i])+', Nmasked = 0, Ntot = '+str(pocet_cl[i])+'\n')
t3pa_cls.write('# Tfirst = '+str(Tfirst[i])+' ns, Tlast = '+str(Tlast[i])+' ns, dT = '+str(dT[i])+' ns, Etot = '+str(Etot[i])+' keV\n')
for j in range(0,pocet_cl[i]):
t3pa_cls.write(str(index_cl[i][j])+' '+str(matrix_index_cl[i][j])+' [ '+str(RowNo_cl[i][j])+', '+str(ClmNo_cl[i][j])+' ] '+str(ToA_cl[i][j])+' '+str(FToA_cl[i][j])+' ( '+str(T_cl[i][j])+' ns ) '+str(ToT_cl[i][j])+' ( '+str(E_cl[i][j])+' keV ) '+str(overflow_cl[i][j])+'\n')
t3pa_cls.write('\n')
t3pa_cls.close
print('file t3pa_cls')
return
def energy_spectrum(Tfirst, Etot): #dela histogram - energie zaznamenana v case
dt = int(100) #casove okno ze ktereho sbiram udalosti (clustery)
#print(len(Tfirst))
T_first=(min(Tfirst))
T_last=(max(Tfirst)) #posledni z Tfirst
#print(T_first)
Delta_T = T_last - T_first
poc = int(int(Delta_T) / int(dt)) + 1 #pocet casovych oken
T=[] #cas
E=[] #energie
for i in range(0,poc):
T.append((i*dt) + dt/2)
E.append(0)
for j in range(0,len(Tfirst)):
time_index=0
time_index=int(((Tfirst[j]-T_first)/dt))
for k in range(time_index-1,time_index+2):#range(0,poc):#
if k<0:
k=0
if k>=poc:
k=poc-1
if float(Tfirst[j]-T_first) < (T[k] - dt / 2):
continue
if float(Tfirst[j]-T_first) >= (T[k] - dt / 2) and float(Tfirst[j]-T_first) <= (T[k] + dt / 2):
E[k]=float(E[k])+float(Etot[j])
break
if float(Tfirst[j]-T_first) > (T[k] + dt / 2):
continue
print('time [ns] Energy [keV]')
'''
E_graph=[]
T_graph=[]
for l in range(0, poc):
if E[l]!=0:
#E_graph.append(E[l])
#T_graph.append(T[l])
print(str(T[l])+' '+str(E[l]))
'''
hist(T, E, figure_E_hist)
#file_hist(energy_hist, E, T)
return T, E
'''
def file_hist(file_hist, E, T): #zapise histogram do souboru
with open(file_hist, "w", encoding="utf-8") as hist:
hist.write('# time [ns] Energy [keV] \n')
for i in range(0, len(T)):
#if E[i]>0:
hist.write(str(T[i])+' '+str(E[i])+'\n')
hist.close
return
'''
def hist(T, E,figure_E_hist):
#plt.style.use('ggplot')
plt.plot(T, E)
plt.xlabel('Time [ns]')
plt.ylabel('Energy [keV]')
plt.xlim([0, 25000000]) #25 ms
#plt.xlim(0, 209125550.0)
plt.ylim(0, 10000) #10 000 keV
#plt.show()
plt.savefig(figure_E_hist, dpi = 1000)
#data.T.plot(kind='bar')
#plt.ylabel('GDP per capita')
return
'''
caliba = 'E:/Factory_Si/caliba.txt' #H03-W0051
calibb = 'E:/Factory_Si/calibb.txt' #H03-W0051
calibc = 'E:/Factory_Si/calibc.txt' #H03-W0051
calibt = 'E:/Factory_Si/calibt.txt' #H03-W0051
#t3pa = 'E:/mereni/mereni2010/data2010/H03-W0051_Am241_No1_temp20.t3pa'
t3pa = 'E:/mereni/test/H03-W0051_shot_36530_450V.t3pa'
#t3pa = 'E:/mereni/test/D08-W0044_No15_450V_1s.t3pa'
#t3pa = 'E:/mereni/mereni3103/I05/I05-W0037_22Na_No2_-450V_120s.t3pa'
t3pa_cls='E:/mereni/test/H03-W0051_shot_36530_450V.t3pa_cls'
energy_hist='E:/mereni/test/energy_hist_H03-W0051_shot_36530_450V.txt'
figure_E_hist='E:/mereni/test/energy_hist_H03-W0051_shot_36530_450V.png'
#pocet, noise_matrix_index=noise(t3pa)
#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 t3pa file:
index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti = load_t3pa_file(t3pa)
#vyhodim z t3pa file sumici pixely a prevedu matrix_index na cislo radku a cislo sloupce (RowNo a ClmNo)
index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti, RowNo, ClmNo = t3pa_data(pocet_udalosti, index, matrix_index, ToA, ToT, FToA, overflow)
#print(pocet_udalosti)
E=energy(a, b, c, t, ToT, pocet_udalosti, RowNo, ClmNo)
T=time(ToA, FToA, pocet_udalosti, RowNo, ClmNo)
T_tcl, E_tcl, index_tcl, matrix_index_tcl,ToA_tcl, ToT_tcl, FToA_tcl, RowNo_tcl, ClmNo_tcl, overflow_tcl, pocet=time_clustering(index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti, RowNo, ClmNo, E, T)
T_cl, E_cl, index_cl, matrix_index_cl, ToA_cl, ToT_cl, FToA_cl, RowNo_cl, ClmNo_cl, overflow_cl,pocet_cl, Tfirst, Tlast, Etot, dT = clustering(T_tcl, E_tcl, index_tcl, matrix_index_tcl,ToA_tcl, ToT_tcl, FToA_tcl, RowNo_tcl, ClmNo_tcl, overflow_tcl, pocet)
file_t3pa_cls(t3pa_cls,T_cl, E_cl, index_cl, matrix_index_cl, ToA_cl, ToT_cl, FToA_cl, RowNo_cl, ClmNo_cl, overflow_cl,pocet_cl, Tfirst, Tlast, Etot, dT)
energy_spectrum(Tfirst, Etot)
'''
##################################################################################################################
#soubory, ktere ctu
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)
'''
caliba = 'E:/Factory_Si/caliba.txt' #H03-W0051
calibb = 'E:/Factory_Si/calibb.txt' #H03-W0051
calibc = 'E:/Factory_Si/calibc.txt' #H03-W0051
calibt = 'E:/Factory_Si/calibt.txt' #H03-W0051
'''
#vytvorene soubory:
#t3pa_cls='E:/mereni/test/D08-W0044_No15_450V_1s.t3pa_cls'
t3pa_cls='H03-W0051_shot_'+str(shot)+'_450V.t3pa_cls'
#energy_hist='E:/mereni/test/energy_hist_D08-W0044_No15_450V_1s.txt'
figure_E_hist='icon-fig'
#pocet, noise_matrix_index=noise(t3pa)
#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)
E=energy(a, b, c, t, ToT, pocet_udalosti, RowNo, ClmNo)
T=time(ToA, FToA, pocet_udalosti, RowNo, ClmNo)
T_tcl, E_tcl, index_tcl, matrix_index_tcl,ToA_tcl, ToT_tcl, FToA_tcl, RowNo_tcl, ClmNo_tcl, overflow_tcl, pocet=time_clustering(index, matrix_index, ToA, ToT, FToA, overflow, pocet_udalosti, RowNo, ClmNo, E, T)
T_cl, E_cl, index_cl, matrix_index_cl, ToA_cl, ToT_cl, FToA_cl, RowNo_cl, ClmNo_cl, overflow_cl,pocet_cl, Tfirst, Tlast, Etot, dT = clustering(T_tcl, E_tcl, index_tcl, matrix_index_tcl,ToA_tcl, ToT_tcl, FToA_tcl, RowNo_tcl, ClmNo_tcl, overflow_tcl, pocet)
file_t3pa_cls(t3pa_cls,T_cl, E_cl, index_cl, matrix_index_cl, ToA_cl, ToT_cl, FToA_cl, RowNo_cl, ClmNo_cl, overflow_cl,pocet_cl, Tfirst, Tlast, Etot, dT)
energy_spectrum(Tfirst, Etot)
http://golem.fjfi.cvut.cz/shots/36601/Diagnostics/TimepixDetector/TimePix-b/D08-W0044_shot_36601_450V.t3pa http://golem.fjfi.cvut.cz/shots/36601/Diagnostics/TimepixDetector/TimePix-b/caliba.txt http://golem.fjfi.cvut.cz/shots/36601/Diagnostics/TimepixDetector/TimePix-b/calibb.txt http://golem.fjfi.cvut.cz/shots/36601/Diagnostics/TimepixDetector/TimePix-b/calibc.txt http://golem.fjfi.cvut.cz/shots/36601/Diagnostics/TimepixDetector/TimePix-b/calibt.txt load calib load calib load calib load calib pocet udalosti: 433 pocet udalosti bez sum pixelu: 433 433 Number of measurement events (without noise pixels): 433 time clusters end clusters end file t3pa_cls time [ns] Energy [keV]
([50.0, 150.0, 250.0, 350.0, 450.0, 550.0, 650.0, 750.0, 850.0, 950.0, 1050.0, 1150.0, 1250.0, 1350.0, 1450.0, 1550.0, 1650.0, 1750.0, 1850.0, 1950.0, 2050.0, 2150.0, 2250.0, 2350.0, 2450.0, 2550.0, 2650.0, 2750.0, 2850.0, 2950.0, 3050.0, 3150.0, 3250.0, 3350.0, 3450.0, 3550.0, 3650.0, 3750.0, 3850.0, 3950.0, 4050.0, 4150.0, 4250.0, 4350.0, 4450.0, 4550.0, 4650.0, 4750.0, 4850.0, 4950.0, 5050.0, 5150.0, 5250.0, 5350.0, 5450.0, 5550.0, 5650.0, 5750.0, 5850.0, 5950.0, 6050.0, 6150.0, 6250.0, 6350.0, 6450.0, 6550.0, 6650.0, 6750.0, 6850.0, 6950.0, 7050.0, 7150.0, 7250.0, 7350.0, 7450.0, 7550.0, 7650.0, 7750.0, 7850.0, 7950.0, 8050.0, 8150.0, 8250.0, 8350.0, 8450.0, 8550.0, 8650.0, 8750.0, 8850.0, 8950.0, 9050.0, 9150.0, 9250.0, 9350.0, 9450.0, 9550.0, 9650.0, 9750.0, 9850.0, 9950.0, 10050.0, 10150.0, 10250.0, 10350.0, 10450.0, 10550.0, 10650.0, 10750.0, 10850.0, 10950.0, 11050.0, 11150.0, 11250.0, 11350.0, 11450.0, 11550.0, 11650.0, 11750.0, 11850.0, 11950.0, 12050.0, 12150.0, 12250.0, 12350.0, 12450.0, 12550.0, 12650.0, 12750.0, 12850.0, 12950.0, 13050.0, 13150.0, 13250.0, 13350.0, 13450.0, 13550.0, 13650.0, 13750.0, 13850.0, 13950.0, 14050.0, 14150.0, 14250.0, 14350.0, 14450.0, 14550.0, 14650.0, 14750.0, 14850.0, 14950.0, 15050.0, 15150.0, 15250.0, 15350.0, 15450.0, 15550.0, 15650.0, 15750.0, 15850.0, 15950.0, 16050.0, 16150.0, 16250.0, 16350.0, 16450.0, 16550.0, 16650.0, 16750.0, 16850.0, 16950.0, 17050.0, 17150.0, 17250.0, 17350.0, 17450.0, 17550.0, 17650.0, 17750.0, 17850.0, 17950.0, 18050.0, 18150.0, 18250.0, 18350.0, 18450.0, 18550.0, 18650.0, 18750.0, 18850.0, 18950.0, 19050.0, 19150.0, 19250.0, 19350.0, 19450.0, 19550.0, 19650.0, 19750.0, 19850.0, 19950.0, 20050.0, 20150.0, 20250.0, 20350.0, 20450.0, 20550.0, 20650.0, 20750.0, 20850.0, 20950.0, 21050.0, 21150.0, 21250.0, 21350.0, 21450.0, 21550.0, 21650.0, 21750.0, 21850.0, 21950.0, 22050.0, 22150.0, 22250.0, 22350.0, 22450.0, 22550.0, 22650.0, 22750.0, 22850.0, 22950.0, 23050.0, 23150.0, 23250.0, 23350.0, 23450.0, 23550.0, 23650.0, 23750.0, 23850.0, 23950.0, 24050.0, 24150.0, 24250.0, 24350.0, 24450.0, 24550.0, 24650.0, 24750.0, 24850.0, 24950.0, 25050.0, 25150.0, 25250.0, 25350.0, 25450.0, 25550.0, 25650.0, 25750.0, 25850.0, 25950.0, 26050.0, 26150.0, 26250.0, 26350.0, 26450.0, 26550.0, 26650.0, 26750.0, 26850.0, 26950.0, 27050.0, 27150.0, 27250.0, 27350.0, 27450.0, 27550.0, 27650.0, 27750.0, 27850.0, 27950.0, 28050.0, 28150.0, 28250.0, 28350.0, 28450.0, 28550.0, 28650.0, 28750.0, 28850.0, 28950.0, 29050.0, 29150.0, 29250.0, 29350.0, 29450.0, 29550.0, 29650.0, 29750.0, 29850.0, 29950.0, 30050.0, 30150.0, 30250.0, 30350.0, 30450.0, 30550.0, 30650.0, 30750.0, 30850.0, 30950.0, 31050.0, 31150.0, 31250.0, 31350.0, 31450.0, 31550.0, 31650.0, 31750.0, 31850.0, 31950.0, 32050.0, 32150.0, 32250.0, 32350.0, 32450.0, 32550.0, 32650.0, 32750.0, 32850.0, 32950.0, 33050.0, 33150.0, 33250.0, 33350.0, 33450.0, 33550.0, 33650.0, 33750.0, 33850.0, 33950.0, 34050.0, 34150.0, 34250.0, 34350.0, 34450.0, 34550.0, 34650.0, 34750.0, 34850.0, 34950.0, 35050.0, 35150.0, 35250.0, 35350.0, 35450.0, 35550.0, 35650.0, 35750.0, 35850.0, 35950.0, 36050.0, 36150.0, 36250.0, 36350.0, 36450.0, 36550.0, 36650.0, 36750.0, 36850.0, 36950.0, 37050.0, 37150.0, 37250.0, 37350.0, 37450.0, 37550.0, 37650.0, 37750.0, 37850.0, 37950.0, 38050.0, 38150.0, 38250.0, 38350.0, 38450.0, 38550.0, 38650.0, 38750.0, 38850.0, 38950.0, 39050.0, 39150.0, 39250.0, 39350.0, 39450.0, 39550.0, 39650.0, 39750.0, 39850.0, 39950.0, 40050.0, 40150.0, 40250.0, 40350.0, 40450.0, 40550.0, 40650.0, 40750.0, 40850.0, 40950.0, 41050.0, 41150.0, 41250.0, 41350.0, 41450.0, 41550.0, 41650.0, 41750.0, 41850.0, 41950.0, 42050.0, 42150.0, 42250.0, 42350.0, 42450.0, 42550.0, 42650.0, 42750.0, 42850.0, 42950.0, 43050.0, 43150.0, 43250.0, 43350.0, 43450.0, 43550.0, 43650.0, 43750.0, 43850.0, 43950.0, 44050.0, 44150.0, 44250.0, 44350.0, 44450.0, 44550.0, 44650.0, 44750.0, 44850.0, 44950.0, 45050.0, 45150.0, 45250.0, 45350.0, 45450.0, 45550.0, 45650.0, 45750.0, 45850.0, 45950.0, 46050.0, 46150.0, 46250.0, 46350.0, 46450.0, 46550.0, 46650.0, 46750.0, 46850.0, 46950.0, 47050.0, 47150.0, 47250.0, 47350.0, 47450.0, 47550.0, 47650.0, 47750.0, 47850.0, 47950.0, 48050.0, 48150.0, 48250.0, 48350.0, 48450.0, 48550.0, 48650.0, 48750.0, 48850.0, 48950.0, 49050.0, 49150.0, 49250.0, 49350.0, 49450.0, 49550.0, 49650.0, 49750.0, 49850.0, 49950.0, 50050.0, 50150.0, 50250.0, 50350.0, 50450.0, 50550.0, 50650.0, 50750.0, 50850.0, 50950.0, 51050.0, 51150.0, 51250.0, 51350.0, 51450.0, 51550.0, 51650.0, 51750.0, 51850.0, 51950.0, 52050.0, 52150.0, 52250.0, 52350.0, 52450.0, 52550.0, 52650.0, 52750.0, 52850.0, 52950.0, 53050.0, 53150.0, 53250.0, 53350.0, 53450.0, 53550.0, 53650.0, 53750.0, 53850.0, 53950.0, 54050.0, 54150.0, 54250.0, 54350.0, 54450.0, 54550.0, 54650.0, 54750.0, 54850.0, 54950.0, 55050.0, 55150.0, 55250.0, 55350.0, 55450.0, 55550.0, 55650.0, 55750.0, 55850.0, 55950.0, 56050.0, 56150.0, 56250.0, 56350.0, 56450.0, 56550.0, 56650.0, 56750.0, 56850.0, 56950.0, 57050.0, 57150.0, 57250.0, 57350.0, 57450.0, 57550.0, 57650.0, 57750.0, 57850.0, 57950.0, 58050.0, 58150.0, 58250.0, 58350.0, 58450.0, 58550.0, 58650.0, 58750.0, 58850.0, 58950.0, 59050.0, 59150.0, 59250.0, 59350.0, 59450.0, 59550.0, 59650.0, 59750.0, 59850.0, 59950.0, 60050.0, 60150.0, 60250.0, 60350.0, 60450.0, 60550.0, 60650.0, 60750.0, 60850.0, 60950.0, 61050.0, 61150.0, 61250.0, 61350.0, 61450.0, 61550.0, 61650.0, 61750.0, 61850.0, 61950.0, 62050.0, 62150.0, 62250.0, 62350.0, 62450.0, 62550.0, 62650.0, 62750.0, 62850.0, 62950.0, 63050.0, 63150.0, 63250.0, 63350.0, 63450.0, 63550.0, 63650.0, 63750.0, 63850.0, 63950.0, 64050.0, 64150.0, 64250.0, 64350.0, 64450.0, 64550.0, 64650.0, 64750.0, 64850.0, 64950.0, 65050.0, 65150.0, 65250.0, 65350.0, 65450.0, 65550.0, 65650.0, 65750.0, 65850.0, 65950.0, 66050.0, 66150.0, 66250.0, 66350.0, 66450.0, 66550.0, 66650.0, 66750.0, 66850.0, 66950.0, 67050.0, 67150.0, 67250.0, 67350.0, 67450.0, 67550.0, 67650.0, 67750.0, 67850.0, 67950.0, 68050.0, 68150.0, 68250.0, 68350.0, 68450.0, 68550.0, 68650.0, 68750.0, 68850.0, 68950.0, 69050.0, 69150.0, 69250.0, 69350.0, 69450.0, 69550.0, 69650.0, 69750.0, 69850.0, 69950.0, 70050.0, 70150.0, 70250.0, 70350.0, 70450.0, 70550.0, 70650.0, 70750.0, 70850.0, 70950.0, 71050.0, 71150.0, 71250.0, 71350.0, 71450.0, 71550.0, 71650.0, 71750.0, 71850.0, 71950.0, 72050.0, 72150.0, 72250.0, 72350.0, 72450.0, 72550.0, 72650.0, 72750.0, 72850.0, 72950.0, 73050.0, 73150.0, 73250.0, 73350.0, 73450.0, 73550.0, 73650.0, 73750.0, 73850.0, 73950.0, 74050.0, 74150.0, 74250.0, 74350.0, 74450.0, 74550.0, 74650.0, 74750.0, 74850.0, 74950.0, 75050.0, 75150.0, 75250.0, 75350.0, 75450.0, 75550.0, 75650.0, 75750.0, 75850.0, 75950.0, 76050.0, 76150.0, 76250.0, 76350.0, 76450.0, 76550.0, 76650.0, 76750.0, 76850.0, 76950.0, 77050.0, 77150.0, 77250.0, 77350.0, 77450.0, 77550.0, 77650.0, 77750.0, 77850.0, 77950.0, 78050.0, 78150.0, 78250.0, 78350.0, 78450.0, 78550.0, 78650.0, 78750.0, 78850.0, 78950.0, 79050.0, 79150.0, 79250.0, 79350.0, 79450.0, 79550.0, 79650.0, 79750.0, 79850.0, 79950.0, 80050.0, 80150.0, 80250.0, 80350.0, 80450.0, 80550.0, 80650.0, 80750.0, 80850.0, 80950.0, 81050.0, 81150.0, 81250.0, 81350.0, 81450.0, 81550.0, 81650.0, 81750.0, 81850.0, 81950.0, 82050.0, 82150.0, 82250.0, 82350.0, 82450.0, 82550.0, 82650.0, 82750.0, 82850.0, 82950.0, 83050.0, 83150.0, 83250.0, 83350.0, 83450.0, 83550.0, 83650.0, 83750.0, 83850.0, 83950.0, 84050.0, 84150.0, 84250.0, 84350.0, 84450.0, 84550.0, 84650.0, 84750.0, 84850.0, 84950.0, 85050.0, 85150.0, 85250.0, 85350.0, 85450.0, 85550.0, 85650.0, 85750.0, 85850.0, 85950.0, 86050.0, 86150.0, 86250.0, 86350.0, 86450.0, 86550.0, 86650.0, 86750.0, 86850.0, 86950.0, 87050.0, 87150.0, 87250.0, 87350.0, 87450.0, 87550.0, 87650.0, 87750.0, 87850.0, 87950.0, 88050.0, 88150.0, 88250.0, 88350.0, 88450.0, 88550.0, 88650.0, 88750.0, 88850.0, 88950.0, 89050.0, 89150.0, 89250.0, 89350.0, 89450.0, 89550.0, 89650.0, 89750.0, 89850.0, 89950.0, 90050.0, 90150.0, 90250.0, 90350.0, 90450.0, 90550.0, 90650.0, 90750.0, 90850.0, 90950.0, 91050.0, 91150.0, 91250.0, 91350.0, 91450.0, 91550.0, 91650.0, 91750.0, 91850.0, 91950.0, 92050.0, 92150.0, 92250.0, 92350.0, 92450.0, 92550.0, 92650.0, 92750.0, 92850.0, 92950.0, 93050.0, 93150.0, 93250.0, 93350.0, 93450.0, 93550.0, 93650.0, 93750.0, 93850.0, 93950.0, 94050.0, 94150.0, 94250.0, 94350.0, 94450.0, 94550.0, 94650.0, 94750.0, 94850.0, 94950.0, 95050.0, 95150.0, 95250.0, 95350.0, 95450.0, 95550.0, 95650.0, 95750.0, 95850.0, 95950.0, 96050.0, 96150.0, 96250.0, 96350.0, 96450.0, 96550.0, 96650.0, 96750.0, 96850.0, 96950.0, 97050.0, 97150.0, 97250.0, 97350.0, 97450.0, 97550.0, 97650.0, 97750.0, 97850.0, 97950.0, 98050.0, 98150.0, 98250.0, 98350.0, 98450.0, 98550.0, 98650.0, 98750.0, 98850.0, 98950.0, 99050.0, 99150.0, 99250.0, 99350.0, 99450.0, 99550.0, 99650.0, 99750.0, 99850.0, 99950.0, ...], [21.580454312961336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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