You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Please provide a clear and concise description of what the bug is.
Pyaerocom version: 0.22.0
Computing platform: NA
Configuration file (if applicable): NA
Error message (if applicable):
Traceback (most recent call last):
File "/home/thlun8736/Documents/work/aerotools-scripts/bilinear.py", line 36, in <module>
colocated_data = pya.colocation.colocation_utils.colocate_gridded_ungridded(
File "/home/thlun8736/Documents/work/aerotools-scripts/venv/lib/python3.10/site-packages/pyaerocom/colocation/colocation_utils.py", line 818, in colocate_gridded_ungridded
grid_stat_data = data.to_time_series(longitude=ungridded_lons, latitude=ungridded_lats)
File "/home/thlun8736/Documents/work/aerotools-scripts/venv/lib/python3.10/site-packages/pyaerocom/griddeddata.py", line 1174, in to_time_series
result = self._to_time_series_xarray(scheme=scheme, add_meta=add_meta, **coords)
File "/home/thlun8736/Documents/work/aerotools-scripts/venv/lib/python3.10/site-packages/pyaerocom/griddeddata.py", line 1217, in _to_time_series_xarray
subset = extract_latlon_dataarray(
File "/home/thlun8736/Documents/work/aerotools-scripts/venv/lib/python3.10/site-packages/pyaerocom/helpers.py", line 189, in extract_latlon_dataarray
subset = arr.sel(where, method=method)
File "/home/thlun8736/Documents/work/aerotools-scripts/venv/lib/python3.10/site-packages/xarray/core/dataarray.py", line 1670, in sel
ds = self._to_temp_dataset().sel(
File "/home/thlun8736/Documents/work/aerotools-scripts/venv/lib/python3.10/site-packages/xarray/core/dataset.py", line 3184, in sel
query_results = map_index_queries(
File "/home/thlun8736/Documents/work/aerotools-scripts/venv/lib/python3.10/site-packages/xarray/core/indexing.py", line 185, in map_index_queries
grouped_indexers = group_indexers_by_index(obj, indexers, options)
File "/home/thlun8736/Documents/work/aerotools-scripts/venv/lib/python3.10/site-packages/xarray/core/indexing.py", line 144, in group_indexers_by_index
raise KeyError(f"no index found for coordinate {key!r}")
KeyError: "no index found for coordinate 'lat'"
To Reproduce
Run the following script with and without the commented line uncommented. It only fails if interpolation has been applied.
The issue was on my end. lat and lon passed to sample_coords needs to be a ascending ordered list with duplicates removed. Otherwise interpolation will turn the dimcoords int auxcoords during interpolation (since dimcoords must be monotonic)
I'll make a small PR to clarify this requirement to GriddedData.interpolate()
Describe the bug
Please provide a clear and concise description of what the bug is.
To Reproduce
Expected behavior
Both cases should work without error.
**Screenshots
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: