Commit 3909c01d authored by Vincent Michel's avatar Vincent Michel
Browse files

Make FalconX statistics more robust

parent ee1bb688
Pipeline #1294 passed with stages
in 1 minute and 21 seconds
......@@ -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):
def get_channel_realtime(channel):
time ='double *')
code = handel.xiaGetRunData(channel, b'realtime', time)
return time[0]
def get_spectrum_length(channel):
length ='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:
except HandelError:
# Prepare buffer
data_size = 9 * len(channels)
master = next(c for c in channels if c >= 0)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment