Return full convolution and rely on internal padding

This commit is contained in:
Lukas Klass 2020-10-01 16:39:24 +02:00
parent 54661ee478
commit 3f57539cb2
2 changed files with 2 additions and 3 deletions

View File

@ -119,7 +119,7 @@ class Airy(IPSF):
# Normalize the kernel
kernel = kernel / np.sum(kernel)
# Convolve the PSF with gaussian kernel
psf = fftconvolve(np.pad(psf, int(n_points), mode="constant", constant_values=0), kernel, mode="same")
psf = fftconvolve(psf, kernel, mode="full")
# Reduce the PSF to the positive x-domain
psf = psf[int((psf.shape[0] - 1) / 2):]
# Scale the integral of the disturbed PSF equal to the undisturbed PSF

View File

@ -176,8 +176,7 @@ class Zemax(IPSF):
# Normalize kernel
kernel = kernel / np.sum(kernel)
# Convolve PSF with gaussian kernel
psf = fftconvolve(np.pad(psf, int((jitter_grid_length - 1) / 2), mode="constant", constant_values=0),
kernel, mode="same")
psf = fftconvolve(psf, kernel, mode="full")
# Calculate new center point
center_point = [x + int((jitter_grid_length - 1) / 2) for x in center_point]
# Save the values as object attribute