Skip to content

Commit 9b3acb8

Browse files
Fixing a small vectorizaton bug in xgrid search
This PR fixes a bug where the `zi` and `zeta` returned by an xgrid search where always length 1 instead of the size of the particleset
1 parent 807d2ee commit 9b3acb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

parcels/xgrid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def search(self, z, y, x, ei=None):
281281
if "Z" in self.axes:
282282
zi, zeta = _search_1d_array(ds.depth.values, z)
283283
else:
284-
zi, zeta = 0, 0.0
284+
zi, zeta = np.zeros(z.shape, dtype=int), np.zeros(z.shape, dtype=float)
285285

286286
if ds.lon.ndim == 1:
287287
yi, eta = _search_1d_array(ds.lat.values, y)

0 commit comments

Comments
 (0)