Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bliss
python-handel
Commits
720d6bca
Commit
720d6bca
authored
Sep 15, 2017
by
Vincent Michel
Committed by
U-ESRF\opid00
Sep 15, 2017
Browse files
Better error handling in statistics parsing
parent
b940c64f
Pipeline
#992
passed with stages
in 1 minute and 19 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
handel/interface.py
View file @
720d6bca
...
...
@@ -48,10 +48,14 @@ def stats_from_buffer(array):
# ICR/OCR computation
# It turns out the hardware only keeps the integer part of the rate
# computations. It is improved here.
icr
=
triggers
/
livetime
ocr
=
events
/
realtime
assert
int
(
icr
)
==
int
(
array
[
5
])
assert
int
(
ocr
)
==
int
(
array
[
6
])
icr
=
triggers
/
livetime
if
livetime
!=
0
else
0.
ocr
=
events
/
realtime
if
realtime
!=
0
else
0.
if
int
(
icr
)
!=
int
(
array
[
5
]):
msg
=
'ICR buffer inconsistency: int({}) != int({})'
raise
ValueError
(
msg
.
format
(
icr
,
array
[
5
]))
if
int
(
ocr
)
!=
int
(
array
[
6
]):
msg
=
'OCR buffer inconsistency: int({}) != int({})'
raise
ValueError
(
msg
.
format
(
ocr
,
array
[
6
]))
# Deadtime computation
# It's unclear whether icr=ocr=0 should result in a 0.0 or 1.0 deadtime
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment