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
a8629280
Commit
a8629280
authored
3 years ago
by
Cammille Carinan
Browse files
Options
Downloads
Patches
Plain Diff
Integrate hRIXS functions to module
parent
f5ad640d
No related branches found
No related tags found
1 merge request
!170
hRIXS functions
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/toolbox_scs/detectors/__init__.py
+2
-0
2 additions, 0 deletions
src/toolbox_scs/detectors/__init__.py
src/toolbox_scs/detectors/hrixs.py
+14
-3
14 additions, 3 deletions
src/toolbox_scs/detectors/hrixs.py
with
16 additions
and
3 deletions
src/toolbox_scs/detectors/__init__.py
+
2
−
0
View file @
a8629280
...
...
@@ -5,6 +5,7 @@ from .dssc import *
from
.dssc_data
import
*
from
.dssc_misc
import
*
from
.dssc_processing
import
*
from
.hrixs
import
*
from
.pes
import
*
from
.xgm
import
*
...
...
@@ -16,6 +17,7 @@ __all__ = (
+
dssc_data
.
__all__
+
dssc_misc
.
__all__
+
dssc_processing
.
__all__
+
hrixs
.
__all__
+
pes
.
__all__
+
xgm
.
__all__
)
This diff is collapsed.
Click to expand it.
src/toolbox_scs/detectors/hrixs.py
+
14
−
3
View file @
a8629280
...
...
@@ -3,6 +3,17 @@ from scipy.optimize import curve_fit
from
scipy.signal
import
fftconvolve
__all__
=
[
'
find_curvature
'
,
'
correct_curvature
'
,
'
get_spectrum
'
,
'
energy_calibration
'
,
'
calibrate
'
,
'
gaussian_fit
'
,
'
to_fwhm
'
]
# -----------------------------------------------------------------------------
# Curvature
...
...
@@ -60,7 +71,7 @@ def correct_curvature(image, factor=None, axis=1):
return
ret
if
axis
==
1
else
ret
.
T
def
get_spectrum
(
image
,
cal_
factor
=
None
,
axis
=
0
,
def
get_spectrum
(
image
,
factor
=
None
,
axis
=
0
,
pixel_range
=
None
,
energy_range
=
None
,
):
start
,
stop
=
(
0
,
image
.
shape
[
axis
-
1
])
if
pixel_range
is
not
None
:
...
...
@@ -70,9 +81,9 @@ def get_spectrum(image, cal_factor=None, axis=0,
edge
=
image
.
sum
(
axis
=
axis
)[
start
:
stop
]
bins
=
np
.
arange
(
start
,
stop
+
1
)
centers
=
(
bins
[
1
:]
+
bins
[:
-
1
])
*
0.5
if
cal_
factor
is
not
None
:
if
factor
is
not
None
:
centers
,
edge
=
calibrate
(
centers
,
edge
,
factor
=
cal_
factor
,
factor
=
factor
,
range_
=
energy_range
)
return
centers
,
edge
...
...
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