gaitmap.utils.array_handling.find_extrema_in_radius#

gaitmap.utils.array_handling.find_extrema_in_radius(data: ndarray, indices: ndarray, radius: int | tuple[int, int], extrema_type: typing_extensions.Literal[min, max] = 'min')[source]#

Return the index of the global extrema of data in the given radius around each index in indices.

Parameters:
data1D array

Data used to find the extrema

indices1D array of ints

Around each index the extremum is searched in the region defined by radius

radius

The number of samples to the left and the right that are considered for the search. If a single integer is given, the same radius is used for both sides. The final search window has the length 2 * radius + 1. If a tuple of two integers is given, the first integer is used for the left side and the second for the right side. The final search window has the length left_radius + right_radius + 1. In case the radius is 0 (or a tuple of 0, 0), the indices are returned without further processing.

extrema_type

If the minima or maxima of the data are searched.

Returns:
list_of_extrema_indices

Array of the position of each identified extremum