correct_jumps

sofia_redux.scan.custom.hawc_plus.integration.hawc_integration_numba_functions.correct_jumps(frame_data, frame_valid, jump_counter, channel_indices, channel_jumps, jump_range)[source]

Correct DAC jumps in the frame data.

Frame data are corrected in-place by:

d[f, c] -= channel_jumps[c] * n_jumps_{f,c}

where d are the frame data, f is the frame, c is the channel and n_jumps are the number of jumps detected since the first valid frame or:

n_jumps_{f,c} = jump_counter[f, c] - jump_counter[f0, c]

where f0 is the first valid frame. Since the jump counter have byte values, wrap around values are considered.

Parameters:
frame_datanumpy.ndarray (float)

The frame data of shape (n_frames, all_channels). Values are updated in-place.

frame_validnumpy.ndarray (bool)

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

jump_counternumpy.ndarray (int)

The jump counter of shape (n_frames, all_channels).

channel_indicesnumpy.ndarray (int)

The channel indices for which to correct jumps of shape (n_channels,). Should map n_channels -> all_channels.

channel_jumpsnumpy.ndarray (float)

The jump values of shape (n_channels,).

jump_rangeint

The maximum jump range (bytes) to check for wrap around values.

Returns:
None