resync_gains

sofia_redux.scan.signal.signal_numba_functions.resync_gains(frame_data, signal_values, resolution, delta_gains, channel_indices, frame_valid)[source]

Resync the frame data with the signal and gain increments.

Removes the previous gain increment correction from frame data. All frame data values are decremented by:

frame_data -= signal[frame_index//resolution] * channel_gain_delta

Parameters:
frame_datanumpy.ndarray (float)

The frame data values of shape (n_frames, all_channels). The frame data values will be updated in-place.

signal_valuesnumpy.ndarray (float)

The signal values of shape (n_signal,).

resolutionint

The signal resolution.

delta_gainsnumpy.ndarray (float)

The channel gain deltas of shape (n_channels,).

channel_indicesnumpy.ndarray (int)

An array mapping n_channels onto all channels of shape (n_channels,).

frame_validnumpy.ndarray (bool)

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

Returns:
None