Skip to content
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

add DataArray.cf.get_pyproj_crs() #395

Open
larsbuntemeyer opened this issue Jan 24, 2023 · 7 comments
Open

add DataArray.cf.get_pyproj_crs() #395

larsbuntemeyer opened this issue Jan 24, 2023 · 7 comments

Comments

@larsbuntemeyer
Copy link
Contributor

larsbuntemeyer commented Jan 24, 2023

Woud be nice to have a cf function that generates CRS from grid_mappings that cartopy can understand for plotting. Would be nice to simply work without having to know which mapping is present, e.g., no need to pick the required cartopy CRS by hand.

Continue the dicussions started here:

Related issues:

@dcherian dcherian changed the title add cf.get_pyproj_crs() add DataArray.cf.get_pyproj_crs() Jan 24, 2023
@larsbuntemeyer
Copy link
Contributor Author

larsbuntemeyer commented Jan 27, 2023

For the cartopy case, this seems to have been an issue for some time now.

I am unsure, why this seems to be complicated (also it should not?)...

A possible workaround before going upstream: we could use a couple of mappings that simply map cf grid_mapping_name to the appropriate cartopy CRS (including **kwargs).

@trexfeathers
Copy link

Those of us developing Iris are equally frustrated around this topic:

Apologies for my incomplete understanding of this area, I believe the two links I have provided are relevant, although there may be others.

@larsbuntemeyer
Copy link
Contributor Author

@dcherian I have some code that i now use regularly to do transformations based on grid mappings using pyproj:

https://github.com/euro-cordex/py-cordex/blob/90e18d1bf020b3b869d9d2ffcc7039a63a92f176/cordex/transform.py#L77-L175

I also use that to compute boundaries by transforming the linear x, y boundaries according to the grid mapping info. I was wondering if that could have a place here in a kind of mapping class, e.g., as an option in _guess_bounds... also pinging @aulemahal here...

@dcherian
Copy link
Contributor

I think the transformations should be in rioxarray already?

cc @snowman2

@larsbuntemeyer
Copy link
Contributor Author

Ahh, nice! Yes, you mentioned that in the roadmap. I'll check it out.

@snowman2
Copy link
Member

@snowman2
Copy link
Member

https://corteva.github.io/rioxarray/stable/getting_started/crs_management.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants