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
Better document xarray integration #1030
Comments
Looking at what However, import xarray as xr
import metpy
da = xr.tutorial.open_dataset('air_temperature').metpy.parse_cf('air') Perhaps this needs to be documented more clearly? |
I agree with @jthielen. The reason I'm going to rename this issue and leave it open to remind us to do so. |
Okay so I guess my point of confusion stems from this:
it successfully parsed out a latitude/longitude projection, even when I stripped the attributes and it only has one variable: Actually, I don't mind not being able to parse the projection; I just like that I can locate the axis name after parsing |
Since
|
Sorry, I'm still not understanding. Where can I find the
I guess it's able to successfully parse because of the following:
Maybe break |
So it can't work with just the I'd need to dig in further to figure out if we can put |
The parsing relating to the coordinates is only dependent on the coordinates for a given variable, so yes, it can be done outside the Dataset. I think that functionality should be able to be moved from the Dataset to the DataArray accessor without too difficult of a refactor. So, would the following changes make sense to resolve this?
|
@jthielen Most of that seems good in general. I think I'd like to have accessor in the class names to make it clear what they are, so maybe For the |
Sounds good about the class names! With the second point, that's a much better idea than requiring the manual call. Since right now all the coordinate access properties/methods on the DataArray accessor go through the |
That sounds about right to me. A PR would be most welcome. |
I was wondering whether parse_cf should work for xr.DataArray? If so, I'm happy to contribute; just wanted to first know whether or not it was purposefully left out for a reason.
Currently, to get around it, I do
If I don't convert it, I get the following error
The text was updated successfully, but these errors were encountered: