Replies: 1 comment
-
Hello, Are you defining your lattice in the same script? This is a common problem of python pointers. If you do the following:
Then every element is a pointer to the same memory. So if you modify one corrector, you modify them all. The correct way to do it would be
Now, every corrector has its own memory and can be modified independently. Alternatively, you could also do
Or you could save the lattice to file, then import it. This also breaks the pointers. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to change only one of the corrector magnet's kick angle ( corrector number 13 when I use get_cells to pick the correctors) , but when I type this it changes all of the corrector magnet's kick angles. Any idea?
New_ring. = at.set_value_refpts(Ring, SR[ref_corrector_all][13], 'KickAngle', 10e-6,0, 'copy', True)
Beta Was this translation helpful? Give feedback.
All reactions