index_of_max

sofia_redux.scan.utilities.numba_functions.index_of_max(array, valid=None, sign=1)[source]

Return the maximum value and index of that value.

Parameters:
arraynumpy.ndarray (float)

The array of data values to check.

validnumpy.ndarray (bool), optional

Optionally exclude elements by setting the corresponding element in valid to False.

signint or float, optional

If sign < 0, return the minimum value/index. If sign > 0 (default), return the maximum value/index. If sign == 0, return the maximum absolute value/index.

Returns:
value, index2-tuple (float, numpy.ndarray (int))

The max/min/max-absolute value and corresponding index.