Skip to content

Commit

Permalink
Migrated iteration 5 to branch
Browse files Browse the repository at this point in the history
  • Loading branch information
kapple19 committed Aug 25, 2024
1 parent 25859fa commit f1fdf2c
Show file tree
Hide file tree
Showing 168 changed files with 123,211 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
71 changes: 71 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI
on:
push:
branches:
- main
tags: ['*']
pull_request:
workflow_dispatch:
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
actions: write
contents: read
strategy:
fail-fast: false
matrix:
version:
- '1.10'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
docs:
name: Documentation
runs-on: ubuntu-latest
permissions:
actions: write # needed to allow julia-actions/cache to proactively delete old caches that it has created
contents: write
statuses: write
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1'
- uses: julia-actions/cache@v2
- name: Configure doc environment
shell: julia --project=docs --color=yes {0}
run: |
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run doctests
shell: julia --project=docs --color=yes {0}
run: |
using Documenter: DocMeta, doctest
using OceanSonar
DocMeta.setdocmeta!(OceanSonar, :DocTestSetup, :(using OceanSonar); recursive=true)
doctest(OceanSonar)
16 changes: 16 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
31 changes: 31 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: 3
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/Manifest.toml
/docs/Manifest.toml
/docs/build/
/readme/Manifest.toml
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
8 changes: 8 additions & 0 deletions CITATION.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@misc{OceanSonar.jl,
author = {Aaron Kaw <aaronjkaw@gmail.com> and contributors},
title = {OceanSonar.jl},
url = {https://github.com/kapple19/OceanSonar.jl},
version = {v1.0.0-DEV},
year = {2024},
month = {3}
}
35 changes: 35 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name = "OceanSonar"
uuid = "606d67fd-65b6-4abb-b2f0-1946d248e4dc"
authors = ["Aaron Kaw <[email protected]> and contributors"]
version = "1.0.0-DEV"

[deps]
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[weakdeps]
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"

[extensions]
OceanSonarMakieExt = "Makie"
OceanSonarPlotsExt = "Plots"

[compat]
ForwardDiff = "0.10"
Interpolations = "0.15"
IntervalArithmetic = "0.22"
LinearAlgebra = "1.10"
Makie = "0.21"
NaNMath = "1.0"
OrdinaryDiffEq = "6.85"
Plots = "1.40"
PrecompileTools = "1.2"
Statistics = "1.10"
julia = "1.11"
7 changes: 7 additions & 0 deletions benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using OceanSonar
using BenchmarkTools

SUITE = BenchmarkGroup()
SUITE["rand"] = @benchmarkable rand(10)

# Write your benchmarks here.
4 changes: 4 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
OceanSonar = "606d67fd-65b6-4abb-b2f0-1946d248e4dc"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
86 changes: 86 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
using OceanSonar
using Documenter

DocMeta.setdocmeta!(OceanSonar, :DocTestSetup, :(using OceanSonar); recursive=true)

pages = [
"Ocean Sonar" => "index.md"
"General" => [
"Usage" => "general/usage.md"
"Implementation" => "general/implementation.md"
]
"Oceanography" => [
"Parameters" => [
"Celerity" => [
"Atmosphere" => "oceanography/parameters/celerity/atmosphere.md"
"Ocean" => "oceanography/parameters/celerity/ocean.md"
"Seabed" => [
"Compressional" => "oceanography/parameters/celerity/seabed/compressional.md"
"Shear" => "oceanography/parameters/celerity/seabed/shear.md"
]
]
"Density" => [
"Atmosphere" => "oceanography/parameters/density/atmosphere.md"
"Ocean" => "oceanography/parameters/density/ocean.md"
"Seabed" => "oceanography/parameters/density/seabed.md"
]
"Attenuation" => [
"Atmosphere" => "oceanography/parameters/attenuation/atmosphere.md"
"Ocean" => "oceanography/parameters/attenuation/ocean.md"
"Seabed" => [
"Compressional" => "oceanography/parameters/attenuation/seabed/compressional.md"
"Shear" => "oceanography/parameters/attenuation/seabed/shear.md"
]
]
]
"Slice" => [
"Introduction" => "oceanography/environment/intro.md"
"Boundary" => [
"Altimetry" => "oceanography/environment/boundary/altimetry.md"
"Bathymetry" => "oceanography/environment/boundary/bathymetry.md"
]
"Medium" => [
"Introduction" => "oceanography/environment/medium/intro.md"
"Atmosphere" => "oceanography/environment/medium/atmosphere.md"
"Ocean" => "oceanography/environment/medium/ocean.md"
"Seabed" => "oceanography/environment/medium/seabed.md"
]
]
]
"Acoustics" => [
"Scenario" => "acoustics/scenario.md"
"Reflection" => [
"Bottom" => "acoustics/reflection/bottom.md"
]
"Propagation" => [
"Introduction" => "acoustics/propagation/intro.md"
"Tracing" => [
"Introduction" => "acoustics/propagation/tracing/intro.md"
"Rays" => "acoustics/propagation/tracing/rays.md"
"Beams" => "acoustics/propagation/tracing/beam.md"
"Grid" => "acoustics/propagation/tracing/grid.md"
]
"Parabolic" => [
"Marchers" => "acoustics/propagation/parabolic/marcher.md"
]
]
]
]

makedocs(;
sitename="OceanSonar.jl",
modules=[OceanSonar],
authors="Aaron Kaw <[email protected]> and contributors",
format = Documenter.HTML(;
canonical="https://kapple19.github.io/OceanSonar.jl",
edit_link = :commit,
collapselevel = 1,
assets = String[]
),
pages = pages,
)

deploydocs(;
repo="github.com/kapple19/OceanSonar.jl",
devbranch="main",
)
6 changes: 6 additions & 0 deletions docs/src/acoustics/propagation/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Acoustic Propagation

```@docs
Propagation
PropagationConfig
```
43 changes: 43 additions & 0 deletions docs/src/acoustics/propagation/parabolic/marcher.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Marchers

To be renamed.

```@example
using OceanSonar
using Plots
θ_deg = range(0, 90, 301)
θ = deg2rad.(θ_deg)
q = -sin.(θ).^2
helmholtz(q) = √(1 + q)
helmholtz_q = helmholtz.(q)
plot()
for model = list_models(OceanSonar.RationalFunctionApproximation)
rfa = OceanSonar.RationalFunctionApproximation(model)
errs = helmholtz_q - rfa.(q) .|> abs
plot!(θ_deg, errs,
label = string(model, " (", length(rfa.a), ")")
)
end
model = :pade
rfa = OceanSonar.RationalFunctionApproximation(model, m = 5)
errs = helmholtz_q - rfa.(q) .|> abs
plot!(θ_deg, errs,
label = string(model, " (", length(rfa.a), ")")
)
plot!(
xlims = (0, 90),
ylims = (0, 0.001),
legend_position = :best
)
savefig("phase_errors.svg")
```

Replication of Figure 6.1b of Jensen, et al (2011).

![phase_errors.svg](phase_errors.svg)
5 changes: 5 additions & 0 deletions docs/src/acoustics/propagation/tracing/beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Acoustic Beam Tracing

```@docs
Beam
```
30 changes: 30 additions & 0 deletions docs/src/acoustics/propagation/tracing/grid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Acoustic Tracing Interpolation to Grid

```@example
using OceanSonar
using Plots
using .Threads
@time "all" begin
begin
models = list_models(Scenario)
for m in eachindex(models)
model = models[m]
scen = Scenario(model)
prop = @time "$model" Propagation(:trace, scen,
angles = critical_angles(scen)
)
fig = visual(prop)
savefig(fig, "prop_" * modelsnake(scen.model) * ".svg")
end
end
end
```

![prop_parabolic_bathymetry.svg](prop_parabolic_bathymetry.svg)

![prop_index_squared_profile.svg](prop_index_squared_profile.svg)

![prop_munk_profile.svg](prop_munk_profile.svg)

![prop_lloyd_mirror.svg](prop_lloyd_mirror.svg)
5 changes: 5 additions & 0 deletions docs/src/acoustics/propagation/tracing/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Acoustic Tracing Models

```@docs
TraceConfig
```
Loading

0 comments on commit f1fdf2c

Please sign in to comment.