Skip to content
Snippets Groups Projects
Commit 20c9a759 authored by Alexis GAMELIN's avatar Alexis GAMELIN
Browse files

[Fix] TransverseMap with chromaticity

Fix bug with chromaticity where chromaticity was taken as chromaticity * tune.
parent a2ba86e6
Branches
Tags
No related merge requests found
...@@ -151,9 +151,7 @@ class TransverseMap(Element): ...@@ -151,9 +151,7 @@ class TransverseMap(Element):
self.alpha = self.ring.optics.local_alpha self.alpha = self.ring.optics.local_alpha
self.beta = self.ring.optics.local_beta self.beta = self.ring.optics.local_beta
self.gamma = self.ring.optics.local_gamma self.gamma = self.ring.optics.local_gamma
self.dispersion = self.ring.optics.local_dispersion self.dispersion = self.ring.optics.local_dispersion
self.phase_advance = self.ring.tune[0:2]*2*np.pi
if self.ring.adts is not None: if self.ring.adts is not None:
self.adts_poly = [np.poly1d(self.ring.adts[0]), self.adts_poly = [np.poly1d(self.ring.adts[0]),
np.poly1d(self.ring.adts[1]), np.poly1d(self.ring.adts[1]),
...@@ -173,16 +171,20 @@ class TransverseMap(Element): ...@@ -173,16 +171,20 @@ class TransverseMap(Element):
""" """
# Compute phase advance which depends on energy via chromaticity and ADTS # Compute phase advance which depends on energy via chromaticity and ADTS
if self.ring.adts is not None: if self.ring.adts is None:
phase_advance_x = self.phase_advance[0]*(1+self.ring.chro[0]*bunch["delta"]+ phase_advance_x = 2*np.pi * (self.ring.tune[0] +
self.adts_poly[0](bunch['x'])+self.adts_poly[2](bunch['y'])) self.ring.chro[0]*bunch["delta"])
phase_advance_y = 2*np.pi * (self.ring.tune[1] +
phase_advance_y = self.phase_advance[1]*(1+self.ring.chro[1]*bunch["delta"]+ self.ring.chro[1]*bunch["delta"])
self.adts_poly[1](bunch['x'])+self.adts_poly[3](bunch['y']))
else: else:
phase_advance_x = self.phase_advance[0]*(1+self.ring.chro[0]*bunch["delta"]) phase_advance_x = 2*np.pi * (self.ring.tune[0] +
phase_advance_y = self.phase_advance[1]*(1+self.ring.chro[1]*bunch["delta"]) 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) # 6x6 matrix corresponding to (x, xp, delta, y, yp, delta)
matrix = np.zeros((6,6,len(bunch))) matrix = np.zeros((6,6,len(bunch)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment