-
Notifications
You must be signed in to change notification settings - Fork 416
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
xarray quantify accessor doesn't return a Quantity for a coordinate variable #3260
Comments
This is an unfortunate corner case in the xarray units handling, as Are we okay with MetPy's current behavior in this case, or should we include some kind of workaround that dissociates the data variable from the coordinate index? |
I think it's essential from a user point of view to handle or the coordinate data … my use case was, for instance, running it through the ECAPE calculation, which requires height. If I were a student and it failed like this, there'd be no way to even know what went wrong. |
It was my understanding that with the index refactor in xarray that we should be able to make this happen now? I haven't tried recently, but I think something basic would work? Stretch goal with adding such an index inside MetPy would be that it would obviate the need for our own |
I unfortunately don't think things are quite ready yet for what we would need (getting very close though): |
What went wrong?
I read an xarray dataset, with units correctly attached. The metpy quantify accessor stripped units but did not return a Pint quantity. An extract of sample data, which is derived from a DOE ASR interpolated radiosonde dataset, is attached.
xarray = 2023.8.0, numpy = 1.25.2, pint = 0.22
height_test_data.nc.zip
Operating System
MacOS
Version
1.5.1
Python Version
3.10.12
Code to Reproduce
Errors, Traceback, and Logs
No response
The text was updated successfully, but these errors were encountered: