calix.common.base.Algorithm
-
class
calix.common.base.
Algorithm
Bases:
abc.ABC
Base class for calibration Algorithms. From here, algorithms are derived, which implement a run() method.
- Variables
calibration – Calib instance that contains important parameters and functions for the Algorithm to run.
-
__init__
() Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
()Initialize self.
hook_to_calibration
(calibration)Make an instance of a calibration known to the algorithm, allowing to use parameters set there.
run
(connection, target_result)Function that iterates setting parameters up, testing the results, comparing them to the target result(s) and changing the parameters.
Clear a calibration instance previously hooked to this algorithm.
-
hook_to_calibration
(calibration: calix.common.base.Calib) Make an instance of a calibration known to the algorithm, allowing to use parameters set there.
- Parameters
calibration – Instance of calibration class that will be run with this algorithm.
-
abstract
run
(connection: pyhxcomm_vx.ConnectionHandle, target_result: Union[float, int, numpy.ndarray]) → numpy.ndarray Function that iterates setting parameters up, testing the results, comparing them to the target result(s) and changing the parameters. The specifics are implemented in the derived algorithms. Generally, the run function also configures the optimum parameters on hardware, in addition to returning them.
- Parameters
connection – Connection that will be used when setting up parameters and measuring results.
target_result – Target for the calibration. The parameters will be set up such that the results match the target as close as possible. The target can be either a single value that will be used for all instances of parameters or an array containing a specific target for each instance. When using an array, its length has to match n_instances.
- Returns
Best suited parameters to reach given targets.
-
unhook_from_calibration
() Clear a calibration instance previously hooked to this algorithm.