-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
130 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,16 @@ uuid = "03019ade-4524-4ecd-af79-46d4f04a1b56" | |
authors = ["Aaron Kaw <[email protected]> and contributors"] | ||
version = "1.0.0-DEV" | ||
|
||
[deps] | ||
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" | ||
|
||
[weakdeps] | ||
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" | ||
|
||
[extensions] | ||
OceanSonarAbstractTreesExt = "AbstractTrees" | ||
|
||
[compat] | ||
AbstractTrees = "0.4" | ||
InteractiveUtils = "1.11.0" | ||
julia = "1.10" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
[deps] | ||
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
OceanSonar = "03019ade-4524-4ecd-af79-46d4f04a1b56" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module OceanSonarAbstractTreesExt | ||
using OceanSonar | ||
using AbstractTrees | ||
|
||
import AbstractTrees: children | ||
|
||
children(ST::Type{<:SonarType}) = subtypes(ST) | ||
children(AM::Type{<:OceanSonar.AbstractModeller}) = subtypes(AM) | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# TODO: Update when Unitful.jl is incorporated into package. | ||
function ⊕(levels...) | ||
10log10( | ||
( | ||
@. 10^(levels/10) | ||
) |> splat(+) | ||
) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export SonarType | ||
export Passive | ||
export Narrowband | ||
export Broadband | ||
export Intercept | ||
export Active | ||
export Monostatic | ||
export Bistatic | ||
export NoiseLimited | ||
export ReverberationLimited | ||
|
||
abstract type SonarType end | ||
|
||
abstract type Passive <: SonarType end | ||
abstract type Active <: SonarType end | ||
|
||
abstract type Narrowband <: Passive end | ||
abstract type Broadband <: Passive end | ||
abstract type Intercept <: Passive end | ||
|
||
abstract type Monostatic <: Active end | ||
abstract type Bistatic <: Active end | ||
|
||
abstract type NoiseLimited <: Monostatic end | ||
abstract type ReverberationLimited <: Monostatic end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
``` | ||
signal_to_noise_ratio(::Type{<:Passive}, SL::Real, PL::Real, NL::Real, DI::Real)::Float64 | ||
``` | ||
Computes the Signal-to-Noise Ratio (SNR) [dB] as a function of (Abraham, 2019, Section 2.3.4): | ||
* `SL` Source Level [dB // μPa² m² @ 1 m] | ||
* `PL` Propagation Loss [dB // m²] | ||
* `NL` Noise Level [dB // μPa²] | ||
* `AG` Array Gain [dB] | ||
Implementation of Equation 2.48 of Abraham (2019). | ||
""" | ||
function signal_to_noise_ratio(::Type{<:Passive}, SL::Real, PL::Real, NL::Real, AG::Real)::Float64 | ||
SL - PL - NL + AG | ||
end | ||
|
||
function signal_to_noise_ratio(::Type{<:Monostatic}, SL::Real, PL::Real, TS::Real, RL::Real, NL::Real)::Float64 | ||
SL - 2PL + TS - (NL ⊕ RL) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
abstract type ConvenienceConfiguration end | ||
abstract type ConvenienceComputation end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
struct PropagationConfiguration{Model <: ModelName} <: ConvenienceConfiguration | ||
coherence::ModelName | ||
beam::ModelName | ||
end | ||
|
||
struct Propagation2D{Model <: ModelName} <: ConvenienceComputation | ||
config::PropagationConfiguration{Model} | ||
|
||
r::Vector{Float64} | ||
z::Vector{Float64} | ||
p::Matrix{ComplexF64} | ||
PL::Matrix{Float64} | ||
end | ||
|
||
struct Propagation3D{Model <: ModelName} <: ConvenienceComputation | ||
config::PropagationConfiguration{Model} | ||
|
||
# r::Vector{Float64} | ||
# θ::Vector{Float64} | ||
x::Vector{Float64} | ||
y::Vector{Float64} | ||
z::Vector{Float64} | ||
p::Array{ComplexF64, 3} | ||
PL::Array{Float64, 3} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
struct PerformanceConfiguration <: ConvenienceConfiguration | ||
sonar_type::SonarType | ||
end | ||
|
||
struct Performance2D <: ConvenienceConfiguration | ||
prop::Propagation2D | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
using OceanSonar | ||
using AbstractTrees | ||
using Test | ||
|
||
print_tree(SonarType) | ||
print_tree(OceanSonar.AbstractModeller) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters