support 1-dimensional coordinates in `NDPointIndex`
What is your issue?
NDPointIndex supports indexing along multiple indexed coordinates at the same time, but only for coordinates that have 2 or more dimensions (usually curvilinear grids, like the one used by the ROMS_example tutorial dataset).
This excludes indexing scattered points or trajectories.
For example, what I'd like to index is something like this:
import xarray as xr
import numpy as np
ds = xr.Dataset(
coords={
"x": ("points", np.linspace(0, 10, 20)),
"y": ("points", np.linspace(15, 8, 20)),
}
)
cc @dcherian, @benbovy, @quentinf00
Indeed NDPointIndex supports only the case where the n-dimensions of the point coordinates match the n-dimensions of the space in which they are distributed, i.e., the number of index coordinates must match the number of their dimensions.
In your example above those n-dimensions are flattened for each coordinate. This can be easily supported (NDPointIndex already does this flattening internally, we could just be bypass that) and can be automatically inferred at index creation from the input coordinate (as a fallback).