regular_kernel_convolve¶
- sofia_redux.scan.utilities.numba_functions.regular_kernel_convolve(data, kernel, kernel_reference_index=None, weight=None, valid=None)[source]¶
Direct convolution of ND data with a given kernel.
Fast Numba implementation of direct kernel convolution for arbitrary dimensions. The actual convolution is performed on a point-by-point basis with
point_aligned_smooth()
, while the majority of this function relates to process reducing N-dimensions to a single dimension. Note that this is not suitable for 1-dimensional convolution.- Parameters:
- datanumpy.ndarray (float)
The data to convolve.
- kernelnumpy.ndarray (float)
The kernel to convolve the data with. Should have the same dimensionality as
data
.- kernel_reference_indexnumpy.ndarray (int), optional
The index marking the center of the kernel. If not provided, defaults to ceil((kernel.shape - 1) / 2).
- weightnumpy.ndarray (float), optional
An optional weighting array.
- validnumpy.ndarray (bool), optional
An optional validating array where
False
excludes a datum from inclusion in processing. Effectively the same as setting weight[i] = 0 for index i.
- Returns:
- convolved, smoothed_weightsnumpy.ndarray (float), numpy.ndarray (float)