determine_time_weights

sofia_redux.scan.integration.integration_numba_functions.determine_time_weights(block_size, frame_data, frame_dof, frame_weight, frame_valid, frame_dependents, frame_flags, frame_weight_flag, frame_dof_flag, channel_weights, channel_indices, channel_flags, time_weight_flag, sample_flags)[source]

Determine the frame weights (noise) in time.

The frame relative weights and degrees of freedom (DOF) will be updated in- place. All frame weighting flags will be removed and should be re-evaluated after a call to this procedure. However, the frame DOF flag WILL be applied in-place.

The frame noise (time-weights) will be determined uniformly for a given chunk of frames in an integration. They will then be normalized over all frames in an integration such that:

relative_weight = frame_weight / mean(frame_weight)

Please see get_time_weights_by_block() for a description of how frame weights and degrees-of-freedom are determined.

Parameters:
block_sizeint

The number of frames to process in each chunk.

frame_datanumpy.ndarray (float)

The integration frame data values of shape (n_frames, all_channels).

frame_dofnumpy.ndarray (float)

The integration frame degrees of freedom of shape (n_frames,). Will be updated in-place.

frame_weightnumpy.ndarray (float)

The integration frame weights of shape (n_frames,). Will be updated in place.

frame_validnumpy.ndarray (bool)

A boolean mask of shape (n_frames,) where False marks an invalid frame that will not be included in any calculation.

frame_dependentsnumpy.ndarray (float)

The frame dependents of shape (n_frames,).

frame_flagsnumpy.ndarray (int)

The frame flags of shape (n_frames,).

frame_weight_flagint

The integer identifier for the FLAG_WEIGHT frame flag. All valid frames will be unflagged with this identifier.

frame_dof_flagint

The integer identifier for the FLAG_DOF frame flag. All valid frames in the chunk will either be flagged or unflagged depending on whether the degrees of freedom are > 0.

channel_weightsnumpy.ndarray (float)

The channel weights of shape (n_channels,).

channel_indicesnumpy.ndarray (int)

The channel indices mapping n_channels -> all_channels.

channel_flagsnumpy.ndarray (int)

The channel flags of shape (n_channels,).

time_weight_flagint

The integer identifier for the TIME_WEIGHTING_FLAGS flag. Note that while channel space is referred to in the original code - no such flag exists and I really really think this should be in frame space. Channels (or frames rather) flagged with this will not be included in the calculations.

sample_flagsnumpy.ndarray (int)

The sample flags of shape (n_frames, all_channels).

Returns:
None