Skip to content

Commit

Permalink
Use cld instead of ceil & division
Browse files Browse the repository at this point in the history
  • Loading branch information
Sagnac committed Jul 2, 2023
1 parent f5f6185 commit 1f6adcd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/WavefrontError.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ end

# synthesis function
function Λ(ΔW, a, v, n_max; finesse::Int)
finesse = finesse 1:100 ? finesse : ceil(Int, 100 / length(a))
finesse::Int = finesse 1:100 ? finesse : cld(100, length(a))
ρ, θ = polar(n_max, n_max; finesse)
# construct the estimated wavefront error
ΔWp = ΔW.(ρ', θ)
Expand Down
2 changes: 1 addition & 1 deletion src/Zernike.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function polar(m::Int, n::Int; finesse::Int = 100)
end

# radial order
get_n(j::Int)::Int = ceil((-3 + (9 + 8j)) / 2)
get_n(j::Int)::Int = cld(-3 + (9 + 8j), 2)
# azimuthal frequency
get_m(j::Int, n::Int) = 2j - (n + 2)n
# ISO / ANSI / OSA standard single mode-ordering index
Expand Down

0 comments on commit 1f6adcd

Please sign in to comment.