Skip to content
GitLab
Menu
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
3909c01d
Commit
3909c01d
authored
Nov 03, 2017
by
Vincent Michel
Browse files
Make FalconX statistics more robust
parent
ee1bb688
Pipeline
#1294
passed with stages
in 1 minute and 21 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
handel/interface.py
View file @
3909c01d
...
...
@@ -7,7 +7,7 @@ from functools import reduce
import
numpy
from
.error
import
check_error
from
.error
import
check_error
,
HandelError
from
._cffi
import
handel
,
ffi
from
.stats
import
stats_from_normal_mode
from
.parser
import
parse_xia_ini_file
...
...
@@ -134,6 +134,13 @@ def stop_run(channel=None):
check_error
(
code
)
def
get_channel_realtime
(
channel
):
time
=
ffi
.
new
(
'double *'
)
code
=
handel
.
xiaGetRunData
(
channel
,
b
'realtime'
,
time
)
check_error
(
code
)
return
time
[
0
]
def
get_spectrum_length
(
channel
):
length
=
ffi
.
new
(
'unsigned long *'
)
code
=
handel
.
xiaGetRunData
(
channel
,
b
'mca_length'
,
length
)
...
...
@@ -179,7 +186,10 @@ def get_module_statistics(module):
if
get_module_type
(
module
).
startswith
(
u
'falconx'
):
for
channel
in
channels
:
if
channel
>=
0
:
get_spectrum
(
channel
)
try
:
get_spectrum
(
channel
)
except
HandelError
:
pass
# Prepare buffer
data_size
=
9
*
len
(
channels
)
master
=
next
(
c
for
c
in
channels
if
c
>=
0
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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