def asymptotic_pdf(t, tres, tau, area): """ Calculate asymptotic probabolity density function. Parameters ---------- t : ndarray. Time. tres : float Time resolution. tau : ndarray, shape(k, 1) Time constants. area : ndarray, shape(k, 1) Component relative area. Returns ------- apdf : ndarray. """ t1 = np.extract(t[:] < tres, t) t2 = np.extract(t[:] >= tres, t) apdf2 = t2 * pdfs.expPDF(t2 - tres, tau, area) apdf = np.append(t1 * 0.0, apdf2) return apdf
def exact_pdf(t, tres, roots, areas, eigvals, gamma00, gamma10, gamma11): r""" Calculate exponential probabolity density function with exact solution for missed events correction (Eq. 21, HJC92). .. math:: :nowrap: \begin{align*} f(t) = \begin{cases} f_0(t) & \text{for}\; 0 \leq t \leq t_\text{res} \\ f_0(t) - f_1(t - t_\text{res}) & \text{for}\; t_\text{res} \leq t \leq 2 t_\text{res} \end{cases} \end{align*} Parameters ---------- t : float Time. tres : float Time resolution (dead time). roots : array_like, shape (k,) areas : array_like, shape (k,) eigvals : array_like, shape (k,) Eigenvalues of -Q matrix. gama00, gama10, gama11 : lists of floats Coeficients for the exact open/shut time pdf. Returns ------- f : float """ if t < tres: f = 0 elif ((tres < t) and (t < (2 * tres))): f = qml.f0((t - tres), eigvals, gamma00) elif ((tres * 2) < t) and (t < (3 * tres)): f = (qml.f0((t - tres), eigvals, gamma00) - qml.f1((t - 2 * tres), eigvals, gamma10, gamma11)) else: f = pdfs.expPDF(t - tres, -1 / roots, areas) return f