rf_field module

Hold parameters that are shared by all cavities of same type.

See also

CavitySettings

compute_param_cav(integrated_field)[source]

Compute synchronous phase and accelerating field.

Parameters:

integrated_field (complex)

Return type:

dict[str, float]

class RfField(section_idx)[source]

Bases: object

Cos-like RF field.

Warning, all phases are defined as:

\[\phi = \omega_0^{rf} t\]

While in the rest of the code it is defined as:

\[\phi = \omega_0_^{bunch} t\]

All phases are stored in radian.

Parameters:
  • e_spat – Spatial component of the electric field. Needs to be multiplied by the \(\cos(\omega t)\) to have the full electric field. Initialized to null function.

  • n_cell – Number of cells in the cavity.

  • n_z – Number of points in the file that gives e_spat, the spatial component of the electric field.

  • section_idx (int)

__init__(section_idx)[source]

Instantiate object.

Parameters:

section_idx (int)

has(key)[source]

Tell if the required attribute is in this class.

Parameters:

key (str)

Return type:

bool

get(*keys, **kwargs)[source]

Shorthand to get attributes from this class or its attributes.

Parameters:
  • *keys (Literal['e_spat', 'n_cell', 'n_z', 'starting_position', 'section_idx']) – Name of the desired attributes.

  • **kwargs (bool | str | None) – Other arguments passed to recursive getter.

Return type:

Any

Returns:

Attribute(s) value(s).

set_e_spat(e_spat, n_cell)[source]

Set the pos. component of electric field, set number of cells.

Parameters:
Return type:

None

shift()[source]

Shift the electric field map.

Warning

You must ensure that for z < 0 and z > element.length_m the electric field is null. Interpolation can lead to funny results!

Return type:

None