Skip to content

Commit

Permalink
Merge branch 'no_time_dim' of github.com:xpublish-community/xpublish-…
Browse files Browse the repository at this point in the history
…wms into no_time_dim
  • Loading branch information
mpiannucci committed Dec 13, 2023
2 parents 611f6b5 + e4f9955 commit ca491b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion xpublish_wms/wms/get_feature_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ def get_feature_info(ds: xr.Dataset, query: dict) -> Response:
times = list(dict.fromkeys([t.replace("Z", "") for t in time_str.split("/")]))
else:
times = []
has_time_coord = ["time" in ds[parameter].cf.coordinates for parameter in parameters]
has_time_coord = [
"time" in ds[parameter].cf.coordinates for parameter in parameters
]
any_has_time_axis = True in has_time_coord

elevation_str = query.get("elevation", None)
Expand Down
2 changes: 1 addition & 1 deletion xpublish_wms/wms/get_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def select_time(self, da: xr.DataArray) -> xr.DataArray:
time_dim = da.cf.coords.get(self.TIME_CF_NAME, None)
if not time_dim or time_dim not in da.dims:
return da

if self.time is not None:
da = da.cf.sel({self.TIME_CF_NAME: self.time}, method="nearest")
elif self.TIME_CF_NAME in da.cf.coords:
Expand Down

0 comments on commit ca491b2

Please sign in to comment.