Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Q2d_sequence divide by zero in Image Simulation tutorial #119

Open
ammichalko opened this issue Nov 15, 2024 · 1 comment
Open

Q2d_sequence divide by zero in Image Simulation tutorial #119

ammichalko opened this issue Nov 15, 2024 · 1 comment

Comments

@ammichalko
Copy link

Running prysm 0.21.1 (pip install) in python 3.12.7

In the Image Simulation tutorial, I am getting the following warnings after "basis = list(polynomials.Q2d_sequence(nms, r_aber, t))":

RuntimeWarning: divide by zero encountered in scalar divide
Q0 = 1 / (2 * f0)
RuntimeWarning: divide by zero encountered in scalar divide
return G_q2d(n, m) / f_q2d(n, m)
RuntimeWarning: invalid value encountered in sqrt
return np.sqrt(F_q2d(n, m) - g_q2d(n-1, m) ** 2)

@brandondube
Copy link
Owner

brandondube commented Nov 15, 2024

Thanks for the report -- this one is a latent bug caused by a change to a scipy function's handling of negative numbers, which breaks Q-coma. If you substitute the Q2D sequence for Zernikes or any other basis, it will work fine

Aside, the last release was about 2 years ago 😅 there are lots of good changes on the main git branch, which are (partially) summarized on the unfinished release notes - https://github.com/brandondube/prysm/blob/master/docs/source/releases/v0.22.rst

A not-yet-in-release notes change is the renaming of all of the polynomials.xxx_sequence functions to polynomials.xxx_seq so the naming is more consistent with _seq and _der and _der_seq for polynomials themselves as well as their derivatives

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

No branches or pull requests

2 participants