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

2D lat-lon coordinates calculation for CF-supported projections #628

Open
sadielbartholomew opened this issue Mar 29, 2023 · 1 comment
Open
Assignees
Labels
enhancement New feature or request

Comments

@sadielbartholomew
Copy link
Member

Add, as a new feature, functionality which creates corresponding 2D latitude and longitude coordinates (as outputs) from 1D projection coordinates and coordinate reference parameters (as inputs), considering bounds if they are relevant.

This is a useful and important feature, above all, because regridding explicitly requires knowledge/input of the 2D lat-lon coordinates when considering fields with coordinates defined by a projection, even though they are superfluous and hence optional for projection cases, so the feature would allow us to support the full set of CF-supported projections in regridding operations.

Implementation plans and notes

  • Achieve the above by making use of the pyproj library (see below) as a new dependency to cf-python, assuming it is capable of effectively and efficiently enabling us to do so (determine this first ideally, or if necessary during the process!). It will be needed to convert from 1D projection coordinates to the 2D lat-lon coordinates they correspond to for the given projection.
  • Should only need (as sufficient) to cover the projections supported by the CF Conventions (see reference below RE Appendix F).
  • Probably this will ultimately be (user-facing wise) in the form of a new function called create_2D_lats_and_lons or similar, analogous to the already-existing create_bounds method, which will be linked up to the regridding methods to ensure they utilise the created coordinates to regrid where applicable.
  • As a subsidiary issue, there is current functionality that manages as a special case of this problem the conversion from rotated poles to regular lats and lons, which we will want to subsume into this new feature to avoid duplication of effectively the same functionality for the special case. This could be done after the main work, or as part of it.

Relevant standards and libraries

@sadielbartholomew sadielbartholomew added the enhancement New feature or request label Mar 29, 2023
@sadielbartholomew sadielbartholomew self-assigned this Mar 29, 2023
@sadielbartholomew
Copy link
Member Author

(Details and plan outlined here as discussed and agreed externally with @davidhassell.)

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

No branches or pull requests

1 participant