In [ ]:
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
%matplotlib inline
# Plot image pixels in cartesian ordering (i.e. y-positive == upwards):
plt.rcParams['image.origin'] = 'lower'
# Make plots bigger
plt.rcParams['figure.figsize'] = 6, 6
In [ ]:
import fastimgproto.gridder.conv_funcs as conv_funcs
from fastimgproto.gridder.kernel_generation import Kernel
narrow_g_sinc = conv_funcs.GaussianSinc(trunc=3.)
oversampling=1
support = 32
gs_kernel = Kernel(kernel_func=narrow_g_sinc, support=support,oversampling=oversampling)
cross_section = gs_kernel.array[gs_kernel.centre_idx]
In [ ]:
plt.plot(cross_section)
In [ ]:
shifted = np.fft.ifftshift(cross_section)
In [ ]:
shifted[0]
In [ ]:
shifted[-1], shifted[1]
In [ ]:
amp = np.abs(np.fft.fftshift(np.fft.ifft(np.fft.ifftshift(cross_section))))
fig = plt.figure()
ax = fig.gca()
# plot_section = np.log10(amp[:oversampling])
ax.plot(np.arange(len(amp))-support, amp)
ax.grid()
In [ ]:
C_grid = np.fft.fftshift(np.fft.ifft2(np.fft.ifftshift(gs_kernel.array)))
In [ ]:
plt.imshow(np.abs(C_grid))
In [ ]:
plt.plot(np.abs(C_grid)[support])