Skip to content

Commit b4d8468

Browse files
committed
Fix missing Spacecraft variable in xarray loading
1 parent 7ae93a1 commit b4d8468

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

viresclient/_data_handling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def as_xarray_dataset(self, reshape=False):
216216
coords={"Timestamp":
217217
self._cdftime_to_datetime(self.get_variable("Timestamp"))})
218218
# Add Spacecraft variable as Categorical to save memory
219-
if "Spacecraft" in ds:
219+
if "Spacecraft" in self.variables:
220220
ds["Spacecraft"] = (("Timestamp",), pandas.Categorical(
221221
self.get_variable("Spacecraft"), categories=ALLOWED_SPACECRFTS))
222222
datanames = set(self.variables) - {"Timestamp", "Spacecraft"}

0 commit comments

Comments
 (0)