Skip to content
Snippets Groups Projects
Commit e6887387 authored by GUBAIDULIN's avatar GUBAIDULIN Committed by Alexis GAMELIN
Browse files

[Fix] Loading lattices with any periodicity

parent ad4e7890
No related branches found
No related tags found
2 merge requests!13v0.7.0,!6[Fix] Loading lattices with any periodicity
......@@ -119,9 +119,10 @@ class Optics:
self.periodicity = periodicity
if self.periodicity > 1:
for i in range(self.periodicity - 1):
pos = np.append(twiss.s_pos,
twiss.s_pos + twiss.s_pos[-1] * (i+1))
periods = np.arange(0, self.periodicity)
shift = periods*twiss.s_pos[-1]
shift = np.repeat(shift, len(twiss.s_pos))
pos = np.tile(twiss.s_pos.T, self.periodicity) + shift
else:
pos = twiss.s_pos
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment