Speed up kernel computation
This commit is contained in:
parent
1ffb7a7ade
commit
bd2febccd3
@ -112,8 +112,9 @@ class Airy(IPSF):
|
|||||||
# Mirror the PSF to the negative x-domain
|
# Mirror the PSF to the negative x-domain
|
||||||
psf = np.concatenate((np.flip(psf), np.array([1]), psf))
|
psf = np.concatenate((np.flip(psf), np.array([1]), psf))
|
||||||
# Calculate a gaussian kernel
|
# Calculate a gaussian kernel
|
||||||
kernel = 1 / (2 * np.pi * jitter_sigma ** 2) * np.exp(
|
kernel = 1 / (2 * np.pi * jitter_sigma ** 2) * np.exp(- x ** 2 / (2 * jitter_sigma ** 2))
|
||||||
- np.concatenate((np.flip(x), np.array([0]), x)) ** 2 / (2 * jitter_sigma ** 2))
|
# Mirror the kernel to the negative x-domain
|
||||||
|
kernel = np.concatenate((np.flip(kernel), np.array([1 / (2 * np.pi * jitter_sigma ** 2)]), kernel))
|
||||||
# Normalize the kernel
|
# Normalize the kernel
|
||||||
kernel = kernel / np.sum(kernel)
|
kernel = kernel / np.sum(kernel)
|
||||||
# Convolve the PSF with gaussian kernel
|
# Convolve the PSF with gaussian kernel
|
||||||
|
Loading…
Reference in New Issue
Block a user