Convolution Filters¶
Convolution filters suitable for use in gridding and degridding.
API¶
convolution_filter(half_support, …) |
Create a 2D Convolution Filter suitable for use with gridding and degridding functions. |
-
africanus.filters.convolution_filter(half_support, oversampling_factor, filter_type, **kwargs)[source]¶ Create a 2D Convolution Filter suitable for use with gridding and degridding functions.
Parameters: - half_support : integer
Half support (N) of the filter. The filter has a full support of N*2 + 3 taps. Two of the taps exist as padding.
- oversampling_factor : integer
Number of spaces in-between grid-steps (improves gridding/degridding accuracy)
- filter_type : {‘kaiser-bessel’, ‘sinc’}
Filter type. See Convolution Filters for further information.
- beta : float, optional
Beta shape parameter for Kaiser Bessel filters.
- normalise : {True, False}
Normalise the filter by the it’s volume. Defaults to
True.
Returns: - :class:`ConvolutionFilter`
namedtuple containing filter attributes
-
africanus.filters.ConvolutionFilter= <class 'africanus.filters.conv_filters.ConvolutionFilter'>¶ collections.namedtuplecontaining attributes defining a 2D Convolution Filter. A namedtuple is used because they’re easier to use when usingnopythonmode innumba.-
africanus.filters.full_sup¶ Full support
-
africanus.filters.full_sup_wo_padding¶ Full support without padding
-
africanus.filters.half_sup¶ Half support
-
africanus.filters.oversample¶ Oversampling factor
-
africanus.filters.no_taps¶ Number of taps
-
africanus.filters.filter_taps¶ 2D filter taps with shape (v, u)
-
Kaiser Bessel¶
The Kaiser Bessel function.
kaiser_bessel(u, W, beta) |
Compute a 1D Kaiser Bessel filter as defined in Selection of a Convolution Function for Fourier Inversion Using Gridding. |
kaiser_bessel_with_sinc(u, W, oversample, beta) |
Produces a filter composed of Kaiser Bessel multiplied by a sinc. |
kaiser_bessel_fourier(x, W, beta) |
Computes the Fourier Transform of a 1D Kaiser Bessel filter. |
estimate_kaiser_bessel_beta(W) |
Estimate the kaiser bessel beta using the following heuristic: |
-
africanus.filters.kaiser_bessel_filter.kaiser_bessel(u, W, beta)[source]¶ Compute a 1D Kaiser Bessel filter as defined in Selection of a Convolution Function for Fourier Inversion Using Gridding.
Parameters: - u :
numpy.ndarray Filter positions
- W : int
Width of the filter
- beta : float, optional
Kaiser Bessel shape parameter
Returns: - :class:`numpy.ndarray`
Kaiser Bessel filter with the same shape as u
- u :
-
africanus.filters.kaiser_bessel_filter.kaiser_bessel_with_sinc(u, W, oversample, beta, normalise=True)[source]¶ Produces a filter composed of Kaiser Bessel multiplied by a sinc.
Accounts for the oversampling factor, as well as normalising the filter.
Parameters: - u :
numpy.ndarray Filter positions
- W : int
Width of the filter
- oversample : int
Oversampling factor
- beta : float
Kaiser Bessel shape parameter
- normalise : optional, {True, False}
True if the filter should be normalised
Returns: - :class:`numpy.ndarray`
Filter with the same shape as u
- u :
-
africanus.filters.kaiser_bessel_filter.kaiser_bessel_fourier(x, W, beta)[source]¶ Computes the Fourier Transform of a 1D Kaiser Bessel filter. as defined in Selection of a Convolution Function for Fourier Inversion Using Gridding.
Parameters: - x :
numpy.ndarray Filter positions
- W : int
Width of the filter.
- beta : float
Kaiser bessel shape parameter
Returns: - :class:`numpy.ndarray`
Fourier Transform of the Kaiser Bessel, with the same shape as x.
- x :
-
africanus.filters.kaiser_bessel_filter.estimate_kaiser_bessel_beta(W)[source]¶ Estimate the kaiser bessel beta using the following heuristic:
\[\beta = 2.34 \times W\]Derived from Nonuniform fast Fourier transforms using min-max interpolation.
Parameters: - W : int
Width of the filter
Returns: - float
Kaiser Bessel beta shape parameter