From 3a9368e2e0c0e2dfff027308d196e292ca640738 Mon Sep 17 00:00:00 2001 From: Fernando Date: Thu, 31 Mar 2022 11:41:35 -0300 Subject: [PATCH] CURRINFO.FIX: wait more time for DCCT to update in BO2SI injection efficiency calc. --- siriuspy/siriuspy/currinfo/main.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/siriuspy/siriuspy/currinfo/main.py b/siriuspy/siriuspy/currinfo/main.py index 29d32d476..fa0592987 100644 --- a/siriuspy/siriuspy/currinfo/main.py +++ b/siriuspy/siriuspy/currinfo/main.py @@ -597,15 +597,16 @@ def _callback_get_injcount(self, value, **kws): def _update_injeff(self): # Sleep some time here to ensure SI DCCT will have been updated - _time.sleep(0.11) + _time.sleep(0.21) # get booster current bo_curr = self._bo_curr3gev_pv.value # choose current PV - buffer = self._current_13c4_buffer \ - if self._dcct_mode == _Const.DCCT.DCCT13C4 \ - else self._current_14c4_buffer + if self._dcct_mode == _Const.DCCT.DCCT13C4: + buffer = self._current_13c4_buffer + else: + buffer = self._current_14c4_buffer timestamp_dq, value_dq = buffer.serie timestamp_dq = _np.asarray(timestamp_dq) value_dq = _np.asarray(value_dq) @@ -619,7 +620,7 @@ def _update_injeff(self): return # calculate efficiency - self._injcurr = value_dq[-1] - _np.min(value_dq) # mA + self._injcurr = value_dq[-1] - value_dq.min() # mA self._injeff = 100*(self._injcurr/bo_curr) * self.HARMNUM_RATIO # calculate injected charge: 1e6 * mA / Hz = nC