Skip to content

Commit

Permalink
array_find in reverse order gives wrong indices
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Dec 14, 2023
1 parent 8d9e3fb commit 5f56b2d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions openeo_processes_dask/process_implementations/arrays.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ def array_find(

idxs = (data == value).argmax(axis=axis)

if reverse:
idxs = data.size - 1 - idxs

mask = ~np.array((data == value).any(axis=axis))
if np.isnan(value):
mask = True
Expand Down

0 comments on commit 5f56b2d

Please sign in to comment.