superposed_field_map module

Define a SuperposedFieldMap.

Note

The initialisation of this class is particular, as it does not correspond to a specific line of the .dat file.

Todo

Could be cleaned and simplified.

class SuperposedFieldMap(line, cavities_settings, is_accelerating, dat_idx, idx_in_lattice, lattice, section, field_maps, rf_fields, **kwargs)[source]

Bases: Element

A single element holding several field maps.

We override its type to make Python believe it is a FieldMap, while is is just an Element. So take care of keeping their methods consistent!

Todo

Remove idx in lattice, lattice, section arguments. can take this from new attribute: field_maps.

Parameters:
is_implemented: bool = True
n_attributes: int | range | Collection = range(0, 100)
__init__(line, cavities_settings, is_accelerating, dat_idx, idx_in_lattice, lattice, section, field_maps, rf_fields, **kwargs)[source]

Save length of the superposed field maps.

Parameters:
classmethod from_field_maps(field_maps_n_superpose, dat_idx, total_length, starting_positions)[source]

Instantiate object from several field maps.

This is the only way this object should be instantiated; called by SuperposeMap.

Parameters:
Return type:

Self

classmethod from_args(dat_idx, total_length, *args, **kwargs)[source]

Insantiate object from his properties.

Parameters:
Return type:

Self

classmethod _args_to_line(total_length, *args, **kwargs)[source]

Generate hypothetical line.

Parameters:

total_length (float)

Return type:

str

classmethod _extract_args_from_field_maps(field_maps)[source]

Go over the field maps to gather essential arguments.

Parameters:

field_maps (Collection[FieldMap])

Return type:

tuple[list[CavitySettings], list[RfField], bool]

property status: str

Tell that everything is working, always (for now).

property is_accelerating: bool

Indicate if this element has a longitudinal effect.

property can_be_retuned: bool

Tell if we can modify the element’s tuning.

set_full_path(*args, **kwargs)[source]

Raise an error.

Return type:

None

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

Convert the object back into a line in the .dat file.

_abc_impl = <_abc._abc_data object at 0x73df436cb580>
class SuperposedPlaceHolderElt(line, idx_in_lattice, lattice, dat_idx=None, **kwargs)[source]

Bases: DummyElement

Inserted in place of field maps and superpose map commands.

Parameters:
increment_lattice_idx = False
__init__(line, idx_in_lattice, lattice, dat_idx=None, **kwargs)[source]

Instantiate object, with lattice information.

Parameters:
_abc_impl = <_abc._abc_data object at 0x73df436cb680>
class SuperposedPlaceHolderCmd(line, dat_idx=None, **kwargs)[source]

Bases: DummyCommand

Inserted in place of field maps and superpose map commands.

Parameters:
_abc_impl = <_abc._abc_data object at 0x73df436cb740>