differentiate_weighted_signal

sofia_redux.scan.signal.signal_numba_functions.differentiate_weighted_signal(values, weights, dt=1.0)[source]

Differentiate signal values and weights in-place.

Similar to differentiate_signal() except that weightings are also accounted for. Once again, the differentiated signals and weights are stored in the input values and weights arrays (updated in-place). The differentiated values and weights are first calculated via:

dv’[i] = (v[i + 1] - v[i]) / dt dw’[i] = (w[i] * w[i + 1]) / ((w[i] + w[i + 1]) * dt^2)

All intermediate values and weights (0 < i < n-1) are then averaged by:

dv[i]/dt = (dw’[i-1]dv’[i-1] + dw’[i]dv’[i]) / (dw’[i-1] + dw’[i]) dw[i]/dt = dw’[i-1] + dw’[i]

Parameters:
valuesnumpy.ndarray (float)

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

weightsnumpy.ndarray (float)

The signal weights of shape (n_signal,). Updated in-place.

dtfloat, optional

The interval between signal samples.

Returns:
None