Skip to content
Open
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
20 changes: 10 additions & 10 deletions src/parcels/_core/spatialhash.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ def __init__(
# Boundaries of the hash grid are the Cartesian bounding box of the
# transformed grid, so that regional domains retain full quantization
# resolution instead of spreading it over the whole unit cube
self._xmin = x.min()
self._xmax = x.max()
self._ymin = y.min()
self._ymax = y.max()
self._zmin = z.min()
self._zmax = z.max()
self._xmin = np.nanmin(x)
self._xmax = np.nanmax(x)
self._ymin = np.nanmin(y)
self._ymax = np.nanmax(y)
self._zmin = np.nanmin(z)
self._zmax = np.nanmax(z)
_xbound = np.stack(
(
x[:-1, :-1],
Expand Down Expand Up @@ -122,10 +122,10 @@ def __init__(

else:
# Boundaries of the hash grid are the bounding box of the source grid
self._xmin = self._source_grid.lon.min()
self._xmax = self._source_grid.lon.max()
self._ymin = self._source_grid.lat.min()
self._ymax = self._source_grid.lat.max()
self._xmin = np.nanmin(self._source_grid.lon)
self._xmax = np.nanmax(self._source_grid.lon)
self._ymin = np.nanmin(self._source_grid.lat)
self._ymax = np.nanmax(self._source_grid.lat)
# setting min and max below is needed for mesh="flat"
self._zmin = 0.0
self._zmax = 0.0
Expand Down