regular_coarse_kernel_convolve

sofia_redux.scan.utilities.numba_functions.regular_coarse_kernel_convolve(data, kernel, steps, kernel_reference_index=None, weight=None, valid=None)[source]

Direct convolution of ND data with a given kernel onto a coarse grid.

This function is similar to regular_kernel_convolve() in that it results in an output that is the convolution of regular data with a regular grid, except that the output dimensions are altered. The size of the output grid is:

shape_out = ceil(data.shape / steps)

and is generally intended to speed up processing time by reducing the number of points at which a solution is required. Later, if necessary and mathematically sound, the solution can be interpolated back onto a fine grid. Only downsampling is supported using integer step values > 1.

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.

stepsnumpy.ndarray (int)

The steps for the coarse convolution.

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, weights, shapearray (float), array (float), array (int)

The convolved result and weights on a coarse grid as 1-D arrays. The arrays may be reshaped using shape which contains the shape of the coarse grids (numba can’t do arbitrary array shapes in N-D with Numba).