Commit 05c5ea1d authored by payno's avatar payno
Browse files

[h52nx] cast x, y, and z array to ensure they are numpy arrays

parent fe4ef661
Pipeline #30878 passed with stage
in 23 seconds
......@@ -594,6 +594,7 @@ def h5_to_nx(input_file_path: str, output_file: str, single_file:bool,
exit(0)
else:
os.remove(en_output_file)
try:
acquisition.write_as_nxtomo(output_file=en_output_file,
data_path=entry,
......@@ -958,7 +959,7 @@ class _Acquisition:
keys=self._file_keys.x_trans_keys,
info_retrieve='x translation',
expected_unit='mm')
x_tr = x_tr * metricsystem.MetricSystem.from_value(unit).value
x_tr = numpy.asarray(x_tr) * metricsystem.MetricSystem.from_value(unit).value
return x_tr, 'm'
def _get_y_translation(self, instrument_grp, n_frame) -> tuple:
......@@ -968,7 +969,7 @@ class _Acquisition:
keys=self._file_keys.y_trans_keys,
info_retrieve='y translation',
expected_unit='mm')
y_tr = y_tr * metricsystem.MetricSystem.from_value(unit).value
y_tr = numpy.asarray(y_tr) * metricsystem.MetricSystem.from_value(unit).value
return y_tr, 'm'
def _get_z_translation(self, instrument_grp, n_frame) -> tuple:
......@@ -978,7 +979,7 @@ class _Acquisition:
keys=self._file_keys.z_trans_keys,
info_retrieve='z translation',
expected_unit='mm')
z_tr = z_tr * metricsystem.MetricSystem.from_value(unit).value
z_tr = numpy.asarray(z_tr) * metricsystem.MetricSystem.from_value(unit).value
return z_tr, 'm'
def _get_expo_time(self, detector_grp, n_frame) -> tuple:
......
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