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

Projection lat-lon coordinates including new GridMapping objects #695

Draft
wants to merge 98 commits into
base: main
Choose a base branch
from

Conversation

sadielbartholomew
Copy link
Member

@sadielbartholomew sadielbartholomew commented Sep 20, 2023

Part 1 of 2 towards #628. This first part sets up the Grid Mapping class and helper function infrastructure towards interfacing with PROJ using pyproj, so that in the second part (nearly ready, but with some issues left to resolve) we can use those to invoke PROJ cs2cs functionality to transform from one coordinate reference system to another, else be informed that the transformation isn't valid or possible, which allows us to get the lat-lon coordinates for a given projection with corresponding CRS parameters where that makes physical sense.

CF-supported Grid Mappings have been modelled explicitly as objects in this first step in order to, for example:

  • allow us to define all supported Grid Mappings to be a paradigm for those and the CF map parameter arguments listed there;
  • validate the respective map parameters;
  • allow us to interface with them using our own cf.Units instead of having to convert to and work with PROJ formats for inputs (which are strings with a unit as a suffix e.g. "30D", "0.5R", etc.), where functions to convert to and from PROJ data and units are provided;
  • to facilitate future cf-plot work and integration into the cf-python codebase.

Diagrams of new class hierarchy

Generated from this PR branch using pyreverse -o png -p GRIDMAPPINGS-1 gridmappings.py when in the cf directory (large image so e.g. open out by 'Open image in new tab' or similar, click to zoom):

classes_GRIDMAPPINGS-1

Sadly the diagram generator doesn't seem to show abstract methods, so we don't see those. And it only show classes, so it doesn't indicate functions in the module either. But should still be useful.

I haven't done a thorough self-review yet, but we can cross-reference this with Appendix F of the Conventions doc to check everything matches up.

@davidhassell
Copy link
Collaborator

Hi Sadie - thanks for the summary - that's how I remember it, too!

@sadielbartholomew sadielbartholomew changed the title Projection lat-lon coordinates part 1: GridMapping objects Projection lat-lon coordinates including new GridMapping objects Oct 25, 2023
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

Successfully merging this pull request may close these issues.

2 participants