From 8c87b3b2db0095057a1b22f35db690b529e3d8c2 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 20 May 2024 18:45:33 -0700 Subject: [PATCH] Add description of units to absorption docstring --- src/uw_basic.jl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/uw_basic.jl b/src/uw_basic.jl index b8f05ef..500d854 100644 --- a/src/uw_basic.jl +++ b/src/uw_basic.jl @@ -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