pyinterp.Axis.find_index#

Axis.find_index(self: pyinterp.core.Axis, coordinates: numpy.ndarray[numpy.float64], bounded: bool = False) numpy.ndarray[numpy.int64]#

Given coordinate positions, find what grid elements contains them, or is closest to them.

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.