check_torchFFT.py
Check that the pytorch fft (torch.fft.rfft2, and irfft2) are working as desired.
- Dock2D.Tests.check_torchFFT.gaussian_1d(M, mean, sigma, a=1, gaussian_norm=False)
Create 1D gaussian vector
- Parameters
M – 1D array length
mean – set the mean
sigma – set the standard deviation
a – amplitude of distribution
gaussian_norm – if True 1D distrubtution sums to 1
- Returns
1D gaussian vector
- Dock2D.Tests.check_torchFFT.gaussian_2d(kernel_len=50, mean=0, sigma=5, a=1, gaussian_norm=False)
Use the outer product of two gaussian vectors to create 2D gaussian
- Parameters
kernel_len – dimension for 2D square kernel
mean – center of gaussian
sigma – spread around the center of gaussian
a – height of gaussian
gaussian_norm – individual 1d gaussians sum to 1
- Returns
2D gaussian kernel