Skip to content

Commit

Permalink
standardize: extend the length of the output vector to n_max
Browse files Browse the repository at this point in the history
This brings it up to the standard fitting length expected by our
phasefront error functions.
  • Loading branch information
Sagnac committed Jun 19, 2023
1 parent 1724e83 commit 3f89d92
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Zernike.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ end

function standardize(fringe::Vector)
j = fringe_to_j.(eachindex(fringe))
a = zeros(eltype(fringe), maximum(j) + 1)
n_max = get_n(maximum(j))
j_max = get_j(n_max, n_max)
a = zeros(eltype(fringe), j_max + 1)
# normalize
N = broadcast(x -> radicand(x...), get_mn.(j))
a[j.+1] = fringe ./ N
Expand Down

0 comments on commit 3f89d92

Please sign in to comment.