CustomKernel¶
- class astropy.convolution.CustomKernel(array)[source]¶
Bases:
Kernel
Create filter kernel from list or array.
- Parameters:
- array
python:list
orarray
Filter kernel array. Size must be odd.
- array
- 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
Filter kernel array.
Attributes Documentation
- array¶
Filter kernel array.