@@ -1242,19 +1242,13 @@ def freeze(self, lonslats=None, resolution=None, shape=None, proj_info=None,
12421242 projections and data cases not covering the north or south pole.
12431243 The possible options are:
12441244
1245- * "modify_extents": Set the X bounds to the edges of the data, but
1246- add 360 to the right-most bound. This has the effect of making
1247- the area coordinates continuous from the left side to the
1248- right side. However, this means that some coordinates will be
1249- outside the coordinate space of the projection. Although most
1250- PROJ and pyresample functionality can handle this there may be
1251- some edge cases.
1252- * "modify_crs": Change the prime meridian of the projection
1253- from 0 degrees longitude to 180 degrees longitude. This has
1254- the effect of putting the data on a continuous coordinate
1245+ * "modify_extents": Deprecated. Use "modify_crs".
1246+ * "modify_crs": Modify the projection definition to wrap longitude
1247+ values so they are between 0 and 360 degrees (PROJ ``lon_wrap=180``).
1248+ This has the effect of putting the data on a continuous coordinate
12551249 system. However, this means that comparing data resampled to
1256- this resulting area and an area not over the anti-meridian
1257- would be more difficult .
1250+ this resulting area and an area not using this longitude
1251+ wrapping may require extra care .
12581252 * "global_extents": Ignore the bounds of the data and use -180/180
12591253 degrees as the west and east bounds of the data. This will
12601254 generate a large output area, but with the benefit of keeping
@@ -1265,6 +1259,10 @@ def freeze(self, lonslats=None, resolution=None, shape=None, proj_info=None,
12651259 Shape parameters are ignored if the instance is created
12661260 with the `optimize_projection` flag set to True.
12671261 """
1262+ if antimeridian_mode == "modify_extents" :
1263+ warnings .warn ("Antimeridian mode 'modify_extents' is deprecated. Use 'modify_crs' instead." , stacklevel = 2 )
1264+ antimeridian_mode = "modify_crs"
1265+
12681266 with ignore_pyproj_proj_warnings ():
12691267 proj_dict = self ._get_proj_dict ()
12701268 projection = self ._projection
@@ -1311,7 +1309,7 @@ def _compute_bound_centers(self, proj_dict, lonslats, antimeridian_mode):
13111309 # cross anti-meridian of projection
13121310 xmin , xmax = self ._compute_new_x_corners_for_antimeridian (xarr , antimeridian_mode )
13131311 if antimeridian_mode == "modify_crs" :
1314- proj_dict .update ({"pm " : 180.0 })
1312+ proj_dict .update ({"lon_wrap " : 180 })
13151313 return proj_dict , (xmin , ymin , xmax , ymax )
13161314
13171315 @staticmethod
@@ -1334,9 +1332,6 @@ def _compute_new_x_corners_for_antimeridian(self, xarr, antimeridian_mode):
13341332 xmax = np .nanmax (wrapped_array )
13351333 if hasattr (wrapped_array , "compute" ):
13361334 xmin , xmax = da .compute (xmin , xmax )
1337- if antimeridian_mode == "modify_crs" :
1338- xmin -= 180
1339- xmax -= 180
13401335 return xmin , xmax
13411336
13421337
0 commit comments