phases module

Define functions to switch between the various phases.

Mainly used by CavitySettings.

diff_angle(phi_1, phi_2)[source]

Compute smallest difference between two angles.

Parameters:
Return type:

float

phi_0_abs_to_rel(phi_0_abs, phi_rf)[source]

Compute relative entry phase from absolute.

Parameters:
Return type:

float

phi_0_rel_to_abs(phi_0_rel, phi_rf)[source]

Compute relative entry phase from absolute.

Parameters:
Return type:

float

phi_bunch_to_phi_rf(phi_bunch, rf_over_bunch_frequencies)[source]
Overloads:
  • phi_bunch (NDArray[np.float64]), rf_over_bunch_frequencies (float) → NDArray[np.float64]

  • phi_bunch (float), rf_over_bunch_frequencies (float) → float

Parameters:
Return type:

float | ndarray[tuple[Any, …], dtype[float64]]

Convert the bunch phase to a rf phase.

Parameters:
Return type:

float | ndarray[tuple[Any, …], dtype[float64]]

phi_rf_to_phi_bunch(phi_rf, bunch_over_rf_frequencies)[source]
Overloads:
  • phi_rf (NDArray[np.float64]), bunch_over_rf_frequencies (float) → NDArray[np.float64]

  • phi_rf (float), bunch_over_rf_frequencies (float) → float

Parameters:
Return type:

float | ndarray[tuple[Any, …], dtype[float64]]

Convert the bunch phase to rf phase.

Parameters:
Return type:

float | ndarray[tuple[Any, …], dtype[float64]]