dcmri.res_free#
- dcmri.res_free(H, t, TT=None, TTmin=0, TTmax=None)[source]#
Residue function of a free system.
See section Free for more detail.
- Parameters:
H (array_like) – frequencies of the transit time histogram in each transit time bin. These do not have to be normalized - the function normalizes to unit area by default.
t (array_like) – time points where the residue function is calculated, in the same units as T.
TT (array_like) – boundaries of the transit time histogram bins. The number of elements in this array must be one more than the number of elements in H. If TT is not provided, the boundaries are equally distributed between TTmin and TTmax. Defaults to None.
TTmin (float) – Minimal transit time to be considered. If TT is provided, this argument is ignored. Defaults to 0.
TTmax (float) – Maximal transit time to be considered. If TT is provided, this argument is ignored. Defaults to the maximum of t.
- Returns:
residue function as a 1D array.
- Return type:
- Raises:
ValueError – if the array of transit times has the incorrect length.
Example
>>> import dcmri as dc >>> t = [0,1,2,3]
Assume the transit time histogram is provided by two equally sized bins covering the entire time interval, with frequencies 2 and 1, respectively:
>>> dc.res_free([2,1], t) array([1. , 0.625, 0.25 , 0. ])
Assume the transit time has two equally sized bins, but between the values [0.5, 2.5]:
>>> dc.res_free([2,1], t, TTmin=0.5, TTmax=2.5) array([1.00000000e+00, 6.66666667e-01, 2.38095238e-01, 2.22044605e-16])
Assume the transit time histogram is provided by two bins in the same range, but with different sizes: one from 0.5 to 1 and the other from 1 to 2.5. The frequencies in the bins are the same as in the previous example:
>>> dc.res_free([2,1], t, TT=[0.5,1.0,2.5]) array([1.00000000e+00, 5.09259259e-01, 1.11111111e-01, 2.22044605e-16])