Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
ToolBox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SCS
ToolBox
Commits
a37432e5
Commit
a37432e5
authored
2 years ago
by
Martin Teichmann
Browse files
Options
Downloads
Patches
Plain Diff
remove old code and fix get_params
parent
8dc714e1
No related branches found
No related tags found
1 merge request
!235
Resolve "two issues with hRIXS"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/toolbox_scs/detectors/hrixs.py
+1
-18
1 addition, 18 deletions
src/toolbox_scs/detectors/hrixs.py
src/toolbox_scs/test/test_hrixs.py
+6
-0
6 additions, 0 deletions
src/toolbox_scs/test/test_hrixs.py
with
7 additions
and
18 deletions
src/toolbox_scs/detectors/hrixs.py
+
1
−
18
View file @
a37432e5
...
@@ -164,13 +164,6 @@ def to_fwhm(sigma):
...
@@ -164,13 +164,6 @@ def to_fwhm(sigma):
return
abs
(
sigma
*
FWHM_COEFF
)
return
abs
(
sigma
*
FWHM_COEFF
)
# -----------------------------------------------------------------------------
# Centroid
THRESHOLD
=
510
# pixel counts above which a hit candidate is assumed
CURVE_A
=
2.19042931e-02
# curvature parameters as determined elsewhere
CURVE_B
=
-
3.02191568e-07
def
decentroid
(
res
):
def
decentroid
(
res
):
res
=
np
.
array
(
res
)
res
=
np
.
array
(
res
)
ret
=
np
.
zeros
(
shape
=
(
res
.
max
(
axis
=
0
)
+
1
).
astype
(
int
))
ret
=
np
.
zeros
(
shape
=
(
res
.
max
(
axis
=
0
)
+
1
).
astype
(
int
))
...
@@ -180,14 +173,6 @@ def decentroid(res):
...
@@ -180,14 +173,6 @@ def decentroid(res):
return
ret
return
ret
# -----------------------------------------------------------------------------
# Integral
FACTOR
=
1
RANGE
=
[
300
,
400
]
BINS
=
abs
(
np
.
subtract
(
*
RANGE
))
*
FACTOR
class
hRIXS
:
class
hRIXS
:
"""
The hRIXS analysis, especially curvature correction
"""
The hRIXS analysis, especially curvature correction
...
@@ -251,7 +236,6 @@ class hRIXS:
...
@@ -251,7 +236,6 @@ class hRIXS:
CURVE_B
=
0
CURVE_B
=
0
# integral
# integral
FACTOR
=
FACTOR
BINS
=
100
BINS
=
100
METHOD
=
'
centroid
'
# ['centroid', 'integral']
METHOD
=
'
centroid
'
# ['centroid', 'integral']
...
@@ -270,8 +254,7 @@ class hRIXS:
...
@@ -270,8 +254,7 @@ class hRIXS:
if
not
params
:
if
not
params
:
params
=
(
'
proposal
'
,
'
x_range
'
,
'
y_range
'
,
params
=
(
'
proposal
'
,
'
x_range
'
,
'
y_range
'
,
'
threshold
'
,
'
curve_a
'
,
'
curve_b
'
,
'
threshold
'
,
'
curve_a
'
,
'
curve_b
'
,
'
factor
'
,
'
range
'
,
'
bins
'
,
'
bins
'
,
'
method
'
,
'
fields
'
)
'
method
'
,
'
fields
'
)
return
{
param
:
getattr
(
self
,
param
.
upper
())
for
param
in
params
}
return
{
param
:
getattr
(
self
,
param
.
upper
())
for
param
in
params
}
def
from_run
(
self
,
runNB
,
proposal
=
None
,
extra_fields
=
()):
def
from_run
(
self
,
runNB
,
proposal
=
None
,
extra_fields
=
()):
...
...
This diff is collapsed.
Click to expand it.
src/toolbox_scs/test/test_hrixs.py
+
6
−
0
View file @
a37432e5
...
@@ -60,6 +60,12 @@ class TestHRIXS(unittest.TestCase):
...
@@ -60,6 +60,12 @@ class TestHRIXS(unittest.TestCase):
[
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
],
[
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
],
])
])
def
test_getparam
(
self
):
# this is just a smoke test
h
=
hRIXS
()
d
=
h
.
get_params
()
self
.
assertEqual
(
d
[
'
bins
'
],
100
)
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
unittest
.
main
()
unittest
.
main
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment