Skip to content

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

Closed

Description

@sadielbartholomew

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

Activity

  1. sadielbartholomew commented on Mar 29, 2023

    @sadielbartholomew
    MemberAuthor

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

  2. davidhassell commented on Oct 12, 2026

    @davidhassell
    Collaborator

    Fixed by #963, via #962

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions