superpose_map module
Define a command to superpose longitudinal field maps.
Note
As for now, the transverse motion in field maps is not implemented, even
with Envelope3D.
- class SuperposeMap(line: DatLine, dat_idx: int | None = None, **kwargs: str)
Bases:
CommandCommand to merge several field maps.
- Parameters:
z_0 (float) – Position at which the next field map should be inserted.
- __init__(line: DatLine, dat_idx: int | None = None, **kwargs: str) None
Save position as attribute.
- set_influenced_elements(instructions: list[Instruction], **kwargs: float) None
Determine the index of the elements concerned by
apply().It spans from the current
SUPERPOSE_MAPcommand, up to the next element that is not a field map. It allows to consider situations where we field_map is not directly after theSUPERPOSE_MAPcommand.Example
` SUPERPOSE_MAP STEERER FIELD_MAP `Warning
Only the first of the
SUPERPOSE_MAPcommand will have the entire valid range of elements.
- apply(instructions: list[Instruction], **kwargs: float) list[Instruction]
Apply the command.
Only the first
SuperposeMapof a bunch of field maps should be applied. In order to avoid messing with indexes in the.datfile, all Commands are replaced by dummy commands. All field maps are replaced by dummy elements of length 0, except the first field_map that is replaced by a SuperposedFieldMap.
- _total_length(instructions_to_merge: list[Instruction]) float
Compute length of the superposed field maps.
- _generate_new_instructions(total_length: float, instructions_to_merge: list[Instruction]) list[Instruction]
Create the instructions replacing superpose and field maps.
- _re_set_indexes(elts_after_self: Sequence[Element], number_of_superposed: int) None
Decrement lattice numbers to take merged elements into account.
- ..todo::
Not robust…
- _abc_impl = <_abc._abc_data object at 0x7f36f98594c0>
- _starting_positions(instructions_to_merge: Collection[Instruction]) list[float]
Get the starting position of every field map.