Skip to content

Commit

Permalink
Also adding zeta search in _search_indices_vertical_s
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvansebille committed Jan 29, 2025
1 parent c0122d2 commit 762d911
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions parcels/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,12 @@ def _search_indices_vertical_s(
else:
zi = depth_indices.argmin() - 1 if z < depth_vector[0] else 0

Check warning on line 1092 in parcels/field.py

View check run for this annotation

Codecov / codecov/patch

parcels/field.py#L1092

Added line #L1092 was not covered by tests
zeta = (z - depth_vector[zi]) / (depth_vector[zi + 1] - depth_vector[zi])
while zeta > 1:
zi += 1
zeta = (z - depth_vector[zi]) / (depth_vector[zi + 1] - depth_vector[zi])

Check warning on line 1096 in parcels/field.py

View check run for this annotation

Codecov / codecov/patch

parcels/field.py#L1096

Added line #L1096 was not covered by tests
while zeta < 0:
zi -= 1
zeta = (z - depth_vector[zi]) / (depth_vector[zi + 1] - depth_vector[zi])

Check warning on line 1099 in parcels/field.py

View check run for this annotation

Codecov / codecov/patch

parcels/field.py#L1099

Added line #L1099 was not covered by tests
return (zi, zeta)

@deprecated_made_private # TODO: Remove 6 months after v3.1.0
Expand Down

0 comments on commit 762d911

Please sign in to comment.