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
1215f1f1
Commit
1215f1f1
authored
Nov 12, 2018
by
Thomas Vincent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add save of background mode
parent
70f88904
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
xsocs/process/fit/fitresults.py
xsocs/process/fit/fitresults.py
+10
-5
xsocs/process/fit/peak_fit.py
xsocs/process/fit/peak_fit.py
+6
-3
No files found.
xsocs/process/fit/fitresults.py
View file @
1215f1f1
...
...
@@ -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
:
...
...
xsocs/process/fit/peak_fit.py
View file @
1215f1f1
...
...
@@ -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
...
...
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