skultrafast.utils
¶
Module with various utility functions. Was called dv in older Versions.
Module Contents¶
Classes¶
Linear regression result. |
Functions¶
|
Bins a 1D array to given bins using weights. |
|
Simulates |
|
Masks outliers by iteratively removing points outside given |
|
Returns the stepfunction (erf-style) for given arguments. |
|
Calculates the PFID contribution for pure bleaching. |
|
Calculates the PFID contribution for the shifted frequecy. |
|
|
|
Calculates the solution and error terms in a linear regression. |
|
|
|
|
|
|
|
Fit and subtract baseline from given data |
|
Returns index-array where a is between upper and lower |
- skultrafast.utils.weighted_binning(x, arr, bins, weights=None)[source]¶
Bins a 1D array to given bins using weights.
- skultrafast.utils.sigma_clip(data, sigma: float = 3, max_iter: int = 5, axis: int = -1, use_mad: bool = False)[source]¶
Masks outliers by iteratively removing points outside given standard deviations.
- Parameters:
- Returns:
Array with outliers being masked.
- Return type:
np.ma.MaskedArray
- skultrafast.utils.gauss_step(x, amp: float, center: float, sigma: float)[source]¶
Returns the stepfunction (erf-style) for given arguments.
- skultrafast.utils.pfid_r4(T, om, om_10, T_2)[source]¶
Calculates the PFID contribution for pure bleaching.
See the PFID tutorial for a longer explanation. The function does broadcasting, hence it is possible to calculate the PFID contributions of serveral bands at once. For that, om_10 and T_2 must have the same shape.
- Parameters:
- Return type:
ndarry
- skultrafast.utils.pfid_r6(T, om, om_10, om_21, T_2)[source]¶
Calculates the PFID contribution for the shifted frequecy.
See the PFID tutorial for a longer explanation. The function does broadcasting, hence it is possible to calculate the PFID contributions of serveral bands at once. For that, om_10, om_21 and T_2 must have the same shape.
- Parameters:
T (1D-ndarry) – Delays between pump and probe. The formula assume a postive delays.
om (1D-ndarray) – Array of frequencies given in wavenumbers (cm-1).
om_10 (1D-ndarray or float) – Frequencies of the ground-state absorbtions
om_21 (1D-ndarray or float) – Frequencies of the shifted frequency
T_2 (1D_ndarray or float) – Decoherence time of the bands.
- Return type:
ndarry
- class skultrafast.utils.LinRegResult[source]¶
Linear regression result.
- skultrafast.utils.linreg_std_errors(A, y)[source]¶
Calculates the solution and error terms in a linear regression.
- Parameters:
A (ndarray) – Basis matrix
y (ndarray) – Data
- Returns:
Tuple of three arrays: standard error, variance matrix, r2
- Return type:
(ndarray, ndarray, ndarray,)