Commit fb626b4e authored by payno's avatar payno
Browse files

[hdf5scan] add distance property

parent f4f57ab4
......@@ -88,6 +88,8 @@ class HDF5TomoScan(TomoScanBase):
_Y_PIXEL_SIZE_PATH = 'instrument/detector/y_pixel_size'
_DISTANCE_PATH = 'instrument/detector/distance'
_SCHEME = 'silx'
_EPSILON_ROT_ANGLE = 0.02
......@@ -433,6 +435,14 @@ class HDF5TomoScan(TomoScanBase):
self._x_pixel_size, self._y_pixel_size = self._get_x_y_pixel_values()
return self._y_pixel_size
@property
def distance(self):
if self._distance is None and self.master_file and os.path.exists(self.master_file):
with h5py.File(self.master_file, 'r') as h5_file:
distance_dataset = h5_file[self._entry][self._DISTANCE_PATH]
self._distance = self._get_value(distance_dataset, default_unit='m')
return self._distance
@property
def frames(self) -> tuple:
"""return tuple of frames. Frames contains """
......
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