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

Numerical issue with obscured airy disk #14

Closed
sefffal opened this issue Mar 13, 2024 · 1 comment · Fixed by #15
Closed

Numerical issue with obscured airy disk #14

sefffal opened this issue Mar 13, 2024 · 1 comment · Fixed by #15

Comments

@sefffal
Copy link
Member

sefffal commented Mar 13, 2024

The flux exactly on-axis is incorrect:

julia> a = airydisk(
           x = 40.5, y=40.5, fwhm=10, ratio=0.2,amp=1)
#24 (generic function with 1 method)

# Slightly off axis
julia> a(40.51,40.51)
0.9999945790370132

# Exactly on axis:
julia> a(40.5,40.5)
1.0850694444444444

The flux exactly (same float, not float + eps) on axis is wrong by 8.5%.

@sefffal
Copy link
Member Author

sefffal commented Mar 13, 2024

I believe the bug is here @mileslucas:

iszero(r) && return amp / (1 - ratio^2)^2 + background

The short-circuit for if exactly on axis (r==0) doesn't account for the ratio.

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 a pull request may close this issue.

1 participant