Fitters utilities#

Created on Aug 18 23:52:19 2024

The utilities_f holds some backend functionalities for the fitter class.

Available for use#

parameter_logic(par_array: ndarray, n_par: int, selected_models: int | List[int] | None) ndarray[source]#

Extract parameter values from a given function based on the number of parameters per fit and selected indices.

Parameters:
par_arraynp.ndarray

A 2D array where the first column contains the parameter values and the second contains its standard errors.

n_parint

The number of parameters per fit (e.g., amplitude, mu, sigma, etc.).

selected_modelsint, list of int, or None

Indices of model components to extract. - If None, selects all components. - If int or list of int, selects the specified components (1-based indexing).

Returns:
np.ndarray

A 2D array containing the selected parameter values for the specified mean and error values for the fit.

sanity_check(x_values: List[float] | ndarray, y_values: List[float] | ndarray) Tuple[ndarray, ndarray][source]#

Convert input lists to NumPy arrays if necessary.

Parameters:
x_valueslist of float or np.ndarray

Input x-values that will be converted to a NumPy array if they are in list format.

y_valueslist of float or np.ndarray

Input y-values that will be converted to a NumPy array if they are in list format.

Returns:
x_valuesnp.ndarray

The x-values as a NumPy array.

y_valuesnp.ndarray

The y-values as a NumPy array.