weighted_mean_frame_level

sofia_redux.scan.integration.integration_numba_functions.weighted_mean_frame_level(frame_data, frame_weights, frame_valid, modeling_frames, sample_flags, channel_indices, start_frame=None, stop_frame=None)[source]

Return the mean frame data values for each channel.

Parameters:
frame_datanumpy.ndarray (float)

The frame data of shape (n_frames, all_channels).

frame_weightsnumpy.ndarray (float)
frame_validnumpy.ndarray (bool)

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

modeling_framesnumpy.ndarray (bool)

A boolean mask of shape (n_frames,) where True marks a flag as a modelling frame which will not be included when determining the mean.

sample_flagsnumpy.ndarray (int)

The frame data flag mask of shape (n_frames, all_channels) where any non-zero value excludes a sample from inclusion in the mean calculation.

channel_indicesnumpy.ndarray (int)

The channel indices for which to calculate the mean of shape (n_channels,).

start_frameint, optional

The start frame from which to calculate the mean. The default is the first frame (0).

stop_frameint, optional

The stop frame (non-inclusive) at which to terminate the mean calculation. The default is the total number of frames (n_frames).

Returns:
mean_value, mean_weightnumpy.ndarray (float), numpy.ndarray (float)

The mean value and weight for each channel both of shape (n_channels,).