Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add description of units to absorption docstring #55

Merged
merged 1 commit into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/uw_basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,19 @@ Compute volume acoustic absorption coefficient in water, given:
- `depth` in meters
- `pH` of water

Implementation based on the Francois-Garrison model.
The result is a unitless linear scale factor for sound pressure over the given `distance`. To get
absorption in terms of dB / m, set `distance = 1.0` and convert the result to decibels. For instance,
at a frequency of 100 kHz:

```julia-repl
julia> A = absorption(100e3, 1.0)
0.9959084838594522

julia> α = -20log10(A)
0.035611359656810865
```

Implementation based on the Francois and Garrison (1982) model.
"""
function absorption(frequency, distance=1000.0, salinity=35.0, temperature=27.0, depth=10.0, pH=8.1)
f = frequency/1000.0
Expand Down
Loading