level

sofia_redux.scan.utilities.numba_functions.level(values, start=0, end=-1, resolution=1.0)[source]

Subtract the average value from all values and return the average.

The average is calculated between the start and end indices of the supplied values. Leveling is applied inplace on the values (between start and end index), and the average value is returned to the caller.

Parameters:
valuesnumpy.ndarray (float)

The array to level

startint, optional

The start index from which to start the leveling. The default is the first index (0).

endint, optional

The index at which to stop leveling. The default is the last index (-1).

resolutionint or float, optional

The resolution of the indices. If not 1, the start and end index are modified to start // resolution, and ceil(end / resolution).

Returns:
averagefloat

The average value subtracted from all values.