Skip to content
Snippets Groups Projects
Commit e06ba684 authored by Danilo Ferreira de Lima's avatar Danilo Ferreira de Lima
Browse files

Avoid setting NDARRAY properties: they cannot be serialized in JSON.

parent 0e8aee4c
No related branches found
No related tags found
2 merge requests!59Interface CrystFEL with Karabo and allow automatic parameter tunning with rcrystfel,!53Train picker arbiter kernel
...@@ -329,8 +329,33 @@ class CrystfelRunner(PythonDevice): ...@@ -329,8 +329,33 @@ class CrystfelRunner(PythonDevice):
.initialValue([0.0, 0.0]) .initialValue([0.0, 0.0])
.commit(), .commit(),
NDARRAY_ELEMENT(expected) VECTOR_FLOAT_ELEMENT(expected)
.key("crystfelStats.cell") .key("crystfelStats.cell_a")
.readOnly()
.commit(),
VECTOR_FLOAT_ELEMENT(expected)
.key("crystfelStats.cell_b")
.readOnly()
.commit(),
VECTOR_FLOAT_ELEMENT(expected)
.key("crystfelStats.cell_c")
.readOnly()
.commit(),
VECTOR_FLOAT_ELEMENT(expected)
.key("crystfelStats.cell_alpha")
.readOnly()
.commit(),
VECTOR_FLOAT_ELEMENT(expected)
.key("crystfelStats.cell_beta")
.readOnly()
.commit(),
VECTOR_FLOAT_ELEMENT(expected)
.key("crystfelStats.cell_gamma")
.readOnly() .readOnly()
.commit(), .commit(),
) )
...@@ -806,9 +831,17 @@ class CrystfelRunner(PythonDevice): ...@@ -806,9 +831,17 @@ class CrystfelRunner(PythonDevice):
self._results['reflections'] = (sum(n_reflections) self._results['reflections'] = (sum(n_reflections)
if len(n_reflections) > 0 if len(n_reflections) > 0
else 0) else 0)
self._results['cell'] = (np.stack(cell, axis=0) cell_stacked = (np.stack(cell, axis=0)
if len(cell) > 0 if len(cell) > 0
else np.empty((0, 6), dtype=np.float32)) else list())
if len(cell_stacked) == 0:
for k in ['cell_a', 'cell_b', 'cell_c',
'cell_alpha', 'cell_beta', 'cell_gamma']:
self._results[k] = list()
else:
for i, k in enumerate(['cell_a', 'cell_b', 'cell_c',
'cell_alpha', 'cell_beta', 'cell_gamma']):
self._results[k] = cell_stacked[:, i].tolist()
self._results['all_det_centre'] = (np.stack(det_centre, axis=0) self._results['all_det_centre'] = (np.stack(det_centre, axis=0)
if len(det_centre) > 0 if len(det_centre) > 0
else np.empty((0, 2), dtype=np.float32)) else np.empty((0, 2), dtype=np.float32))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment