Skip to content

Commit

Permalink
Merge pull request #3 from FAIRmat-NFDI/mpes_arpes_definition_update
Browse files Browse the repository at this point in the history
Update to newest NXmpes_arpes data format
  • Loading branch information
rettigl authored Sep 12, 2024
2 parents 2a4d281 + 0cbfb37 commit 0b1a5a0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions arpes/endstations/plugin/nexus.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ def load_nx_data(nxdata: h5py.Group, attributes: dict) -> xr.DataArray:
# handle moving axes
new_axes = []
for axis in axes:
if f"{axis}_depends" not in nxdata.attrs:
raise KeyError(f"Dependent axis field not found for axis {axis}.")

axis_depends: str = nxdata.attrs[f"{axis}_depends"]
axis_depends_key = axis_depends.split("/", 2)[-1]
new_axes.append(nexus_translation_table[axis_depends_key])
if nexus_translation_table[axis_depends_key] in attributes:
attributes.pop(nexus_translation_table[axis_depends_key])
if f"reference" not in nxdata[axis].attrs:
raise KeyError(f"Reference attribute not found for axis {axis}.")

axis_reference: str = nxdata[axis].attrs["reference"]
axis_reference_key = axis_reference.split("/", 2)[-1]
new_axes.append(nexus_translation_table[axis_reference_key])
if nexus_translation_table[axis_reference_key] in attributes:
attributes.pop(nexus_translation_table[axis_reference_key])

coords = {}
for axis, new_axis in zip(axes, new_axes):
Expand Down

0 comments on commit 0b1a5a0

Please sign in to comment.