bio_rtd.pdf¶
GaussianFixedDispersion¶
-
class
bio_rtd.pdf.
GaussianFixedDispersion
(t, dispersion_index, cutoff=0.0001, pdf_id='GaussianFixedDispersion')[source]¶ Bases:
bio_rtd.core.PDF
Gaussian PDF with fixed dispersion
- Parameters
dispersion_index (float) – Dispersion index, defined as sigma * sigma / rt_mean. Where rt_mean is a mean residence time and sigma is a standard deviation.
cutoff (float) – Cutoff limit for trimming front and end tailing. Cutoff limit is relative to the peak max value.
See also
The
Examples
>>> t = _np.linspace(0, 100, 1001) >>> dt = t[1] >>> pdf = GaussianFixedDispersion(t, dispersion_index=0.2) >>> pdf.update_pdf(rt_mean=40) >>> p = pdf.get_p() >>> print(round(p.sum() * dt, 8)) 1.0 >>> t[p.argmax()] 40.0
-
assert_and_get_provided_kv_pairs
(**kwargs)¶ - Parameters
kwargs – Inputs to calc_pdf(**kwargs) function
- Returns
Filtered kwargs so the keys contain first possible key group in _possible_key_groups and any number of optional keys from _optional_keys.
- Return type
dict
- Raises
ValueError – If **kwargs do not contain keys from any of the groups in _possible_key_groups.
-
get_p
()¶ Get probability distribution.
- Returns
p – Evaluated probability distribution function. sum(p * self._dt) == 1 Corresponding time axis starts with 0 and has a fixed step of self._dt.
- Return type
np.ndarray
-
property
log
¶ Logger.
If logger is not set, then a DefaultLogger is instantiated. Setter also plants a data tree into passed logger.
- Return type
-
set_logger_from_parent
(parent_id, logger)¶ Inherit logger from parent.
- Parameters
parent_id (
str
) –logger (
RtdLogger
) –
-
update_pdf
(**kwargs)¶ Re-calculate PDF based on specified parameters.
- Parameters
kwargs – Should contain keys from one of the group in self._possible_key_groups. It may contain additional keys from self._optional_keys.
GaussianFixedRelativeWidth¶
-
class
bio_rtd.pdf.
GaussianFixedRelativeWidth
(t, relative_sigma, cutoff=0.0001, pdf_id='')[source]¶ Bases:
bio_rtd.core.PDF
Gaussian PDF with fixed relative peak width
relative_sigma = sigma / rt_mean
-
assert_and_get_provided_kv_pairs
(**kwargs)¶ - Parameters
kwargs – Inputs to calc_pdf(**kwargs) function
- Returns
Filtered kwargs so the keys contain first possible key group in _possible_key_groups and any number of optional keys from _optional_keys.
- Return type
dict
- Raises
ValueError – If **kwargs do not contain keys from any of the groups in _possible_key_groups.
-
get_p
()¶ Get probability distribution.
- Returns
p – Evaluated probability distribution function. sum(p * self._dt) == 1 Corresponding time axis starts with 0 and has a fixed step of self._dt.
- Return type
np.ndarray
-
property
log
¶ Logger.
If logger is not set, then a DefaultLogger is instantiated. Setter also plants a data tree into passed logger.
- Return type
-
set_logger_from_parent
(parent_id, logger)¶ Inherit logger from parent.
- Parameters
parent_id (
str
) –logger (
RtdLogger
) –
-
update_pdf
(**kwargs)¶ Re-calculate PDF based on specified parameters.
- Parameters
kwargs – Should contain keys from one of the group in self._possible_key_groups. It may contain additional keys from self._optional_keys.
-
ExpModGaussianFixedDispersion¶
-
class
bio_rtd.pdf.
ExpModGaussianFixedDispersion
(t, dispersion_index, skew, pdf_id='')[source]¶ Bases:
bio_rtd.core.PDF
Exponentially Modified Gaussian PDF with fixed dispersion
dispersion_index = sigma**2 / rt_mean pdf(rt_mean) = calc_emg(t, rt_mean, sigma, skew)
-
set_pdf_pars
(dispersion_index: float, skew: float)¶ Sets the dispersion index and skew factor
-
Abstract Methods
-
----------------
-
update_pdf
(**kwargs)¶ Calculate new pdf for a given set of parameters. pdf_update_keys contains groups of possible parameter combinations.
-
_possible_key_groups : Sequence[Sequence[str]]
List of keys for key-value argument combinations that could be specified to update_pdf(**kwarg) function
-
assert_and_get_provided_kv_pairs
(**kwargs)¶ - Parameters
kwargs – Inputs to calc_pdf(**kwargs) function
- Returns
Filtered kwargs so the keys contain first possible key group in _possible_key_groups and any number of optional keys from _optional_keys.
- Return type
dict
- Raises
ValueError – If **kwargs do not contain keys from any of the groups in _possible_key_groups.
-
get_p
()¶ Get probability distribution.
- Returns
p – Evaluated probability distribution function. sum(p * self._dt) == 1 Corresponding time axis starts with 0 and has a fixed step of self._dt.
- Return type
np.ndarray
-
property
log
¶ Logger.
If logger is not set, then a DefaultLogger is instantiated. Setter also plants a data tree into passed logger.
- Return type
-
set_logger_from_parent
(parent_id, logger)¶ Inherit logger from parent.
- Parameters
parent_id (
str
) –logger (
RtdLogger
) –
-
update_pdf
(**kwargs) Re-calculate PDF based on specified parameters.
- Parameters
kwargs – Should contain keys from one of the group in self._possible_key_groups. It may contain additional keys from self._optional_keys.
-
ExpModGaussianFixedRelativeWidth¶
-
class
bio_rtd.pdf.
ExpModGaussianFixedRelativeWidth
(t, sigma_relative, skew, pdf_id='')[source]¶ Bases:
bio_rtd.core.PDF
Exponentially Modified Gaussian PDF with fixed relative peak width
-
assert_and_get_provided_kv_pairs
(**kwargs)¶ - Parameters
kwargs – Inputs to calc_pdf(**kwargs) function
- Returns
Filtered kwargs so the keys contain first possible key group in _possible_key_groups and any number of optional keys from _optional_keys.
- Return type
dict
- Raises
ValueError – If **kwargs do not contain keys from any of the groups in _possible_key_groups.
-
get_p
()¶ Get probability distribution.
- Returns
p – Evaluated probability distribution function. sum(p * self._dt) == 1 Corresponding time axis starts with 0 and has a fixed step of self._dt.
- Return type
np.ndarray
-
property
log
¶ Logger.
If logger is not set, then a DefaultLogger is instantiated. Setter also plants a data tree into passed logger.
- Return type
-
set_logger_from_parent
(parent_id, logger)¶ Inherit logger from parent.
- Parameters
parent_id (
str
) –logger (
RtdLogger
) –
-
update_pdf
(**kwargs)¶ Re-calculate PDF based on specified parameters.
- Parameters
kwargs – Should contain keys from one of the group in self._possible_key_groups. It may contain additional keys from self._optional_keys.
-
TanksInSeries¶
-
class
bio_rtd.pdf.
TanksInSeries
(t, n_tanks, pdf_id='')[source]¶ Bases:
bio_rtd.core.PDF
Tanks in series PDF
rt_mean means flow-through time through entire unit operation (all tanks)
-
set_pdf_pars
(n_tanks: float)¶ Sets number of tanks
-
Abstract Methods
-
----------------
-
update_pdf
(**kwargs)¶ Calculate new pdf for a given set of parameters. pdf_update_keys contains groups of possible parameter combinations.
-
_possible_key_groups : Sequence[Sequence[str]]
List of keys for key-value argument combinations that could be specified to update_pdf(**kwarg) function
-
assert_and_get_provided_kv_pairs
(**kwargs)¶ - Parameters
kwargs – Inputs to calc_pdf(**kwargs) function
- Returns
Filtered kwargs so the keys contain first possible key group in _possible_key_groups and any number of optional keys from _optional_keys.
- Return type
dict
- Raises
ValueError – If **kwargs do not contain keys from any of the groups in _possible_key_groups.
-
get_p
()¶ Get probability distribution.
- Returns
p – Evaluated probability distribution function. sum(p * self._dt) == 1 Corresponding time axis starts with 0 and has a fixed step of self._dt.
- Return type
np.ndarray
-
property
log
¶ Logger.
If logger is not set, then a DefaultLogger is instantiated. Setter also plants a data tree into passed logger.
- Return type
-
set_logger_from_parent
(parent_id, logger)¶ Inherit logger from parent.
- Parameters
parent_id (
str
) –logger (
RtdLogger
) –
-
update_pdf
(**kwargs) Re-calculate PDF based on specified parameters.
- Parameters
kwargs – Should contain keys from one of the group in self._possible_key_groups. It may contain additional keys from self._optional_keys.
-