rms_channel_weights

sofia_redux.scan.integration.integration_numba_functions.rms_channel_weights(frame_data, frame_weight, valid_frames, sample_flags, channel_indices)[source]

Derive channel weights from the RMS of the frame data values.

Parameters:
frame_datanumpy.ndarray (float)

The frame data of shape (n_frames, all_channels).

frame_weightnumpy.ndarray (float)

The frame weights of shape (n_frames,).

sample_flagsnumpy.ndarray (int)

The sample flags of shape (n_frames, all_channels). Any non-zero sample flags will be excluded from the calculations.

valid_framesnumpy.ndarray (bool)

A boolean mask of shape (n_frames,) where False excludes a frame from all calculations.

channel_indicesnumpy.ndarray (int)

The channel indices for which to include in the calculations. Should be of shape (n_channels,) where n_channels < all_channels.

Returns:
variance_sum, variance_weightnumpy.ndarray, numpy.ndarray

The channel variance sum and channel variance weight sum, both of shape (n_channels,) and float type.