Commit 3f2eff8c authored by Thomas Vincent's avatar Thomas Vincent

add support of multiple energies in qspace conversion

parent 81a11a14
......@@ -682,11 +682,12 @@ class QSpaceConverter(object):
first_param = params[entries[0]]
if beam_energy is None: # Load it from first entry
beam_energy = first_param['beam_energy']
if beam_energy is None:
raise ValueError('Invalid/missing beam energy : {0}.'
''.format(beam_energy))
# Load it from entries
beam_energy = [scan_p['beam_energy'] for scan_p in params]
if None in beam_energy:
raise ValueError(
'Missing beam energy: {0}'.format(beam_energy))
if chan_per_deg is None: # Load it from first entry
chan_per_deg = first_param['chan_per_deg']
......@@ -939,7 +940,7 @@ class QSpaceConverter(object):
qspace_sum_chunks=qspace_sum_chunks,
overwrite=self.__overwrite,
shiftH5=shiftH5,
beam_energy=beam_energy,
beam_energy=self.beam_energy,
direct_beam=center_chan,
channels_per_degree=chan_per_deg,
normalizer=normalizer,
......@@ -1263,7 +1264,8 @@ def _create_result_file(h5_fn,
qspace_h5.set_qspace_dimension_values(q_dim0, q_dim1, q_dim2)
qspace_h5.set_medfilt_dims(medfilt_dims)
qspace_h5.set_sample_roi(sample_roi)
qspace_h5.set_beam_energy(beam_energy)
if beam_energy is not None:
qspace_h5.set_beam_energy(beam_energy)
qspace_h5.set_direct_beam(direct_beam)
qspace_h5.set_channels_per_degree(channels_per_degree)
qspace_h5.set_maxipix_correction(maxipix_correction)
......
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