set_weights_from_var_stats

sofia_redux.scan.integration.integration_numba_functions.set_weights_from_var_stats(channel_indices, var_sum, var_weight, base_dependents, base_dof, base_variance, base_weight)[source]

Set a number of channel data parameters from variance statistics.

Given calculated variance and variance weights, update channel the following channel data parameters to:

channel_variance = variance channel_dof = 1 - (channel_dependents / var_weight) channel_weight = channel_dof / channel_variance

Parameters:
channel_indicesnumpy.ndarray (int)

The channel indices of shape (n_channels,) that map the variance and var_weight arrays onto the base channel data indices or n_channels -> all_channels.

var_sumnumpy.ndarray (float)

The calculated variance sum (weight * variance) for the channel indices of shape (n_channels,). The sum is over all valid frames.

var_weightnumpy.ndarray (float)

The calculated variance weights for the channel indices of shape (n_channels,).

base_dependentsnumpy.ndarray (float)

The channel dependents for all channels of shape (all_channels,).

base_dofnumpy.ndarray (float)

The channel degrees-of-freedom for all channels of shape (all_channels,). Will be updated in-place.

base_variancenumpy.ndarray (float)

The channel variances for all channels of shape (all_channels,). Will be updated in-place.

base_weightnumpy.ndarray (float)

The channel weights for all channels of shape (all_channels,). Will be updated in-place.

Returns:
None