From b4d900f80227bc640556d7f75d2ef334cb2f091f Mon Sep 17 00:00:00 2001 From: gubaidulinvadim <gubaidulinvadim@gmail.com> Date: Tue, 30 Jul 2024 12:05:09 +0200 Subject: [PATCH] added get_chroma() method to compute chromaticity up to arbitrary order from the lattice file. --- mbtrack2/tracking/synchrotron.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mbtrack2/tracking/synchrotron.py b/mbtrack2/tracking/synchrotron.py index 15235ec..c723eea 100644 --- a/mbtrack2/tracking/synchrotron.py +++ b/mbtrack2/tracking/synchrotron.py @@ -387,6 +387,17 @@ class Synchrotron: coef_yy = np.array([det.A3 / 2, 0]) self.adts = [coef_xx, coef_yx, coef_xy, coef_yy] + def get_chroma(self, order=4, dpm=0.02, n_points=100): + import at + fit, dpa, tune = at.physics.nonlinear.chromaticity( + self.ring.optics.lattice, + method='linopt', + dpm=0.02, + n_points=100, + order=order) + chrox, chroy = fit + return chrox, chroy + def get_mcf_order(self, add=True, show_fit=False): """ Compute momentum compaction factor up to 3rd order from AT lattice. -- GitLab