Commit d0dd9fe9 authored by payno's avatar payno
Browse files

[io][read_spectrum] add definition of default absorption and energy column names

parent 4aef19a5
......@@ -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"]:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment