From c25ee66198a779c084e63ad01df9be0be09d07f0 Mon Sep 17 00:00:00 2001 From: michaelchin Date: Wed, 23 Oct 2024 18:29:59 +1100 Subject: [PATCH] rename realign_grid to _realign_grid. this function meant to be used internally --- gplately/grids.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gplately/grids.py b/gplately/grids.py index a6d81f1..a2ea459 100644 --- a/gplately/grids.py +++ b/gplately/grids.py @@ -128,7 +128,8 @@ def fill_raster(data, invalid=None): return data[tuple(ind)] -def realign_grid(array, lons, lats): +def _realign_grid(array, lons, lats): + """realigns grid to -180/180 and flips the array if the latitudinal coordinates are decreasing.""" mask_lons = lons > 180 # realign to -180/180 @@ -317,7 +318,7 @@ def find_label(keys, labels): if realign: # realign longitudes to -180/180 dateline - cdf_grid_z, cdf_lon, cdf_lat = realign_grid(cdf_grid, cdf_lon, cdf_lat) + cdf_grid_z, cdf_lon, cdf_lat = _realign_grid(cdf_grid, cdf_lon, cdf_lat) else: cdf_grid_z = cdf_grid @@ -1784,7 +1785,7 @@ def __init__( self._lats = np.linspace(extent[2], extent[3], self.data.shape[0]) if realign: # realign to -180,180 and flip grid - self._data, self._lons, self._lats = realign_grid( + self._data, self._lons, self._lats = _realign_grid( self._data, self._lons, self._lats )