Skip to content
Snippets Groups Projects
Commit 574eff6d authored by Vadim Gubaidulin's avatar Vadim Gubaidulin
Browse files

bugfixes

parent fd592ca3
No related branches found
No related tags found
2 merge requests!280.8.0,!16Nonlinear chromaticity
...@@ -404,15 +404,15 @@ def transverse_map_sector_generator(ring, positions): ...@@ -404,15 +404,15 @@ def transverse_map_sector_generator(ring, positions):
else: else:
import at import at
def _compute_chro(ring, pos, dp=1e-4, order=4): def _compute_chro(ring, pos, dp=1e-2, order=4):
lat = deepcopy(ring.optics.lattice) lat = deepcopy(ring.optics.lattice)
lat.append(at.Marker("END")) lat.append(at.Marker("END"))
fit, dpa, tune = at.physics.nonlinear.chromaticity(lat, fit, dpa, tune = at.physics.nonlinear.chromaticity(lat,
method='linopt', method='linopt',
dpm=0.02, dpm=dp,
n_points=100, n_points=100,
order=order) order=order)
Chrox, Chroy = fit Chrox, Chroy = fit[0, 1:], fit[1, 1:]
chrox = np.interp(pos, s, Chrox) chrox = np.interp(pos, s, Chrox)
chroy = np.interp(pos, s, Chroy) chroy = np.interp(pos, s, Chroy)
......
...@@ -388,15 +388,20 @@ class Synchrotron: ...@@ -388,15 +388,20 @@ class Synchrotron:
self.adts = [coef_xx, coef_yx, coef_xy, coef_yy] self.adts = [coef_xx, coef_yx, coef_xy, coef_yy]
def get_chroma(self, order=4, dpm=0.02, n_points=100): def get_chroma(self, order=4, dpm=0.02, n_points=100):
"""
Compute and add chromaticity (linear and nonlinear) from AT lattice and update the property.
"""
import at import at
fit, dpa, tune = at.physics.nonlinear.chromaticity( fit, dpa, tune = at.physics.nonlinear.chromaticity(self.optics.lattice,
self.ring.optics.lattice, method='linopt',
method='linopt', dpm=dpm,
dpm=0.02, n_points=n_points,
n_points=100, order=order)
order=order)
chrox, chroy = fit chrox, chroy = fit
return chrox, chroy self.chro = [
elem for pair in zip(chrox[1:], chroy[1:]) for elem in pair
]
return chrox[1:], chroy[1:]
def get_mcf_order(self, add=True, show_fit=False): def get_mcf_order(self, add=True, show_fit=False):
""" """
......
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