Skip to content

Commit

Permalink
rename realign_grid to _realign_grid. this function meant to be used …
Browse files Browse the repository at this point in the history
…internally
  • Loading branch information
michaelchin committed Oct 23, 2024
1 parent ca3ca19 commit c25ee66
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gplately/grids.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
)

Expand Down

0 comments on commit c25ee66

Please sign in to comment.