Commit 04c1da33 authored by payno's avatar payno
Browse files

[h5_t_nx] enable users to define the path for defining the pixel size

parent 8548aba9
Pipeline #30523 passed with stage
in 26 seconds
......@@ -41,6 +41,7 @@ from nxtomomill.settings import (H5_ACQ_EXPO_TIME_KEYS, H5_ROT_ANGLE_KEYS,
H5_VALID_CAMERA_NAMES, H5_X_TRANS_KEYS,
H5_Y_TRANS_KEYS, H5_Z_TRANS_KEYS,
H5_ALIGNMENT_TITLES, H5_ACQ_EXPO_TIME_KEYS,
H5_X_PIXEL_SIZE, H5_Y_PIXEL_SIZE,
H5_DARK_TITLES, H5_INIT_TITLES,
H5_PROJ_TITLES, H5_REF_TITLES)
from nxtomomill.settings import (EDF_DARK_NAMES, EDF_MOTOR_MNE, EDF_MOTOR_POS,
......@@ -66,7 +67,8 @@ H5ScanTitles = namedtuple('H5ScanTitles', ['init_titles',
'dark_titles',
'ref_titles',
'proj_titles',
'align_titles'])
'align_titles',
])
DEFAULT_SCAN_TITLES = H5ScanTitles(H5_INIT_TITLES, H5_DARK_TITLES,
H5_REF_TITLES, H5_PROJ_TITLES,
......@@ -77,16 +79,15 @@ H5FileKeys = namedtuple('H5FileKeys', ['acq_expo_time_keys',
'valid_camera_names',
'x_trans_keys',
'y_trans_keys',
'z_trans_keys'])
'z_trans_keys',
'x_pixel_size',
'y_pixel_size',
])
DEFAULT_H5_KEYS = H5FileKeys(H5_ACQ_EXPO_TIME_KEYS, H5_ROT_ANGLE_KEYS,
H5_VALID_CAMERA_NAMES, H5_X_TRANS_KEYS,
H5_Y_TRANS_KEYS, H5_Z_TRANS_KEYS)
EDFFileKeys = namedtuple('EDFFileKeys', ['motor_pos_key', 'motor_mne_key',
'rot_angle_key', 'x_trans_key',
'y_trans_key', 'z_trans_key',
'to_ignore', 'dark_names', 'ref_names'])
H5_Y_TRANS_KEYS, H5_Z_TRANS_KEYS, H5_X_PIXEL_SIZE,
H5_Y_PIXEL_SIZE)
EDFFileKeys = namedtuple('EDFFileKeys', ['motor_pos_key', 'motor_mne_key',
'rot_angle_key', 'x_trans_key',
......@@ -655,10 +656,6 @@ class _Acquisition:
_DISTANCE_PATH = 'technique/scan/sample_detector_distance'
_X_PIXEL_SIZE_PATH = 'technique/detector/pixel_size'
_Y_PIXEL_SIZE_PATH = 'technique/detector/pixel_size'
_X_MAGNIFIED_PIXEL_SIZE = ('technique/optic/sample_pixel_size',
'technique/optic/sample_pixel_size ')
# warning: we can have two cases: one with an empty space at the end or not
......@@ -1196,7 +1193,7 @@ class _Acquisition:
"""return tuple(pixel_size, unit)"""
assert axis in ('x', 'y')
self._check_has_metadata()
path = self._X_PIXEL_SIZE_PATH if axis == 'x' else self._Y_PIXEL_SIZE_PATH
path = self._file_keys.x_pixel_size if axis == 'x' else self._file_keys.y_pixel_size
if path in self._initialization_entry:
node = self.initialization_entry[path]
size_ = node[()][0]
......@@ -1242,5 +1239,3 @@ class _Acquisition:
_logger.warning('no unit found for %s, take default unit: %s'
'' % (node.name, default_unit))
return default_unit
......@@ -64,6 +64,10 @@ H5_ALIGNMENT_TITLES = ('static images', 'ascan diffrz 180 0 4 0.1')
"""if a scan starts by one of those string then is considered as
alignment scan"""
H5_X_PIXEL_SIZE = 'technique/detector/pixel_size'
H5_Y_PIXEL_SIZE = 'technique/detector/pixel_size'
### EDF settings
EDF_MOTOR_POS = 'motor_pos'
......
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