remove_drifts¶
- sofia_redux.scan.signal.signal_numba_functions.remove_drifts(signal_values, drifts, n_frames, resolution, integration_size, signal_weights=None, robust=False)[source]¶
Remove drifts (average signal levels in a frame block) from the signal.
Performs
level()
sequentially overn_frames
length blocks of the signal and updates the drift values accordingly.- Parameters:
- signal_valuesnumpy.ndarray (float)
The signal values of shape (n_signal,)
- driftsnumpy.ndarray (float)
The drift values. These will be updated by incrementing the given values by the average signal value removed in each drift. The number of drifts is also determined by the size of this array (n_drifts,).
- n_framesint
The number of frames in each drift.
- resolutionint
The number of frames applicable to each signal value.
- integration_sizeint
The total number of frames in the integration belonging to the signal.
- signal_weightsnumpy.ndarray (float), optional
The optional signal weights. If supplied, these will be used to determine a weighted mean/median values for each drift.
- robustbool, optional
If
True
, determine average signal values using the median value. Otherwise, uses the mean value.
- Returns:
- None