Skip to content

Commit

Permalink
Fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
roflmaostc committed Nov 24, 2023
1 parent ef3aafe commit 71214c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions test/double_slit.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### A Pluto.jl notebook ###
# v0.19.22
# v0.19.30

using Markdown
using InteractiveUtils
Expand Down Expand Up @@ -31,8 +31,8 @@ using Plots, ImageShow
"""
function double_slit(N, d, b, offset, z, λ, L)

slit_init = (box(ComplexF32, (20, N), (20, b), offset=(11, offset + N÷2 + 1 - d ÷2 )) .+
box(ComplexF32, (20, N), (20, b), offset=(11, offset + N÷2 + 1 + d ÷2 )))
slit_init = (box(ComplexF32, (N, N), (N, b), offset=(11, offset + N÷2 + 1 - d ÷2 )) .+
box(ComplexF32, (N, N), (N, b), offset=(11, offset + N÷2 + 1 + d ÷2 )))

xpos = fftpos(L, N, NDTools.CenterFT) .- offset .* L ./ N
sinθ = sin.(atan.(xpos, z))
Expand All @@ -41,7 +41,7 @@ function double_slit(N, d, b, offset, z, λ, L)
slit_ana = cos.(π .* d_m .* sinθ ./ λ).^2 .* sinc.(b_m .* sinθ ./ λ).^2

slit_prop = (angular_spectrum(slit_init, z, λ, L)[1])
slit_prop2 = (Angular_Spectrum(slit_init, z, λ, L)[1](slit_init))
slit_prop2 = (Angular_Spectrum(slit_init, z, λ, L)[1](slit_init))[1]
@test slit_prop2 slit_prop

slit_prop = abs2.(slit_prop)
Expand Down
6 changes: 3 additions & 3 deletions test/gaussian_beam.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### A Pluto.jl notebook ###
# v0.19.22
# v0.19.30

using Markdown
using InteractiveUtils
Expand Down Expand Up @@ -46,10 +46,10 @@ function test_gauss_consistency(λ, L, N, z, z_init, w_0; do_test=true)
end

# ╔═╡ c732c1d7-6ae8-41ab-ae2e-d635fa9d66a3
res1 = test_gauss_consistency(405f-9, (10f-4, 20.0f-4), (512, 511), 1f-2, 1f-10, 0.01f-3)
res1 = test_gauss_consistency(405f-9, (10f-4, 20.0f-4), (512, 512), 1f-2, 1f-10, 0.01f-3)

# ╔═╡ a5e7878f-4ea1-4f75-87f8-fafd09f5ad82
res2 = test_gauss_consistency(10f-9, (1f-4, 0.5f-4), (400, 401), 0.02f-2, 0.05f-2, 0.003f-3, do_test = true)
res2 = test_gauss_consistency(10f-9, (1f-4, 0.5f-4), (400, 400), 0.02f-2, 0.05f-2, 0.003f-3, do_test = true)

# ╔═╡ 22e070fd-b27f-4cb2-8ad7-71f409e881bf
# ╠═╡ skip_as_script = true
Expand Down

0 comments on commit 71214c0

Please sign in to comment.