Skip to content
Snippets Groups Projects
Commit 1a92be9d authored by Watanyu Foosang's avatar Watanyu Foosang
Browse files

Modify ADTS encapsulation from array to list

parent 6cb37ed6
No related branches found
No related tags found
No related merge requests found
......@@ -155,14 +155,10 @@ class TransverseMap(Element):
self.phase_advance = self.ring.tune[0:2]*2*np.pi
if self.ring.adts is not None:
self.adts_option = True
self.adts_poly = np.array([np.poly1d(self.ring.adts[0]),
np.poly1d(self.ring.adts[1]),
np.poly1d(self.ring.adts[2]),
np.poly1d(self.ring.adts[3])])
else:
self.adts_option = False
self.adts_poly = [np.poly1d(self.ring.adts[0]),
np.poly1d(self.ring.adts[1]),
np.poly1d(self.ring.adts[2]),
np.poly1d(self.ring.adts[3])]
@Element.parallel
def track(self, bunch):
......@@ -177,7 +173,7 @@ class TransverseMap(Element):
"""
# Compute phase advance which depends on energy via chromaticity and ADTS
if self.adts_option is True:
if self.ring.adts is not None:
phase_advance_x = self.phase_advance[0]*(1+self.ring.chro[0]*bunch["delta"]+
self.adts_poly[0](bunch['x'])+self.adts_poly[2](bunch['y']))
......
......@@ -44,8 +44,8 @@ class Synchrotron:
Horizontal and vertical (non-normalized) chromaticities.
U0 : float, optional
Energy loss per turn in [eV].
adts : array of shape (4,) or None, optional
Array that contains arrays of polynomial's coefficients, in decreasing
adts : list of arrays or None, optional
List that contains arrays of polynomial's coefficients, in decreasing
powers, used to determine Amplitude-Dependent Tune Shifts (ADTS).
The order of the elements strictly needs to be
[coef_xx, coef_yx, coef_xy, coef_yy], where x and y denote the horizontal
......
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