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
leverage cf_xarray to get x_coords (lon) and y_coords (lat)? #364
Comments
These thoughts are not finished but I need to stop now. Coding this is not very difficult but to decide how "magical" this should behave because there will be 3 ways to determine which coords to use which is sub-optimal. a. without cf_xarray: The problem is that (a) and (b) can lead to different results depending on whether cf_xarray is imported, which is bad. In more detail:
|
My current feeling is to implement #293 first and then add an option (either
|
I like the general idea and the |
Can't help with the automatic accessor registration, but you could use custom criteria to make the existing This is unambiguous in that if multiple variables satisfy the criteria for "latitude", then |
I like this general idea a lot. I would always raise a warning in the case of potential ambiguity (this might be done by catching errors from cf_xarray or some logic in regionmask itself). This would mean that in simple cases "the magic just works" and if there are options to consider, the user is warned. To me that seems ideal. |
I finally came around to implementing this. The logic is a slightly complicated, but I think it is mostly internal and should not bother the users too much. |
And thanks for the feedback b.t.w.! |
Currently - if the coordinates are not named
"lat"
and"lon"
we need to pass them manually, e.g.:cf_xarray uses
attrs
to determine cf compliant "coordinates" - irrespective of their name. We could use this to allowby using
internally.
@jbusecke @aaronspring that may be of interest of you.
The text was updated successfully, but these errors were encountered: