Skip to content

Commit

Permalink
🔨 x, y, z is ensure coords
Browse files Browse the repository at this point in the history
  • Loading branch information
arafune committed Mar 10, 2024
1 parent 803f70a commit a282b1f
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/arpes/xarray_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1314,20 +1314,11 @@ def spectrometer_settings(self) -> dict[str, Any]:

@property
def sample_pos(self) -> tuple[float, float, float]:
x, y, z = None, None, None
with contextlib.suppress(KeyError):
x = self._obj.attrs["x"]

with contextlib.suppress(KeyError):
y = self._obj.attrs["y"]

with contextlib.suppress(KeyError):
z = self._obj.attrs["z"]

def do_float(w: float | None) -> float:
return float(w) if w is not None else np.nan

return (do_float(x), do_float(y), do_float(z))
return (
float(self._obj.attrs["x"]),
float(self._obj.attrs["y"]),
float(self._obj.attrs["z"]),
)

@property
def sample_angles(
Expand Down

0 comments on commit a282b1f

Please sign in to comment.