Skip to content

Conversation

@QishanXie
Copy link

In the parallax.depth_section() function, it pumps up an error when I set the calculate_CTF = True.
This PR is to fix this:

def _calculate_CTF(self, alpha_shape, sampling, aberrations_mn, coefs):
xp = self._xp
# FFT coordinates
sx, sy = sampling
nx, ny = alpha_shape
qx = xp.fft.fftfreq(nx, sx).astype(xp.float32)
qy = xp.fft.fftfreq(ny, sy).astype(xp.float32)
qr2 = qx[:, None] ** 2 + qy[None, :] ** 2
alpha = xp.sqrt(qr2) * self._wavelength
theta = xp.arctan2(qy[None, :], qx[:, None])
chi = xp.zeros(alpha_shape, dtype=xp.float32)
aberrations_num = len(aberrations_mn)
for a0 in range(aberrations_num):
m, n, a = aberrations_mn[a0]
coef = coefs[a0]

In the function _calculate_CTF, the fourth parameter is to provide the aberration order, while in the parallax.depth_section(), it just adds the *self._aberrations_coeffs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants