From f31737008a5cfe1838f069befe472810efdc4fa9 Mon Sep 17 00:00:00 2001
From: Gamelin Alexis <alexis.gamelin@synchrotron-soleil.fr>
Date: Mon, 11 Sep 2023 15:14:24 +0200
Subject: [PATCH] [Fix] dependancies on eta

Fix lcbi_growth_rate_mode, effective_impedance and head_tail_form_factor to be use new form of eta.
---
 mbtrack2/instability/instabilities.py | 2 +-
 mbtrack2/utilities/misc.py            | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mbtrack2/instability/instabilities.py b/mbtrack2/instability/instabilities.py
index 8e3985e..b5e6246 100644
--- a/mbtrack2/instability/instabilities.py
+++ b/mbtrack2/instability/instabilities.py
@@ -130,7 +130,7 @@ def lcbi_growth_rate_mode(ring, I, Vrf, M, mu, fr=None, RL=None, QL=None, Z=None
     """
 
     nu_s = ring.synchrotron_tune(Vrf)
-    factor = ring.eta * I / (4 * np.pi * ring.E0 * nu_s)
+    factor = ring.eta() * I / (4 * np.pi * ring.E0 * nu_s)
     
     if isinstance(fr, (float, int)):
         fr = np.array([fr])
diff --git a/mbtrack2/utilities/misc.py b/mbtrack2/utilities/misc.py
index 2a2bd27..7b06a1a 100644
--- a/mbtrack2/utilities/misc.py
+++ b/mbtrack2/utilities/misc.py
@@ -88,7 +88,7 @@ def effective_impedance(ring, imp, m, mu, sigma, M, tuneS, xi=None,
         pmin = fmin/(ring.f0 * M) + 1
         p = np.arange(pmin, pmax+1)
         fp = ring.f0*(p*M + mu + tuneXY + m*tuneS)
-        f_xi = xi/ring.eta*ring.f0
+        f_xi = xi/ring.eta()*ring.f0
         num = np.sum(imp(fp) * h(fp - f_xi))
         den = np.sum(h(fp - f_xi))
         Zeff = num/den
@@ -136,7 +136,7 @@ def head_tail_form_factor(ring, imp, m, sigma, tuneS, xi=None, mode="Hermite", m
             if xi is None:
                 xi = ring.chro[1]
         fp = ring.f0*(p*M + mu + tuneXY + m*tuneS)
-        f_xi = xi/ring.eta*ring.f0
+        f_xi = xi/ring.eta()*ring.f0
         den = np.sum(h(fp - f_xi))
     else:
         raise TypeError("Effective impedance is only defined for long, xdip"
-- 
GitLab