dark_correct

sofia_redux.scan.custom.hawc_plus.frames.hawc_plus_frame_numba_functions.dark_correct(data, valid_frame, channel_indices, squid_indices)[source]

Perform the dark correction.

The dark squid correction simply subtracts the squid channel frame data from all given channel frame data. I.e.:

data_out[:, channel[i]] = data_in[:, channel[i]] - data_in[:, squid[i]]
Parameters:
datanumpy.ndarray (float)

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

valid_framenumpy.ndarray (bool)

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

channel_indicesnumpy.ndarray (int)

The channel indices for which to apply the dark correction of shape (n_channels,). A value of -1 is ignored.

squid_indicesnumpy.ndarray (int)

The reference indices used to subtract the correction of shape (n_channels,). A value of -1 is ignored and not applied.

Returns:
None