Commit 1215f1f1 authored by Thomas Vincent's avatar Thomas Vincent

Add save of background mode

parent 70f88904
......@@ -55,7 +55,8 @@ class FitResult(object):
def __init__(self, entry,
q_x, q_y, q_z,
sample_x, sample_y):
sample_x, sample_y,
background_mode):
super(FitResult, self).__init__()
self._entry = entry
......@@ -67,13 +68,15 @@ class FitResult(object):
self._q_y = q_y
self._q_z = q_z
self._background_mode = background_mode
self._processes = OrderedDict()
self._n_pts = n_pts = len(sample_x)
self._n_pts = len(sample_x)
self._status = OrderedDict([('qx_status', np.zeros(n_pts)),
('qy_status', np.zeros(n_pts)),
('qz_status', np.zeros(n_pts))])
self._status = OrderedDict([('qx_status', np.zeros(self._n_pts)),
('qy_status', np.zeros(self._n_pts)),
('qz_status', np.zeros(self._n_pts))])
self._infos = OrderedDict()
......@@ -283,6 +286,8 @@ class FitResult(object):
fitH5.set_qy(entry, self.q_y)
fitH5.set_qz(entry, self.q_z)
fitH5.set_background_mode(entry, self._background_mode)
processes = self.processes()
for process in processes:
......
......@@ -56,8 +56,10 @@ class BackgroundTypes(object):
- CONSTANT: Remove constant (= min of the data) background
- LINEAR: Remove linear background using line from first to last data
"""
ALLOWED = range(3)
NONE, CONSTANT, LINEAR = ALLOWED
NONE = "None"
CONSTANT = "Constant"
LINEAR = "Linear"
ALLOWED = NONE, CONSTANT, LINEAR
class PeakFitter(Thread):
......@@ -332,7 +334,8 @@ class PeakFitter(Thread):
sample_y=y_pos,
q_x=q_x,
q_y=q_y,
q_z=q_z)
q_z=q_z,
background_mode=self.__background)
self.__results = fit_results
......
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