Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rettigl committed Feb 22, 2024
1 parent 8746c38 commit 24eaed6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pynxtools_mpes/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"ky": "1/A",
}


def recursive_parse_metadata(
node: Union[h5py.Group, h5py.Dataset],
) -> dict:
Expand Down Expand Up @@ -134,12 +135,16 @@ def h5_to_xarray(faddr: str, mode: str = "r") -> xr.DataArray:

for axis in range(len(bin_axes)):
try:
xarray[bin_names[axis]].attrs["unit"] = h5_file["axes"][f"ax{axis}"].attrs["unit"]
xarray[bin_names[axis]].attrs["unit"] = h5_file["axes"][
f"ax{axis}"
].attrs["unit"]
except (KeyError, TypeError):
xarray[bin_names[axis]].attrs["unit"] = DEFAULT_UNITS[bin_names[axis]]
xarray[bin_names[axis]].attrs["unit"] = DEFAULT_UNITS[bin_names[axis]]
try:
xarray.attrs["units"] = h5_file["binned"]["BinnedData"].attrs["units"]
xarray.attrs["long_name"] = h5_file["binned"]["BinnedData"].attrs["long_name"]
xarray.attrs["long_name"] = h5_file["binned"]["BinnedData"].attrs[
"long_name"
]
except (KeyError, TypeError):
xarray.attrs["units"] = "counts"
xarray.attrs["long_name"] = "photoelectron counts"
Expand Down

0 comments on commit 24eaed6

Please sign in to comment.