get_delta_sync_parms

sofia_redux.scan.source_models.source_numba_functions.get_delta_sync_parms(channel_source_gains, channel_indices, channel_flags, channel_variance, frame_weight, frame_source_gains, frame_valid, frame_flags, source_flag, n_points)[source]

Calculate frame/channel dependent deltas following source synchronization.

Source synchronization is the process of removing the source model from the integration frame data. Following this, dependents (scaled degrees-of- freedom) need to be updated to account for the operation. The dependent increments are calculated as follows:

channel_dp = n_p * channel_gain^2 / variance
frame_dp = n_f * frame_weight * |frame_gain|

n_p = n_points / sum_{channels}(channel_gain^2/variance)
n_f = n_points / sum_{frames}(frame_weight * frame_gain)

where n_points effective number of pixels in the source model (possibly accounting for smoothing).

Parameters:
channel_source_gainsnumpy.ndarray (float)

The channel source gains of shape (all_channels,).

channel_indicesnumpy.ndarray (int)

The indices of the channels to process of shape (n_channels,).

channel_flagsnumpy.ndarray (int)

The integer flags marking various status types of shape (n_channels,). Only zero-values flags will be included in the calculation.

channel_variancenumpy.ndarray (float)

The variance associated with each channel of shape (n_channels,).

frame_weightnumpy.ndarray (float)

The relative weight of each frame of shape (n_frames,).

frame_source_gainsnumpy.ndarray (float)

The frame source gains of shape (n_frames,).

frame_validnumpy.ndarray (bool)

A boolean mask where False excludes a given frame from inclusion in the calculation and results in that same frame receiving a zero-valued dependent increment. Should be of shape (n_frames,).

frame_flagsnumpy.ndarray (int)

The integer flags marking various status types for each frame of shape (n_frames,). Any frames marked with source_flag will be excluded from all calculations and receive a zero-valued dependent increment.

source_flagint

The integer used to mark a frame with the SOURCE status.

n_pointsint or float

The effective number of points in the source model.

Returns:
frame_dp, channel_dpnumpy.ndarray, numpy.ndarray

The frame and channel dependent deltas of shape (n_frames,) and (n_channels,), both of float type.