Commit 17481245 authored by Thomas Vincent's avatar Thomas Vincent

rework fitH5: clean-up, update doc, updat writer API

parent c9323822
This diff is collapsed.
......@@ -157,28 +157,21 @@ class FitResult(object):
with FitH5Writer(fit_h5, mode=mode) as fitH5:
fitH5.create_entry(fit_name)
fitH5.create_process(fit_name, result_name)
fitH5.set_scan_x(fit_name, self.sample_x)
fitH5.set_scan_y(fit_name, self.sample_y)
q_dim0, q_dim1, q_dim2 = self.qspace_dimension_values
fitH5.set_qx(fit_name, q_dim0)
fitH5.set_qy(fit_name, q_dim1)
fitH5.set_qz(fit_name, q_dim2)
fitH5.set_sample_positions(fit_name, self.sample_x, self.sample_y)
fitH5.set_qspace_dimension_values(
fit_name, *self.qspace_dimension_values)
fitH5.set_background_mode(fit_name, self.background_mode)
fitH5.create_process(fit_name, result_name)
for array, func, axis in zip(
self._fit_results,
(fitH5.set_qx_result, fitH5.set_qy_result, fitH5.set_qz_result),
(0, 1, 2)):
for dimension, array in enumerate(self._fit_results):
for name in self.available_result_names:
results = self.get_results(axis, name, copy=False)
results = self.get_results(dimension, name, copy=False)
if name == 'Status':
fitH5.set_status(fit_name, axis, results)
fitH5.set_status(fit_name, dimension, results)
else:
func(fit_name, result_name, name, results)
fitH5.set_result(
fit_name, result_name, dimension, name, results)
class PeakFitter(object):
......
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