Skip to content

Commit

Permalink
Added more demonstrations
Browse files Browse the repository at this point in the history
  • Loading branch information
kapple19 committed Aug 11, 2024
1 parent 249d30a commit a83c815
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 1 deletion.
20 changes: 19 additions & 1 deletion demo/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.11.0-rc2"
manifest_format = "2.0"
project_hash = "312250c93ab02666602ba58c787d6694fab65fad"
project_hash = "850ebf95b1ce889497cf9809e7d9a16374c395b8"

[[deps.ADTypes]]
git-tree-sha1 = "6778bcc27496dae5723ff37ee30af451db8b35fe"
Expand Down Expand Up @@ -198,6 +198,18 @@ git-tree-sha1 = "0157e592151e39fa570645e2b2debcdfb8a0f112"
uuid = "00ebfdb7-1f24-5e51-bd34-a7502290713f"
version = "3.4.3"

[[deps.Cairo]]
deps = ["Cairo_jll", "Colors", "Glib_jll", "Graphics", "Libdl", "Pango_jll"]
git-tree-sha1 = "d0b3f8b4ad16cb0a2988c6788646a5e6a17b6b1b"
uuid = "159f3aea-2a34-519c-b102-8c37f9878175"
version = "1.0.5"

[[deps.CairoMakie]]
deps = ["CRC32c", "Cairo", "Cairo_jll", "Colors", "FileIO", "FreeType", "GeometryBasics", "LinearAlgebra", "Makie", "PrecompileTools"]
git-tree-sha1 = "e4da5095557f24713bae4c9f50e34ff4d3b959c0"
uuid = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
version = "0.12.5"

[[deps.Cairo_jll]]
deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "JLLWrappers", "LZO_jll", "Libdl", "Pixman_jll", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Zlib_jll", "libpng_jll"]
git-tree-sha1 = "a2f1c8c668c8e3cb4cca4e57a8efdb09067bb3fd"
Expand Down Expand Up @@ -839,6 +851,12 @@ git-tree-sha1 = "97285bbd5230dd766e9ef6749b80fc617126d496"
uuid = "c27321d9-0574-5035-807b-f59d2c89b15c"
version = "1.3.1"

[[deps.Graphics]]
deps = ["Colors", "LinearAlgebra", "NaNMath"]
git-tree-sha1 = "d61890399bc535850c4bf08e4e0d3a7ad0f21cbd"
uuid = "a2bd30eb-e257-5431-a919-1863eab51364"
version = "1.1.2"

[[deps.Graphite2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "344bf40dcab1073aca04aa0df4fb092f920e4011"
Expand Down
1 change: 1 addition & 0 deletions demo/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[deps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
OceanSonar = "03019ade-4524-4ecd-af79-46d4f04a1b56"
71 changes: 71 additions & 0 deletions demo/fan.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
##
using OceanSonar
using OceanSonar.IntervalArithmetic
using CairoMakie

cel = OceanCelerityProfile("Munk")
bty = BathymetryProfile("Flat", z = 5e3)
ati = AltimetryProfile("Flat")

r_min = 0.0
r_max = 100e3

fan = Fan("Gaussian",
π/20 * range(-1, 1, 5),
1e3, r_max, 1e3,
cel,
bty,
ReflectionCoefficientProfile("Reflective"),
ati,
ReflectionCoefficientProfile("Mirror")
)

r_ntv = interval(r_min, r_max)
z_min = r_ntv |> ati |> inf
z_max = r_ntv |> bty |> sup

fig = Figure()
axis = Axis(fig[1, 1], yreversed = true)
celerityheatmap!(axis, cel, r_min, r_max, z_min, z_max)
bathymetryband!(axis, bty, r_min, r_max)
altimetryband!(axis, ati, r_min, r_max)
raycurves!(axis, fan)

display(fig)

##
using OceanSonar
using OceanSonar.IntervalArithmetic
using CairoMakie

cel = OceanCelerityProfile("Homogeneous")
bty = BathymetryProfile("Parabolic")
ati = AltimetryProfile("Flat")

r_min = 0.0
r_max = 20e3

z_ref = 5e3

fan = Fan("Gaussian",
range(atan(z_ref, r_max), atan(z_ref, r_max/10), 5),
0.0, r_max, 1e3,
cel,
bty,
ReflectionCoefficientProfile("Reflective"),
ati,
ReflectionCoefficientProfile("Mirror")
)

r_ntv = interval(r_min, r_max)
z_min = r_ntv |> ati |> inf
z_max = r_ntv |> bty |> sup

fig = Figure()
axis = Axis(fig[1, 1], yreversed = true)
celerityheatmap!(axis, cel, r_min, r_max, z_min, z_max)
bathymetryband!(axis, bty, r_min, r_max)
altimetryband!(axis, ati, r_min, r_max)
raycurves!(axis, fan)

display(fig)

0 comments on commit a83c815

Please sign in to comment.