cavity_settings_factory module
Create CavitySettings from various contexts.
- class CavitySettingsFactory(freq_bunch_mhz)[source]
Bases:
objectBase class to create
CavitySettingsobjects.- Parameters:
freq_bunch_mhz (
float)
- __init__(freq_bunch_mhz)[source]
Instantiate factory, with attributes common to all cavities.
- Parameters:
freq_bunch_mhz (
float)- Return type:
None
- from_line_in_dat_file(line, set_sync_phase=False)[source]
Create the cavity settings as read in the
DATfile.- Parameters:
- Return type:
- from_optimisation_algorithm(base_settings, var, reference, status)[source]
Create the cavity settings to try during/at the end of an optimization.
- Parameters:
base_settings (
Sequence[CavitySettings]) – Nominal cavity settings, serving as a “base” for creating the newCavitySettings.var (
ndarray) – Holds amplitudes in the first half, phases in the second half.reference (
Literal['phi_0_abs','phi_0_rel','phi_s']) – Nature of the phase to use as reference for the optimization.status (
Literal['compensate (in progress)','compensate (not ok)','compensate (ok)','failed','nominal','rephased (in progress)','rephased (ok)']) – Status of the cavities.
- Return type: