get_signal_variance

sofia_redux.scan.signal.signal_numba_functions.get_signal_variance(values, weights=None)[source]

Return the signal variance.

The signal variance is returned as:

v = sum(w * x^2) / sum(w)

where x are the signal values and w are the signal weights. If no weights are supplied, the default weight is taken to be 1 for each value.

Parameters:
valuesnumpy.ndarray (float)

The signal values of shape (n_signal,).

weightsnumpy.ndarray (float), optional

The signal weights of shape (n_signal,).

Returns:
variancefloat