dcmri.flux_free#
- dcmri.flux_free(J, H, t=None, dt=1.0, TT=None, TTmin=0, TTmax=None)[source]#
Indicator flux out of a free system.
See section Free for more detail.
- Parameters:
J (array_like) – the indicator flux entering the system.
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, optional) – the time points of the indicator flux J, in the same units as T. If t=None, the time points are assumed to be uniformly spaced with spacing dt. Defaults to None.
dt (float, optional) – spacing between time points for uniformly spaced time points, in the same units as T. This parameter is ignored if t is explicity provided. Defaults to 1.0.
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:
Outflux as a 1D array.
- Return type:
Example
>>> import dcmri as dc >>> t = [0,5,15,30,60] >>> J = [1,2,3,3,2]
Assume the transit time histogram is provided by two equally sized bins covering the entire time interval, with frequencies 2 and 1, respectively:
>>> dc.flux_free(J, [2,1], t) array([0. , 0.11111111, 0.48148148, 1.25102881, 2.60802469])
Assume the transit time has two equally sized bins, but between the values [0.5, 2.5]:
>>> dc.flux_free(J, [2,1], t, TTmin=0.5, TTmax=2.5) array([0. , 1.34074074, 2.69259259, 3. , 2.1 ])
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.flux_free(J, [2,1], t, TT=[0.5,1.0,2.5]) array([0. , 1.40185185, 2.71898148, 3. , 2.09166667])
If the time array is not provided, the function assumes uniform time resolution with time step = 1:
>>> dc.flux_free(J, [2,1], TT=[0.5,1.0,2.5]) array([0. , 0.7 , 1.8 , 2.60555556, 2.69444444])
If the time step is different from 1, it needs to be provided explicitly:
>>> dc.flux_free(J, [2,1], dt=2.0, TT=[0.5,1.0,2.5]) array([0. , 1.10185185, 2.24074074, 2.86574074, 2.59722222])