accml.app.tune package
Subpackages
Submodules
accml.app.tune.interface module
- class accml.app.tune.interface.TuneControllerInterface(*, mexec, oracle, policy, num_readings, wait_after_set, wait_between_samples, logger)[source]
Bases:
ControllerInterface- Parameters:
mexec (MeasurementExecutionEngine)
oracle (Oracle)
policy (PolicyBase)
num_readings (int)
wait_after_set (float)
wait_between_samples (float)
accml.app.tune.model module
- class accml.app.tune.model.MeasuredTuneResponse(col)[source]
Bases:
object- Parameters:
- class accml.app.tune.model.MeasuredTuneResponseItem(setpoint, x, y, repetition=-1)[source]
Bases:
objectTodo
Compare it to tune result model Which should stary
- class accml.app.tune.model.MeasuredTuneResponsePerPowerConverter(pc_name, col)[source]
Bases:
object- Parameters:
pc_name (str)
col (Sequence[MeasuredTuneResponseItem])
- class accml.app.tune.model.TuneResponse(pc_name, x, y)[source]
Bases:
object- Parameters:
pc_name (str)
accml.app.tune.oracle module
- class accml.app.tune.oracle.TuneOracle(*, target, col)[source]
Bases:
OracleTune oracle as a pure integral proportional controller
- Parameters:
target (Tune)
col (TuneResponseCollection)
accml.app.tune.policy module
- class accml.app.tune.policy.TunePolicy(scale=1.0)[source]
Bases:
PolicyBase- Parameters:
scale (float)
accml.app.tune.preprocess_simple_storage_data module
accml.app.tune.tune_correction module
- async accml.app.tune.tune_correction.tune_correction(dm, tune_target, *, n_iterations=3, n_samples=2, wait_after_set=0.5, wait_between_sample=0.1, mexec)[source]
Todo
reference / target tune from caller
consider to provide fine tuning from the outside
only connect to the actuators actually required
- Parameters:
tune_target (Tune)
mexec (MeasurementExecutionEngine)
accml.app.tune.tune_correction_controller module
- class accml.app.tune.tune_correction_controller.TuneCorrectionController(*, mexec, oracle, policy, n_samples, wait_after_set, wait_between_samples, logger=<Logger accml (WARNING)>)[source]
Bases:
TuneControllerInterfaceA simple I type controller
- It only implements the integral part of the controller:
i.e. react to the change
- Parameters:
mexec (MeasurementExecutionEngine)
oracle (Oracle)
policy (PolicyBase)
n_samples (int)
wait_after_set (float)
wait_between_samples (float)
- async continuous(*, read_commands, set_commands, n_steps=None)[source]
- Parameters:
read_commands (
Sequence[ReadCommand]) – commands to retrieve the observed positionsset_commands (
Sequence[Command]) – commands to set the actuators. Note that a copy of the command will be made and the value will be adaptedn_steps – if set to None, run forever, otherwise run maximum number of steps and stop then
- Discussion:
Should “read commands” and “set commands” be made available already at init?
Read commands tell the controller how to get to an “observable” state. “set_commands” allow the controller to e.g. probe the used measurement/cmd execution engine if these commands are understood and available.
The commands actually set will be typically produced by the “policy”. An alternate way would be that the policy changes the step to be taken. The commands to be executed are then generated by the controller.
- accml.app.tune.tune_correction_controller.compute_correction_state(*, oracle, policy, current_state, t_tune, logger)[source]
- accml.app.tune.tune_correction_controller.compute_stat_for_oracle(inp)[source]
- Return type:
- Parameters:
- accml.app.tune.tune_correction_controller.compute_stat_for_transactional_command(inp)[source]
- Return type:
- Parameters:
inp (TransactionCommand)
accml.app.tune.tune_measurement module
- async accml.app.tune.tune_measurement.measure_tune_response(*, detectors, quadrupole_pc_names, measurement_values, mexec=None, **kwargs)[source]
Todo
rename detectors to read_detectors? These are rather commands than real detectors
- Parameters:
detectors (Sequence[ReadCommand])
mexec (MeasurementExecutionEngine)
accml.app.tune.tune_response_analysis module
- accml.app.tune.tune_response_analysis.fit_line(indep, dep)[source]
- Return type:
- Parameters:
Todo
need to compute the standard deviation find out which algorithm to be used
orbit response profits from leastsquare lstsg so perhaps also to use it here
- accml.app.tune.tune_response_analysis.tune_response_analysis(prep_data)[source]
- Return type:
- Parameters:
prep_data (MeasuredTuneResponse)