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
289a7ff7
Commit
289a7ff7
authored
2 years ago
by
Martin Teichmann
Browse files
Options
Downloads
Patches
Plain Diff
included Laurent's suggestions
parent
d90a7d6c
No related branches found
No related tags found
1 merge request
!228
Add documentation for hRIXS
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/toolbox_scs/detectors/hrixs.py
+11
-5
11 additions, 5 deletions
src/toolbox_scs/detectors/hrixs.py
with
11 additions
and
5 deletions
src/toolbox_scs/detectors/hrixs.py
+
11
−
5
View file @
289a7ff7
...
...
@@ -395,6 +395,10 @@ class hRIXS:
**
kwargs
):
"""
find the curvature correction coefficients
The hRIXS has some abberations which leads to the spectroscopic lines
being curved on the detector. We approximate these abberations with
a parabola for later correction.
Load a run and determine the curvature. The curvature is set in `self`,
and returned as a pair of floats.
...
...
@@ -413,7 +417,7 @@ class hRIXS:
Example
-------
h.find_curvature(155) # use run 155 to fit the curvature
h.find_curvature(155) # use run 155 to fit the curvature
"""
data
=
self
.
from_run
(
runNB
,
proposal
)
...
...
@@ -431,9 +435,9 @@ class hRIXS:
def
centroid
(
self
,
data
,
bins
=
None
):
"""
calculate a spectrum by finding the centroid of individual photons
This takes the `xarray` `data` and returns a copy of it, with
a new
d
ata
a
rray named `spectrum` added, which contains the
energy spectrum
calculated for each hRIXS image.
This takes the `xarray
.Dataset
` `data` and returns a copy of it, with
a new `xarray.D
ata
A
rray
`
named `spectrum` added, which contains the
energy spectrum
calculated for each hRIXS image.
Example
-------
...
...
@@ -481,6 +485,7 @@ class hRIXS:
Example
-------
data = h.integrate(data) # create spectrum by summing pixels
data.spectrum[0, :].plot() # plot the spectrum of the first image
"""
...
...
@@ -514,13 +519,14 @@ class hRIXS:
def
aggregate
(
self
,
ds
,
dim
=
"
trainId
"
):
"""
aggregate (i.e. mostly sum) all data within one dataset
ta
l
k all images in a dataset and aggregate them and their metadata.
tak
e
all images in a dataset and aggregate them and their metadata.
For images, spectra and normalizations that means adding them, for
others (e.g. delays) adding would not make sense, so we treat them
properly.
Example
-------
data = h.centroid(data) # create spectra from finding photons
agg = h.aggregate(data) # sum all spectra
agg.spectrum.plot() # plot the resulting spectrum
...
...
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