field module
Define an equivalent to TraceWin’s FIELD_MAP.
Note
For now, we expect that coordinates are always cartesian.
Todo
Define a FieldMapLoader function to easily choose between binary/ascii file format.
Todo
Should have a omega0_rf attribute
See also
- class Field(field_map_path, length_m, z_0=0.0)[source]
Bases:
ABCGeneric electro-magnetic field.
This object can be shared by several
Elementand we create as few as possible.-
extensions:
Collection[str]
- load_fieldmaps()[source]
Load all field components for class
extensions.- Return type:
- abstract _load_fieldmap(path, **validity_check_kwargs)[source]
Generate field function corresponding to a single field file.
- Parameters:
path (pathlib.Path) – Path to a field map file.
- Return type:
- Returns:
func (Callable[…, float]) – Give field at a given position, position being a tuple of 1, 2 or 3 floats.
n_interp (Any) – Number of interpolation points in the various directions (tuple of 1, 2 or 3 integers).
n_cell (int) – Number of cells (makes sense only for .edz as for now).
- _calculate_field(component_func, pos, phi, amplitude, phi_0_rel, *, complex_output=True)[source]
Calculate the field component value.
- Parameters:
component_func (Callable[..., float]) – The spatial field component function (e.g., self._e_x_spat_rf). Must accept a tuple of 1 to 3 floats (position) and return a float.
pos (Any) – The position at which to evaluate the field.
phi (float) – The phase angle.
amplitude (float) – The amplitude of the field.
phi_0_rel (float) – The relative phase offset.
complex_output (bool, optional) – Whether to return a complex value. Defaults to True.
- Returns:
The calculated field value.
- Return type:
- partial_e_z(amplitude, phi_0_rel)[source]
Generate a function for longitudinal transfer matrix calculation.
- _abc_impl = <_abc._abc_data object at 0x73df447c3340>
-
extensions: