arrlp.kernel module

arrlp.kernel(ndims=2, pixel=1, *, dtype=<class 'numpy.float32'>, shape=None, cuda=False, atrou=0, window=None, sigma=None, wl=None, NA=None)[source]

This funtion creates kernels small arrays, mainly for convolutions.

Parameters:
  • ndims (int) – Number of dimensions.

  • pixel (int) – Size of pixel for each dimension.

  • dtype (np.dtype) – data type of kernel.

  • shape (tuple) – shape of kernel.

  • cuda (bool) – True to apply cuda.

  • atrou (int) – Number of trou to put for atrou algorithm, None for normal kernel.

  • window (float) – Size of window for mask kernel (diameter).

  • sigma (float) – Size of sigma for gaussian kernel.

  • wl (float) – wavelength for Airy kernel.

  • NA (float) – Numerical Aperture for Airy kernel.

Returns:

k – kernel generated.

Return type:

np.array

Raises:

SyntaxError – One keyword input must be put that defines type of kernel, if not will raise Error.

Examples

>>> from arrlp import kernel
...
>>> kernel(window=10) # Mask
>>> kernel(sigma=5) # Gaussian
>>> kernel(wl=640, NA=1.5) # Airy