CustomKernel¶
-
class
astropy.convolution.
CustomKernel
(array)[source] [edit on github]¶ Bases:
astropy.convolution.Kernel
Create filter kernel from list or array.
Parameters: - array : list or array
Filter kernel array. Size must be odd.
Raises: - TypeError
If array is not a list or array.
- KernelSizeError
If array size is even.
See also
Examples
Define one dimensional array:
>>> from astropy.convolution.kernels import CustomKernel >>> import numpy as np >>> array = np.array([1, 2, 3, 2, 1]) >>> kernel = CustomKernel(array) >>> kernel.dimension 1
Define two dimensional array:
>>> array = np.array([[1, 1, 1], [1, 2, 1], [1, 1, 1]]) >>> kernel = CustomKernel(array) >>> kernel.dimension 2
Attributes Summary
array
Filter kernel array. Attributes Documentation
-
array
¶ Filter kernel array.