Commit a93fd09a authored by Thomas Vincent's avatar Thomas Vincent

Remove linear background

parent f49d3238
......@@ -135,12 +135,10 @@ class FitWidget(Qt.QWidget):
"Select background subtraction mode:<br><br>"
"<b>-</b>: No background<br>"
"<b>Constant</b>: Shift data so that min is 0<br>"
"<b>Linear</b>: Linear background from first to last data<br>"
"<b>Snip</b>: Snip background estimation"
"(Statistics-sensitive Non-linear Iterative Peak-clipping algorithm)")
self.__bgComboBox.addItem('-', BackgroundTypes.NONE)
self.__bgComboBox.addItem('Constant', BackgroundTypes.CONSTANT)
self.__bgComboBox.addItem('Linear', BackgroundTypes.LINEAR)
self.__bgComboBox.addItem('Snip', BackgroundTypes.SNIP)
self.__bgComboBox.setCurrentIndex(0)
layout.addRow('Background:', self.__bgComboBox)
......
......@@ -43,14 +43,12 @@ class BackgroundTypes(object):
- NONE: No background
- CONSTANT: Remove constant (= min of the data) background
- LINEAR: Remove linear background using line from first to last data
- SNIP: Statistics-sensitive Non-linear Iterative Peak-clipping algorithm
"""
NONE = "None"
CONSTANT = "Constant"
LINEAR = "Linear"
SNIP = "Snip"
ALLOWED = NONE, CONSTANT, LINEAR, SNIP
ALLOWED = NONE, CONSTANT, SNIP
class FitH5(XsocsH5Base):
......
......@@ -497,10 +497,6 @@ def background_estimation(mode, data):
# Shift data so that smallest value is 0
return numpy.ones_like(data) * numpy.nanmin(data)
elif mode == BackgroundTypes.LINEAR:
# Simple linear background
return numpy.linspace(data[0], data[-1], num=len(data), endpoint=True)
elif mode == BackgroundTypes.SNIP:
# Using snip background
return snip1d(data, snip_width=len(data))
......
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