Skip to content

Commit

Permalink
Merge pull request #802 from lnls-sirius/fix-bo2si-eff-calc
Browse files Browse the repository at this point in the history
Fix BO2SI InjEff calc
  • Loading branch information
fernandohds564 authored Apr 4, 2022
2 parents f9990d8 + 3a9368e commit 447ee01
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions siriuspy/siriuspy/currinfo/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 447ee01

Please sign in to comment.