Skip to content

Commit

Permalink
📄 attrs["grating"] = "HEG" is set in merlin.py not xarray_extensions.py
Browse files Browse the repository at this point in the history
  • Loading branch information
arafune committed Nov 6, 2023
1 parent 4e8bf4c commit b354281
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions arpes/endstations/plugin/merlin.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ def postprocess_final(
if angle_attr in dat.attrs:
dat.attrs[angle_attr] = np.deg2rad(float(dat.attrs[angle_attr]))

data.attrs["grating"] = "HEG"
data.attrs["alpha"] = np.pi / 2
data.attrs["psi"] = 0
for s in data.S.spectra:
Expand Down
7 changes: 2 additions & 5 deletions arpes/xarray_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def logical_offsets(self) -> MappableDict:
)

@property
def hv(self) -> float | None:
def hv(self) -> float:
assert isinstance(self._obj, xr.DataArray | xr.Dataset)
if "hv" in self._obj.coords:
value = float(self._obj.coords["hv"])
Expand All @@ -336,7 +336,7 @@ def hv(self) -> float | None:
return value
if "location" in self._obj.attrs and self._obj.attrs["location"] == "ALG-MC":
return 5.93
return None
return np.nan

def fetch_ref_attrs(self) -> dict[str, Any]:
"""Get reference attrs."""
Expand Down Expand Up @@ -1354,9 +1354,6 @@ def beamline_settings(self) -> dict[str, Any]:
settings[key] = self._obj.attrs[option]
break

if self.endstation == "BL403":
settings["grating"] = "HEG" # for now assume we always use the first order light

return settings

@property
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,9 @@ line-length = 100
name = "cz_emoji"
version = "0.0.1"
tag_format = "$version"


[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:"
]

0 comments on commit b354281

Please sign in to comment.