In [107]:
M = 60 # Pajzsmirigy tömege [g]
D = 150 # Kívánt effektív dózis [Gy]
cps0 = 26901 # Standard nyakfantomban
t = np.array([0, 0.09, 0.24, 0.94, 1.96, 5.95]) # mérési idópontok [napok]
peak = np.array([0, 3689, 8028, 13630, 13277, 9017]) # mért CPS
bkg = np.array([0, 198, 143, 124, 118, 104]) # háttér CPS
In [108]:
import pandas as pd
import numpy as np
net = peak - bkg*73/40
riu = net/cps0
data = np.array([t, peak, bkg, net, riu]).T
data = pd.DataFrame(data, columns=['t', 'peak', 'bkg', 'net', 'riu'])
print(data)
In [109]:
from scipy.optimize import curve_fit
def f(x, kt, kB, kT):
return kt/(kB-kT)*(np.exp(-kT*x)-np.exp(-kB*x))
p, cov = curve_fit(f, t, riu, method='trf', p0=[1, 1, 0])
print('kt = ', p[0], '/d')
print('kB = ', p[1], '/d')
print('kT = ', p[2], '/d')
In [110]:
import matplotlib.pyplot as plt
plt.plot(t, riu, 'ro', label='RIU')
tt = np.linspace(0, 10, 100)
plt.plot(tt, f(tt, p[0], p[1], p[2]), 'g-')
plt.xlabel('Nap')
plt.ylabel('RIU [%]')
plt.legend()
plt.grid()
plt.show()
In [111]:
from scipy.optimize import fmin
riu_max = max([f(x, *p) for x in tt])
t_max = fmin(lambda x: -f(x, *p), 0)
print('RIU_max = ', riu_max)
print('t_max = ', t_max[0])
print('T_eff = ', np.log(2)/p[2])
E = 2.808
Aa = M*D*p[1]*p[2]/(E*p[0])
print(Aa)
In [ ]: