-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Make Quantities work with scipy.interpolate #10790
Comments
From interp2d doc, As for |
Coordinates may have naturally units. Specific use case: I have a table containing a grid
and I want to interpolate the factor on places that are not in the table:
wavelength and separation are here data point coordinates, and they naturally come with a unit. |
@olebole - I think unit support is in itself entirely logical, and indeed we already support |
Now checked in a bit more detail and, as I feared, I note that |
@mhvk, whow, thank you very much for your efforts! |
If you're interested in unit-compatible interpolated splines, I made a gist of some code I use quite often. https://gist.github.com/nstarman/0628c4a1f80cea32437378f04cee957a @mhvk |
Description
Currently, one can not use
astropy.units.Quantity
as within scipysinterp1d
orinterp2d
. Ininterp1d
, the units are ignored everywhere:In
interp2d
, the unit in the z axis is just ignored, and the others axes don't accept a unit at all:Additional context
The tests were done with astropy 4.0.1.post1, scipy 1.5.2, numpy 1.19.1.
I am not sure whether this is a bug or a missing feature.
The text was updated successfully, but these errors were encountered: