From 73dbd0fda7ba3e8f92acadb75c750815dad020f5 Mon Sep 17 00:00:00 2001 From: rettigl Date: Wed, 17 Jul 2024 21:00:44 +0200 Subject: [PATCH] Update to newest NXmpes_arpes data format --- arpes/endstations/plugin/nexus.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arpes/endstations/plugin/nexus.py b/arpes/endstations/plugin/nexus.py index 478522cb..3e5ea991 100644 --- a/arpes/endstations/plugin/nexus.py +++ b/arpes/endstations/plugin/nexus.py @@ -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):