Skip to content

Commit 488e3fb

Browse files
committed
Bugfix unstructured grid search face index
Should return the integer, not array of integer
1 parent b6cada7 commit 488e3fb

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

parcels/application_kernels/interpolation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def UXPiecewiseConstantFace(
3232
This interpolation method is appropriate for fields that are
3333
face registered, such as u,v in FESOM.
3434
"""
35-
return field.data.values[ti, position["Z"][0], position["FACE"][0]][0]
35+
return field.data.values[ti, position["Z"][0], position["FACE"][0]]
3636

3737

3838
def UXPiecewiseLinearNode(

parcels/uxgrid.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ def try_face(fid):
9595
fi, bcoords = self.uxgrid.get_spatial_hash().query([[x, y]])
9696
if fi == -1:
9797
raise FieldOutOfBoundError(z, y, x)
98-
99-
return {"Z": (zi, zeta), "FACE": (fi, bcoords[0])}
98+
return {"Z": (zi, zeta), "FACE": (fi[0], bcoords[0])}
10099

101100
def _get_barycentric_coordinates(self, y, x, fi):
102101
"""Checks if a point is inside a given face id on a UxGrid."""

0 commit comments

Comments
 (0)