pyinterp.AxisInt64.find_index

pyinterp.AxisInt64.find_index#

AxisInt64.find_index(self: pyinterp.core.AxisInt64, coordinates: Annotated[numpy.typing.ArrayLike, numpy.int64], bounded: bool = False) numpy.typing.NDArray[numpy.int64]#

Find grid elements that contain or are closest to coordinate positions.

Parameters:
  • coordinates – Positions in this coordinate system.

  • bounded – False if you want to obtain the closest value to a coordinate outside the axis definition range.

Returns:

Index of the grid points containing them or -1 if the bounded parameter is set to false and if one of the searched indexes is out of the definition range of the axis, otherwise the index of the closest value of the coordinate is returned.