Commit 6206430e authored by Thomas Vincent's avatar Thomas Vincent

Add normalizer to QSpace converted (not used yet)[WIP]

parent ff17e625
......@@ -98,6 +98,9 @@ class QSpaceConverter(object):
roi = property(lambda self: self.__params['roi'])
""" Selected ROI in sample coordinates : [xmin, xmax, ymin, ymax] """
normalizer = property(lambda self: self.__params['normalizer'])
""" Selected normalizer name in measurement group (str) or None """
def __init__(self,
xsocsH5_f,
qspace_dims=None,
......@@ -155,6 +158,7 @@ class QSpaceConverter(object):
''.format('\n -'.join(diff)))
self.__params = {'qspace_dims': None,
'normalizer': None,
'image_binning': None,
'sample_indices': None,
'roi': None,
......@@ -294,6 +298,21 @@ class QSpaceConverter(object):
' greater than one.')
self.__params['qspace_dims'] = qspace_dims
@normalizer.setter
def normalizer(self, normalizer):
"""Name of dataset in measurement to use for normalization"""
if normalizer is not None:
normalizer = str(normalizer)
# Check for valid input
xsocsH5 = XsocsH5.XsocsH5(self.__xsocsH5_f)
if normalizer not in xsocsH5.normalizers():
raise ValueError(
'normalizer %s is not available in measurement group' %
normalizer)
self.__params['normalizer'] = normalizer
@image_binning.setter
def image_binning(self, image_binning):
"""
......@@ -563,6 +582,7 @@ class QSpaceConverter(object):
self.__set_status(self.RUNNING)
normalizer = self.normalizer
image_binning = self.image_binning
medfilt_dims = self.medfilt_dims
qspace_dims = self.qspace_dims
......@@ -664,9 +684,10 @@ class QSpaceConverter(object):
print('\t- beam energy : {0}'.format(beam_energy))
print('\t- center chan : {0}'.format(center_chan))
print('\t- chan per deg : {0}'.format(chan_per_deg))
print('\t- img binning : {0}'.format(image_binning))
print('\t- normalizer : {0}'.format(normalizer))
print('\t- img binning : {0}'.format(image_binning))
print('\t- medfilt dims : {0}'.format(medfilt_dims))
print('\t- qspace size : {0}'.format(qspace_dims))
print('\t- qspace size : {0}'.format(qspace_dims))
# TODO : make this editable?
nx, ny, nz = qspace_dims
......
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