level

sofia_redux.scan.signal.signal_numba_functions.level(values, start_frame, end_frame, resolution, weights=None, robust=False)[source]

Remove and return the average value between a start and end frame.

Parameters:
valuesnumpy.ndarray (float)

The signal values of length (n_signal,). Updated in-place.

start_frameint

The starting frame (inclusive).

end_frameint

The end frame (non-inclusive).

resolutionint

The frame resolution of the signal (number of frames per signal measurement).

weightsnumpy.ndarray (float), optional

The signal weights of shape (n_signal,).

robustbool, optional

If True, remove the median value, otherwise remove the mean.

Returns:
levelled_valuefloat

The value subtracted from values.