-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interpolate for multiple data variables with a single interpolate call #14
Comments
The library allows to use, for the moment, one interpolator per variable. A variable corresponds to a grid (2D, 3D or 4D) with its different axes. In the xarray terminology, it corresponds to a DataArray. Indeed, it could be useful to interpolate several variables with a single call to a function. But this has not been implemented. For that, we have to take a Dataset as arguments. Maybe we will do this in the future. For that we will have to take into account the Dataset. One way is to use xtensor. |
Is your feature request related to a problem? Please describe.
I want to interpolate for multiple variables on the same grid (My grib data holds wind speed, wind direction U, wind direction V etc). Currently, I need to make an interpolator for each variable like:
So when I want to interpolate for given lat, lon, time I have to interpolate the grid three times even though they are at the same point in the 3D grid. I think it would be more efficient to interpolate each of the three variables simultaneously.
Describe the solution you'd like
Be able to make an interpolator from an XArray dataset, rather than a DataArray.
Example:
Which will result in something like:
Describe alternatives you've considered
I tried to stack the data axis and use a 4d interpolator:
However, the variable axis is not supported (it is not np.float64)
I tried dropping the variable axis:
Which makes the interpolator, but I cant seem to interpolate it anywhere:
Or:
The text was updated successfully, but these errors were encountered: