SciTools / iris-esmf-regrid

A collection of structured and unstructured ESMF regridding schemes for Iris.
https://iris-esmf-regrid.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
19 stars 17 forks source link

Allow non-degree units #222

Closed stephenworsley closed 11 months ago

stephenworsley commented 1 year ago

📰 Custom Issue

If a coord system is not described natively in degree units it should still be possible to regrid it.

nhsavage commented 1 year ago

regidding to/from projected coordinate systems is an important use case.

vsherratt commented 1 year ago

I looked at this a bit, may do a PR if we can make some decisions...

The only actual blocker is a function esmf_regrid.schemes._cube_to_GridInfo, which has two lines that blindly convert coordinate points into degrees. The points then get converted via cartopy from the cube's CRS (or Geodetic if missing) to Geodetic. So that conversion should work for any CRS, and the rest of the code still only needs to care about lat/lon.

At the time this issue was raised I did exactly that, in a monkeypatch in some code that needs to move from agg-regrid following its deprecation. And the results were essentially identical.

First question is then: can we not assume that the cube's coordinates are already using the right units for the cube's CRS?

There is one test that fails if there is no conversion at all, which tests that a cube with degrees and a cube with radians give the same weights. But neither test cube has a CRS, so they get the default Geodetic, which doesn't use radians, so I'd argue that's just bad user input.

Second, there are a lot of variable names and documentation that refer explicitly to latitudes and longitudes, even though if this issue is addressed then they could easily not be - is that worth changing too?

github-actions[bot] commented 1 year ago

@SciTools-incubator/esmf-regrid-devs This issue is stale due to a lack of activity in the last 90 days. Remove stale label or comment, otherwise this issue will close automatically in 7 days time.

nhsavage commented 1 year ago

could we look into this a bit more at the next surgery?

github-actions[bot] commented 1 year ago

@SciTools-incubator/esmf-regrid-devs This issue is stale due to a lack of activity in the last 90 days. Remove stale label or comment, otherwise this issue will close automatically in 7 days time.

github-actions[bot] commented 1 year ago

@SciTools-incubator/esmf-regrid-devs This stale issue has been automatically closed due to no community activity

stephenworsley commented 11 months ago

Closed by #178.