Description
Passing lons and lats as DataArray with a dimension name other than site raises an error.
What I Did
----> 1 sub = subset_gridpoint(gcm, lon=stations.lon, lat=stations.lat)
/exec/dhuard/.conda/envs/portail/lib/python3.8/site-packages/clisops/core/subset.py in func_checker(*args, **kwargs)
266 kwargs[lon][kwargs[lon] < 0] -= 360
267
--> 268 return func(*args, **kwargs)
269
270 return func_checker
/exec/dhuard/.conda/envs/portail/lib/python3.8/site-packages/clisops/core/subset.py in func_checker(*args, **kwargs)
382 )
383 lon = xarray.DataArray(lon, dims=(ptdim,))
--> 384 lat = xarray.DataArray(lat, dims=(ptdim,))
385 return func(*args, lat=lat, lon=lon, **kwargs)
386
/exec/dhuard/.conda/envs/portail/lib/python3.8/site-packages/xarray/core/dataarray.py in __init__(self, data, coords, dims, name, attrs, indexes, fastpath)
404 data = _check_data_shape(data, coords, dims)
405 data = as_compatible_data(data)
--> 406 coords, dims = _infer_coords_and_dims(data.shape, coords, dims)
407 variable = Variable(dims, data, attrs, fastpath=True)
408 indexes = dict(
/exec/dhuard/.conda/envs/portail/lib/python3.8/site-packages/xarray/core/dataarray.py in _infer_coords_and_dims(shape, coords, dims)
144 for k, v in new_coords.items():
145 if any(d not in dims for d in v.dims):
--> 146 raise ValueError(
147 f"coordinate {k} has dimensions {v.dims}, but these "
148 "are not a subset of the DataArray "
ValueError: coordinate station has dimensions ('station',), but these are not a subset of the DataArray dimensions ('site',)
Description
Passing lons and lats as DataArray with a dimension name other than
siteraises an error.What I Did