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, **kwargs)[source]
Bases:
ElementA single element holding several field maps.
We override its type to make Python believe it is a
FieldMap, while is is just anElement. 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:
line (
DatLine)cavities_settings (
Collection[CavitySettings])is_accelerating (
bool)dat_idx (
int)idx_in_lattice (
int)lattice (
int)section (
int)field_maps (
Collection[FieldMap])
- __init__(line, cavities_settings, is_accelerating, dat_idx, idx_in_lattice, lattice, section, field_maps, **kwargs)[source]
Save length of the superposed field maps.
- Parameters:
line (
DatLine)cavities_settings (
Collection[CavitySettings])is_accelerating (
bool)dat_idx (
int)idx_in_lattice (
int)lattice (
int)section (
int)field_maps (
Collection[FieldMap])
- Return type:
None
- classmethod from_field_maps(field_maps_n_superpose, dat_idx, total_length_m, z_0s)[source]
Instantiate object from several field maps.
This is the only way this object should be instantiated; called by
SuperposeMap.- Parameters:
field_maps_n_superpose (
Sequence[Instruction])dat_idx (
int)total_length_m (
float)z_0s (
Collection[float])
- Return type:
Self
- classmethod from_args(dat_idx, total_length_m, original_line, *args, **kwargs)[source]
Insantiate object from his properties.
- 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:
- _abc_impl = <_abc._abc_data object at 0x7318fb9610c0>
- class SuperposedPlaceHolderElt(line, idx_in_lattice, lattice, dat_idx=None, **kwargs)[source]
Bases:
DummyElementInserted in place of field maps and superpose map commands.
- increment_lattice_idx = False
- __init__(line, idx_in_lattice, lattice, dat_idx=None, **kwargs)[source]
Instantiate object, with lattice information.
- _abc_impl = <_abc._abc_data object at 0x7318fb34d7c0>
- class SuperposedPlaceHolderCmd(line, dat_idx=None, **kwargs)[source]
Bases:
DummyCommandInserted in place of field maps and superpose map commands.
- _abc_impl = <_abc._abc_data object at 0x7318fb36f8c0>
- unpack_superposed(packed)[source]
Extract the
FieldMapfromSuperposedFieldMap.- Parameters:
packed (
Collection[FieldMap|SuperposedFieldMap])- Return type: