Skip to content

Commit

Permalink
check standard name for lon/lat
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-hennen committed Sep 13, 2024
1 parent e8692f8 commit d17517a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xarray_subset_grid/grids/sgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ def compute_polygon_subset_selector(
lon: xr.DataArray | None = None
lat: xr.DataArray | None = None
for c in coords:
if 'lon' in c:
if 'lon' in c.standard_name.lower():
lon = ds[c]
elif 'lat' in c:
elif 'lat' in c.standard_name.lower():
lat = ds[c]
if lon is None or lat is None:
raise ValueError(f"Could not find lon and lat for dimension {dims}")
Expand Down

0 comments on commit d17517a

Please sign in to comment.