Skip to content

Commit

Permalink
Update to newest NXmpes_arpes data format
Browse files Browse the repository at this point in the history
  • Loading branch information
rettigl committed Jul 17, 2024
1 parent 6e967fc commit 73dbd0f
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 73dbd0f

Please sign in to comment.