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, dat_idx=None, **kwargs)[source]

Bases: Command

Command to merge several field maps.

Parameters:
  • z_0 – Position at which the next field map should be inserted.

  • line (DatLine)

  • dat_idx (int | None, default: None)

  • kwargs (str)

is_implemented: bool = True
n_attributes: int | range | Collection = (1, 6)
__init__(line, dat_idx=None, **kwargs)[source]

Save position as attribute.

Parameters:
Return type:

None

set_influenced_elements(instructions, **kwargs)[source]

Determine the index of the elements concerned by apply().

It spans from the current SUPERPOSE_MAP command, up to the next element that is not a field map. It allows to consider situations where we field_map is not directly after the SUPERPOSE_MAP command.

Example

` SUPERPOSE_MAP STEERER FIELD_MAP `

Warning

Only the first of the SUPERPOSE_MAP command will have the entire valid range of elements.

Parameters:
Return type:

None

apply(instructions, **kwargs)[source]

Apply the command.

Only the first SuperposeMap of a bunch of field maps should be applied. In order to avoid messing with indexes in the DAT file, 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.

Parameters:
Return type:

list[Instruction]

_total_length_m(instructions_to_merge)[source]

Compute length of the superposed field maps.

Parameters:

instructions_to_merge (list[Instruction])

Return type:

float

_generate_new_instructions(total_length_m, instructions_to_merge)[source]

Create the instructions replacing superpose and field maps.

Parameters:
Return type:

list[Instruction]

_re_set_indexes(elts_after_self, number_of_superposed)[source]

Decrement lattice numbers to take merged elements into account.

..todo::

Not robust…

Parameters:
Return type:

None

_apply_set_sync_phase(instructions, instructions_to_merge)[source]

Apply the SET_SYNC_PHASE before the SUPERPOSE_MAP.

Parameters:
Return type:

list[Instruction]

_abc_impl = <_abc._abc_data object at 0x7318fb80aa00>
_starting_positions(instructions_to_merge)[source]

Get the starting position of every field map.

Parameters:

instructions_to_merge (Collection[Instruction])

Return type:

list[float]