Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
workflow
ewoksapps
est
Commits
d0dd9fe9
Commit
d0dd9fe9
authored
Jul 22, 2021
by
payno
Browse files
[io][read_spectrum] add definition of default absorption and energy column names
parent
4aef19a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
est/io/utils/spec.py
View file @
d0dd9fe9
...
...
@@ -31,6 +31,9 @@ from silx.io.spech5 import SpecFile
from
est.units
import
ur
import
functools
import
numpy
import
logging
_logger
=
logging
.
getLogger
(
__name__
)
@
functools
.
lru_cache
(
maxsize
=
2
)
...
...
@@ -60,6 +63,13 @@ def read_spectrum(
spec_file
=
SpecFile
(
spec_file
)
energy
=
None
mu
=
None
if
energy_col_name
is
None
:
_logger
.
warning
(
"Spec energy column name not provided. Try 'Column 1'"
)
energy_col_name
=
"Column 1"
if
absorption_col_name
is
None
:
_logger
.
warning
(
"Spec absorption column name not provided. Try 'Column 2'"
)
absorption_col_name
=
"Column 2"
for
i_data
,
scan
in
enumerate
(
spec_file
):
# if a scan header 'title' is provided
if
scan_header_S
is
not
None
and
scan_header_S
!=
scan
.
scan_header_dict
[
"S"
]:
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment