set_sync_phase module

Define the SET_SYNC_PHASE command.

Todo

Should also modify RFQ_CEL, CAVSIN, NCELLS according to doc.

class SetSyncPhase(line, dat_idx=None, **kwargs)[source]

Bases: Command

A class that modifies reference phase of next cavity.

Parameters:
is_implemented: bool = True
n_attributes: int | range | Collection = 0
__init__(line, dat_idx=None, **kwargs)[source]

Instantiate command.

Parameters:
Return type:

None

set_influenced_elements(instructions, **kwargs)[source]

Capture first cavity after this command.

Parameters:
Return type:

None

apply(instructions, **kwargs)[source]

Set phi_s, remove previous reference phase.

When we apply this method, LightWin believes that the phase given in the DAT file is an absolute or relative phase. We update the reference of the CavitySettings, as well as the actual value of phi_ref == phi_s.

Parameters:
Return type:

list[Instruction]

to_line(*args, which_phase, **kwargs)[source]

Return the command, commented if output phase should not be phi_s.

Note

We keep old implementation for now. But this method returns nothing because the to_line method of FieldMap already handles adding a SET_SYNC_PHASE when necessary.

Parameters:

which_phase (Literal['phi_0_abs', 'phi_0_rel', 'phi_s'])

Return type:

list[str]

_abc_impl = <_abc._abc_data object at 0x7318fb80ac00>