Closed roman-martin closed 4 years ago
I looked a little into this and the problem seems to be the use of element
vs element_name
apply_madx_errors()
: element_name
-> element
add_offset_error_to(element)
: element
-> idx_el
However, the intermittent element
is not unique for slices and any kind of marker, so the first marker gets every offset for markers the first multipole slice gets every offset for similar multipoles, etc.
fixed by PR #37 , follow-up discussion how to handle general multiple occurrences of the same name posted as a new issue: https://github.com/SixTrack/pysixtrack/issues/52
The following example assumes #34 is fixed:
The example generates a MAD-X sequence with misaligned quadrupoles and transfers everything to pysixtrack. In the end it outputs the line (element_names and elements). MQ1 is sliced into multiple slices, MQ2 is a single multipole.
You can see that the DX and DY misalignments of the multi-slice quadrupole are assigned to the start marker and twice to the first slice while the single slice quadrupole is misaligned properly.