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
Thomas Kluyver
ToolBox
Commits
0ab7193e
Commit
0ab7193e
authored
5 years ago
by
Loïc Le Guyader
Browse files
Options
Downloads
Patches
Plain Diff
Fix the calculation of XAS spectra with bins number or bins width
parent
5ef09113
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
XAS.py
+8
-1
8 additions, 1 deletion
XAS.py
with
8 additions
and
1 deletion
XAS.py
+
8
−
1
View file @
0ab7193e
...
...
@@ -102,7 +102,8 @@ def xas(nrun, bins=None, Iokey='SCS_XGM', Itkey='MCP3apd', nrjkey='nrj', Iooffse
Inputs:
nrun: xarray of SCS data
bins: array of bin-edges or number of desired bins
bins: an array of bin-edges or an integer number of
desired bins or a float for the desired bin width.
Iokey: string for the Io fields, typically
'
SCS_XGM
'
Itkey: string for the It fields, typically
'
MCP3apd
'
NRJkey: string for the nrj fields, typically
'
nrj
'
...
...
@@ -140,6 +141,12 @@ def xas(nrun, bins=None, Iokey='SCS_XGM', Itkey='MCP3apd', nrjkey='nrj', Iooffse
num_bins
=
80
energy_limits
=
[
np
.
min
(
nrj
),
np
.
max
(
nrj
)]
bins
=
np
.
linspace
(
energy_limits
[
0
],
energy_limits
[
1
],
num_bins
+
1
)
elif
type
(
bins
)
==
int
:
energy_limits
=
[
np
.
min
(
nrj
),
np
.
max
(
nrj
)]
bins
=
np
.
linspace
(
energy_limits
[
0
],
energy_limits
[
1
],
bins
+
1
)
elif
type
(
bins
)
==
float
:
energy_limits
=
[
np
.
min
(
nrj
),
np
.
max
(
nrj
)]
bins
=
np
.
arange
(
energy_limits
[
0
],
energy_limits
[
1
],
bins
)
dummy
,
nosample
=
binning
(
rundata
[
'
nrj
'
],
rundata
,
whichIo
,
bins
)
muA
=
nosample
[
'
muA
'
]
...
...
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