gordias.util.array.find_closely_matching_range#

gordias.util.array.find_closely_matching_range(a: ndarray, b: ndarray) tuple[slice, slice]#

Find ranges for two arrays where they are element-wise equal within a tolerance.

The ranges are returned as slices, one for each array. The tolerance used is the default of the numpy.isclose() function.

Parameters:
Returns:

Two slice objects, one for each input array.

Return type:

tuple[slice, slice]

Raises:

ValueError – If either of the arrays is not one dimensional, or not strictly monotonically increasing.