Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/src/whatsnew/3.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ v3.2.1 |build_date| [unreleased]

🐛 **Bugs Fixed**

#. N/A
#. `@dennissergeev`_ changed _crs_distance_differentials() so that it uses the `Globe`
attribute from a given CRS instead of creating a new `ccrs.Globe()` object.
Iris can now handle non-Earth semi-major axes, as discussed in :issue:`4582` (:pull:`4605`).

💼 **Internal**

Expand Down Expand Up @@ -388,6 +390,7 @@ v3.2.1 |build_date| [unreleased]
.. _@aaronspring: https://github.com/aaronspring
.. _@akuhnregnier: https://github.com/akuhnregnier
.. _@bsherratt: https://github.com/bsherratt
.. _@dennissergeev: https://github.com/dennissergeev
.. _@larsbarring: https://github.com/larsbarring
.. _@pdearnshaw: https://github.com/pdearnshaw
.. _@SimonPeatman: https://github.com/SimonPeatman
Expand Down
2 changes: 1 addition & 1 deletion lib/iris/analysis/cartography.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ def _crs_distance_differentials(crs, x, y):

"""
# Make a true-latlon coordinate system for distance calculations.
crs_latlon = ccrs.Geodetic(globe=ccrs.Globe(ellipse="sphere"))
crs_latlon = ccrs.Geodetic(globe=crs.globe)
# Transform points to true-latlon (just to get the true latitudes).
_, true_lat = _transform_xy(crs, x, y, crs_latlon)
# Get coordinate differentials w.r.t. true-latlon.
Expand Down
13 changes: 13 additions & 0 deletions lib/iris/tests/unit/analysis/cartography/test_rotate_winds.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,5 +493,18 @@ def test_rotated_to_unrotated(self):
self.assertArrayAlmostEqual(res_y, y2d)


class TestNonEarthPlanet(tests.IrisTest):
def test_non_earth_semimajor_axis(self):
u, v = uv_cubes()
u.coord("grid_latitude").coord_system = iris.coord_systems.GeogCS(123)
u.coord("grid_longitude").coord_system = iris.coord_systems.GeogCS(123)
v.coord("grid_latitude").coord_system = iris.coord_systems.GeogCS(123)
v.coord("grid_longitude").coord_system = iris.coord_systems.GeogCS(123)
other_cs = iris.coord_systems.RotatedGeogCS(
0, 0, ellipsoid=iris.coord_systems.GeogCS(123)
)
rotate_winds(u, v, other_cs)


if __name__ == "__main__":
tests.main()