File tree Expand file tree Collapse file tree 5 files changed +35
-3
lines changed
unit/analysis/cartography Expand file tree Collapse file tree 5 files changed +35
-3
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,9 @@ This document explains the changes made to Iris for this release
153153 instead of one latitude and one longitude.
154154 (:issue: `4460 `, :pull: `4470 `)
155155
156+ #. `@wjbenfold `_ stopped :meth: `iris.coord_systems.GeogCS.as_cartopy_projection `
157+ from assuming the globe to be the Earth (:issue: `4408 `, :pull: `4497 `)
158+
156159
157160💣 Incompatible Changes
158161=======================
Original file line number Diff line number Diff line change @@ -297,7 +297,10 @@ def as_cartopy_crs(self):
297297 return ccrs .Geodetic (self .as_cartopy_globe ())
298298
299299 def as_cartopy_projection (self ):
300- return ccrs .PlateCarree ()
300+ return ccrs .PlateCarree (
301+ central_longitude = self .longitude_of_prime_meridian ,
302+ globe = self .as_cartopy_globe (),
303+ )
301304
302305 def as_cartopy_globe (self ):
303306 # Explicitly set `ellipse` to None as a workaround for
Original file line number Diff line number Diff line change @@ -188,6 +188,29 @@ def test_as_cartopy_globe(self):
188188 self .assertEqual (res , expected )
189189
190190
191+ class Test_GeogCS_as_cartopy_projection (tests .IrisTest ):
192+ def test_as_cartopy_projection (self ):
193+ geogcs_args = {
194+ "semi_major_axis" : 6543210 ,
195+ "semi_minor_axis" : 6500000 ,
196+ "longitude_of_prime_meridian" : 30 ,
197+ }
198+ cs = GeogCS (** geogcs_args )
199+ res = cs .as_cartopy_projection ()
200+
201+ globe = ccrs .Globe (
202+ semimajor_axis = geogcs_args ["semi_major_axis" ],
203+ semiminor_axis = geogcs_args ["semi_minor_axis" ],
204+ ellipse = None ,
205+ )
206+ expected = ccrs .PlateCarree (
207+ globe = globe ,
208+ central_longitude = geogcs_args ["longitude_of_prime_meridian" ],
209+ )
210+
211+ self .assertEqual (res , expected )
212+
213+
191214class Test_GeogCS_as_cartopy_crs (tests .IrisTest ):
192215 def test_as_cartopy_crs (self ):
193216 cs = GeogCS (6543210 , 6500000 )
Original file line number Diff line number Diff line change @@ -211,7 +211,10 @@ def test_grid(self):
211211
212212 def test_default_projection_and_extent (self ):
213213 self .assertEqual (
214- iplt .default_projection (self .cube ), ccrs .PlateCarree ()
214+ iplt .default_projection (self .cube ),
215+ ccrs .PlateCarree (
216+ globe = self .cube .coord_system ("CoordSystem" ).as_cartopy_globe ()
217+ ),
215218 )
216219 np_testing .assert_array_almost_equal (
217220 iplt .default_projection_extent (self .cube ),
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ def setUp(self):
5252 1 ,
5353 )
5454
55- self .tcs = iris .coord_systems .GeogCS (6000000 )
55+ self .tcs = iris .coord_systems .GeogCS (6371229 )
5656
5757 def test_is_iris_coord_system (self ):
5858 res , _ = project (self .cube , self .tcs )
You can’t perform that action at this time.
0 commit comments