Skip to content

updated handling of evanescent wave #46

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

QizhouW
Copy link
Contributor

@QizhouW QizhouW commented May 20, 2025

When the resolution of a lens is high, 1 - wvln_mm ** 2 * (fx ** 2 + fy ** 2) < 0 happens at high spatial freqs. This causes nan values in the sqrt() operation, and then affects the fourier transform of the image.

Cast the square root content prior to complex128 to represent the evanescent modes, and avoid the nan issue.

@singer-yang
Copy link
Owner

Thank you for your PR!

Is it possible to do if... else... for this special case?

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