cavity_settings_factory module

Create CavitySettings from various contexts.

class CavitySettingsFactory(freq_bunch_mhz)[source]

Bases: object

Base class to create CavitySettings objects.

Parameters:

freq_bunch_mhz (float)

__init__(freq_bunch_mhz)[source]

Instantiate factory, with attributes common to all cavities.

Parameters:

freq_bunch_mhz (float)

from_line_in_dat_file(line, set_sync_phase=False)[source]

Create the cavity settings as read in the .dat file.

Parameters:
Return type:

CavitySettings

from_optimisation_algorithm(base_settings, var, reference, status)[source]

Create the cavity settings to try during an optimisation.

Parameters:
  • base_settings (Sequence[CavitySettings])

  • var (ndarray)

  • reference (Literal['phi_0_abs', 'phi_0_rel', 'phi_s'])

  • status (Literal['compensate (in progress)', 'compensate (not ok)', 'compensate (ok)', 'failed', 'nominal', 'rephased (in progress)', 'rephased (ok)'])

Return type:

list[CavitySettings]

from_other_cavity_settings(cavity_settings, reference=None)[source]

Create a copy of cavity_settings, reference can be updated.

Not used for the moment.

Parameters:
Return type:

list[CavitySettings]

_reference(absolute_phase_flag, set_sync_phase)[source]

Determine which phase will be the reference one.

Parameters:
  • absolute_phase_flag (bool)

  • set_sync_phase (bool)

Return type:

Literal['phi_0_abs', 'phi_0_rel', 'phi_s']