Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xsocs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
22
Issues
22
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kmap
xsocs
Commits
c2e49db2
Commit
c2e49db2
authored
Nov 12, 2018
by
Thomas Vincent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add snip background with a really large window
parent
b8019b2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
xsocs/gui/process/FitWidget.py
xsocs/gui/process/FitWidget.py
+4
-1
xsocs/process/fit/peak_fit.py
xsocs/process/fit/peak_fit.py
+5
-0
No files found.
xsocs/gui/process/FitWidget.py
View file @
c2e49db2
...
...
@@ -192,10 +192,13 @@ 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"
)
"<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
)
...
...
xsocs/process/fit/peak_fit.py
View file @
c2e49db2
...
...
@@ -36,6 +36,7 @@ import ctypes
import
multiprocessing
as
mp
from
threading
import
Thread
import
multiprocessing.sharedctypes
as
mp_sharedctypes
from
silx.math.fit
import
snip1d
import
numpy
as
np
...
...
@@ -73,6 +74,10 @@ def background_estimation(mode, data):
# Simple linear background
return
np
.
linspace
(
data
[
0
],
data
[
-
1
],
num
=
len
(
data
),
endpoint
=
True
)
elif
mode
==
BackgroundTypes
.
SNIP
:
# Using snip background
return
snip1d
(
data
,
snip_width
=
len
(
data
))
elif
mode
==
BackgroundTypes
.
NONE
:
return
np
.
zeros_like
(
data
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment