calc_convolution_with_check#

petpal.kinetic_modeling.tcms_as_convolutions.calc_convolution_with_check(f: numpy.ndarray, g: numpy.ndarray, dt: float) numpy.ndarray#

Performs a discrete convolution of two arrays, assumed to represent time-series data. Checks if the arrays are of the same shape.

Let f\(=f(t)\) and g\(=g(t)\) where both functions are 0 for \(t\leq0\). Then, the output, \(h(t)\), is

\[h(t) = \int_{0}^{t}f(s)g(s-t)\mathrm{d}s\]
Parameters:
  • f (np.ndarray) – Array containing the values for the input function.

  • g (np.ndarray) – Array containing values for the response function.

  • dt (np.ndarray) – The step-size, in the time-domain, between samples for f and g.

Returns:

(np.ndarray) – Convolution of the two arrays scaled by dt.

Important

This function does not use numba.jit(). Therefore, it cannot be used directly inside JIT’ed functions.