From 60c49d7b75898912d1c401b41ce23d40c2c35a75 Mon Sep 17 00:00:00 2001
From: Gamelin Alexis <alexis.gamelin@synchrotron-soleil.fr>
Date: Wed, 23 Mar 2022 10:45:55 +0100
Subject: [PATCH] [Fix] CavityResonator with Ncav

Changing Ncav after initialization now change the total shunt impedance Rs
---
 tracking/rf.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tracking/rf.py b/tracking/rf.py
index 08d52c6..de05d59 100644
--- a/tracking/rf.py
+++ b/tracking/rf.py
@@ -559,12 +559,11 @@ class CavityResonator():
     @Rs_per_cavity.setter
     def Rs_per_cavity(self, value):
         self._Rs_per_cavity = value
-        self._Rs = self.Rs_per_cavity * self.Ncav
 
     @property
     def Rs(self):
         """Shunt impedance [ohm]"""
-        return self._Rs
+        return self.Rs_per_cavity * self.Ncav
 
     @Rs.setter
     def Rs(self, value):
-- 
GitLab