Skip to content

Commit

Permalink
Merge pull request xraypy#533 from maurov/struct2xasV2407
Browse files Browse the repository at this point in the history
Struct2xas v2407 (before refactoring)
  • Loading branch information
newville authored Oct 25, 2024
2 parents 3e27376 + 60d6792 commit 859a19c
Show file tree
Hide file tree
Showing 2 changed files with 183 additions and 72 deletions.
4 changes: 3 additions & 1 deletion larch/io/columnfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ def write_group(filename, group, scalars=None, arrays=None,

def read_fdmnes(filename, **kwargs):
"""read [FDMNES](http://fdmnes.neel.cnrs.fr/) ascii files"""
shift_energy = kwargs.pop("shift_energy", True)
group = read_ascii(filename, **kwargs)
group.header_dict = dict(filetype='FDMNES', energy_units='eV')
for headline in group.header:
Expand All @@ -622,7 +623,8 @@ def read_fdmnes(filename, **kwargs):
vals_names = headline.split(" = ")[1].split(", ")
group.header_dict.update(dict(zip(vals_names, vals)))
group.name = f'FDMNES file {filename}'
group.energy += group.header_dict["E_edge"]
if shift_energy:
group.energy += group.header_dict["E_edge"]
#fix _arrlabel -> arrlabel
for ilab, lab in enumerate(group.array_labels):
if lab.startswith("_"):
Expand Down
Loading

0 comments on commit 859a19c

Please sign in to comment.