prtools.pixel_kernel#
- pixel_kernel(shape, oversample=1, pixelscale=1.0, fftshift=False)[source]#
2D pixel MTF filter kernel
This function returns a normalized 2D sinc function sized to represent the transfer function of an idealized square pixel.
- Parameters:
shape (int or tuple of int) – Shape of the kernel
oversample (float, optional) – Oversampling factor to represent in the kernel. Default is 1.
pixelscale (scalar or tuple of scalars, optional) – Sample spacing. Providing two values defines non-symmetric sampling interpreted as
(pixelscale_row, pixelscale_col). Default is 1.fftshift (bool, optional) – If True, the kernel is FFT-shifted so that the zero-frequency (DC) term is placed at the center of the returned array. Default is False.
- Return type:
ndarray
See also
Examples
>>> pixel_mtf = prtools.pixel_kernel((256,256), 1, fftshift=True) >>> plt.imshow(pixel_mtf, cmap='gray', vmin=0)