synchronous_phases module

Define various functions to compute the synchronous phase.

phi_s_legacy(integrated_field, *args, **kwargs)[source]

Compute the cavity parameters with phi_s historical definition.

Parameters:

integrated_field (complex | None) – Complex electric field felt by the synchronous particle. It is None if the cavity is failed.

Return type:

tuple[float, float]

Returns:

  • v_cav_mv – Accelerating voltage in \(\mathrm{MV}\). It is np.nan if integrated_field is None.

  • phi_s – Synchronous phase of the cavity in \(\mathrm{rad}\). It is np.nan if integrated_field is None.

phi_s_lagniel(simulation_output, *args, **kwargs)[source]

Compute cavity parameters with new phi_s model [Lag21].

Parameters:

simulation_output (object) – Holds results of a simulation.

Return type:

tuple[float, float]

Returns:

Corrected synchronous phase of the cavity.

phi_s_from_tracewin_file(simulation_output, *args, **kwargs)[source]

Get the synchronous phase from a TraceWin output file.

It is up to you to edit the tracewin.ini file in order to have the synchronous phase that you want.

Parameters:

simulation_output (object)

Return type:

tuple[float, float]

PHI_S_FUNC_T

A function that takes in the output of a transfer matrix function wrapper, and returns the accelerating field and the synchronous phase.

alias of Callable[[Any], tuple[float, float]]

PHI_S_MODELS

alias of Literal[‘historical’, ‘lagniel’]