smooth_1d¶
- sofia_redux.scan.utilities.numba_functions.smooth_1d(values, kernel)[source]¶
Apply 1-D kernel convolution in place.
Smooths an array of values using kernel convolution of the form:
s_i = sum_{j=1}^{n}(k_j * x_{i - n//2 + j}) / sum(k)
I.e. the smoothed value for point i is the convolution of the kernel with the values where the kernel is centered over point i, where the center of the kernel is defined as n // 2 (integer) and n is the size of the kernel. Therefore, smoothing with an odd sized kernel is advisable to avoid any offset in the output convolution.
Any NaN values will be ignored, resulting in zero-contribution to the smoothed values. As such, no NaN values will be present following the smooth operation.
- Parameters:
- valuesnumpy.ndarray of float
The array to convolve. Will be updated in-place.
- kernelnumpy.ndarray of float
The kernel by which to convolve.
- Returns:
- None