LoadParameters#
- class LoadParameters(cfg)[source]#
Bases:
object- Class to extract amplitude parameters from an AmpTools FitResults or ConfigurationInfo object
Parameters (like production coefficients) can then be formatted (complex -> real, imag) for input to other minimization algorithms
- flatten_parameters(params={})[source]#
- Flatten amplitude parameters (complex-> real, imag) skipping imaginary parts of amplitudes fixed to be real. If no arguments are passed, use the uniqueProdPars and uniqueProdIsReal from the last call to load_cfg(). Can also format any dictionary pair into flat format.
Dictionary to List
- Parameters:
params (dict) – dictionary of parameters to flatten
- Returns:
list of flattened parameters keys (list): list of keys (parameter names) corresponding to parameters names (list): list of parameter names expanding complex parameters into Re[par] and Im[par]
- Return type:
parameters (list)
- load_cfg(cfg)[source]#
- Get a map of unique (parameter: value) pairs excluding redundant constrained ones
These include production parameters and amplitude parameters
- Parameters:
cfg – If cfg is a FitResults object set values to fitted results. For a ConfigurationInfo object set values to initial values
- unflatten_parameters(parameters, keys=[])[source]#
- Unflatten parameters forming complex values (for production parameters) when requested.
List to Dictionary
- Parameters:
parameters (list) – list of flattened parameters. Arrays work also, ensure you loop over parameters (columns of the mcmc samples)
keys (list) – list of keys (parameter names) corresponding to parameters. When empty will load from last flatten_parameters call
- Returns:
dictionary of parameters
- Return type:
paramDict (dict)