diff --git a/tracking/element.py b/tracking/element.py index 9f18581f12ff118058a37f852ee119ba908168c9..d5eacc2af0556430b7c9f02d3e1b8e54eb066645 100644 --- a/tracking/element.py +++ b/tracking/element.py @@ -151,9 +151,7 @@ class TransverseMap(Element): self.alpha = self.ring.optics.local_alpha self.beta = self.ring.optics.local_beta self.gamma = self.ring.optics.local_gamma - self.dispersion = self.ring.optics.local_dispersion - self.phase_advance = self.ring.tune[0:2]*2*np.pi - + self.dispersion = self.ring.optics.local_dispersion if self.ring.adts is not None: self.adts_poly = [np.poly1d(self.ring.adts[0]), np.poly1d(self.ring.adts[1]), @@ -173,16 +171,20 @@ class TransverseMap(Element): """ # Compute phase advance which depends on energy via chromaticity and ADTS - 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'])) - - phase_advance_y = self.phase_advance[1]*(1+self.ring.chro[1]*bunch["delta"]+ - self.adts_poly[1](bunch['x'])+self.adts_poly[3](bunch['y'])) - + if self.ring.adts is None: + phase_advance_x = 2*np.pi * (self.ring.tune[0] + + self.ring.chro[0]*bunch["delta"]) + phase_advance_y = 2*np.pi * (self.ring.tune[1] + + self.ring.chro[1]*bunch["delta"]) else: - phase_advance_x = self.phase_advance[0]*(1+self.ring.chro[0]*bunch["delta"]) - phase_advance_y = self.phase_advance[1]*(1+self.ring.chro[1]*bunch["delta"]) + phase_advance_x = 2*np.pi * (self.ring.tune[0] + + self.ring.chro[0]*bunch["delta"] + + self.adts_poly[0](bunch['x']) + + self.adts_poly[2](bunch['y'])) + phase_advance_y = 2*np.pi * (self.ring.tune[1] + + self.ring.chro[1]*bunch["delta"] + + self.adts_poly[1](bunch['x']) + + self.adts_poly[3](bunch['y'])) # 6x6 matrix corresponding to (x, xp, delta, y, yp, delta) matrix = np.zeros((6,6,len(bunch)))