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
No related branches found
No related tags found
No related merge requests found
......@@ -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)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment