Commit 7f66cd11 authored by Thomas Vincent's avatar Thomas Vincent

add read/write to hdf5 file

parent 5042c061
...@@ -181,7 +181,7 @@ class QSpaceH5(XsocsH5Base): ...@@ -181,7 +181,7 @@ class QSpaceH5(XsocsH5Base):
Non-zero value means that the pixel is masked. Non-zero value means that the pixel is masked.
:rtype: Union[numpy.ndarray, None] :rtype: Union[numpy.ndarray,None]
""" """
return self._get_array_data(self.params_path + '/image_mask') return self._get_array_data(self.params_path + '/image_mask')
...@@ -189,10 +189,18 @@ class QSpaceH5(XsocsH5Base): ...@@ -189,10 +189,18 @@ class QSpaceH5(XsocsH5Base):
def image_normalizer(self): def image_normalizer(self):
"""Returns the image normalizer used when converting to q space. """Returns the image normalizer used when converting to q space.
:rtype: Union[str, None] :rtype: Union[str,None]
""" """
return self._get_array_data(self.params_path + '/image_normalizer') return self._get_array_data(self.params_path + '/image_normalizer')
@property
def maxipix_correction(self):
"""Returns whether maxipix correction was enabled or not.
:rtype: Union[int,None]
"""
return self._get_scalar_data(self.params_path + '/maxipix_correction')
@property @property
def image_binning(self): def image_binning(self):
"""Returns the image binning used when converting to q space. """Returns the image binning used when converting to q space.
...@@ -486,6 +494,10 @@ class QSpaceH5Writer(QSpaceH5): ...@@ -486,6 +494,10 @@ class QSpaceH5Writer(QSpaceH5):
'{0}.'.format(channels_per_degree)) '{0}.'.format(channels_per_degree))
self._set_array_data(path, _np.array(channels_per_degree)) self._set_array_data(path, _np.array(channels_per_degree))
def set_maxipix_correction(self, enabled):
"""Stores whether maxipix correction was used or not
if __name__ == '__main__': :param bool enabled:
pass """
path = self.params_path + '/maxipix_correction'
self._set_scalar_data(path, int(1 if enabled else 0))
Markdown is supported
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