NuRadioReco.framework.parameter_storage module
Module that implements the basic structure for storing parameters
This class is not intended to be used directly, but is inherited by all basic NuRadio data objects (see Data Structure) that implement parameter storage.
- class NuRadioReco.framework.parameter_storage.ParameterStorage(parameter_types)[source]
Bases:
object
This class is the base class to store parameters and their covariances.
This class is not supposed to be used by a user but only be used by other classes to inherit from. All classes which have/should have a “parameter storage” shall inherit from this class. A parameter storage is a dictionary-like object which stores parameters and their covariances. As keys only enums from defined emum classes are allowed (parameter classes). Which parameter class is allowed is defined in the constructor of this class or can be modified with the function
add_parameter_type
.Methods
add_parameter_type
(parameter_type)Add a parameter class to the list of allowed parameter classes.
get_parameter
(key)Get a parameter
get_parameter_error
(key)Get the error of a parameter
Get all parameters
has_parameter
(key)Returns True if the parameter key is present, False otherwise
has_parameter_error
(key)Returns True if an uncertainty for the parameter key is present, False otherwise
remove_parameter
(key)Remove a parameter
set_parameter
(key, value)Set a parameter
set_parameter_error
(key, value)Set the error of a parameter
deserialize
serialize
- Parameters:
- parameter_typesparameter class or list of classes
The parameter classes are defined in
NuRadioReco.framework.parameters
Methods
add_parameter_type
(parameter_type)Add a parameter class to the list of allowed parameter classes.
get_parameter
(key)Get a parameter
get_parameter_error
(key)Get the error of a parameter
Get all parameters
has_parameter
(key)Returns True if the parameter key is present, False otherwise
has_parameter_error
(key)Returns True if an uncertainty for the parameter key is present, False otherwise
remove_parameter
(key)Remove a parameter
set_parameter
(key, value)Set a parameter
set_parameter_error
(key, value)Set the error of a parameter
deserialize
serialize
- add_parameter_type(parameter_type)[source]
Add a parameter class to the list of allowed parameter classes.
- Parameters:
- parameter_typeparameter class
The parameter class is defined in
NuRadioReco.framework.parameters