Skip to content

Commit

Permalink
Add DWBA and SDWBA classes (don't calculate TS yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinmacaulay committed Sep 3, 2024
1 parent f6a900b commit 5abd16b
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docs/api_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ Each type of model is contained in a separate Python class (with name ending in

## DWBA models

There are several models that use the distorted wave Born approximation, documented below:
There are several models that use the distorted-wave Born approximation, documented below:

### DWBA

This is a placeholder for the distorted wave Born approximation model.
::: echosms.DWBAModel
options:
heading_level: 4

### PT-DWBA

Expand All @@ -28,7 +30,9 @@ This is a placeholder for the distorted wave Born approximation model.

### SDWBA

This is a placeholder for the stochastic distorted wave Born approximation model.
::: echosms.SDWBAModel
options:
heading_level: 4

## ESModel

Expand Down
3 changes: 3 additions & 0 deletions src/echosms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
from .psmsmodel import PSMSModel
from .dcmmodel import DCMModel
from .ptdwbamodel import PTDWBAModel
from .dwbamodel import DWBAModel
from .sdwbamodel import SDWBAModel

__all__ = ['ScatterModelBase', 'BenchmarkData', 'ReferenceModels',
'MSSModel', 'PSMSModel', 'DCMModel', 'ESModel', 'PTDWBAModel',
'DWBAModel', 'SDWBAModel',
'wavenumber', 'eta', 'h1', 'spherical_jnpp',
'as_dataframe', 'as_dataarray']
60 changes: 60 additions & 0 deletions src/echosms/dwbamodel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
"""The distorted-wave Born approximation model."""

from .scattermodelbase import ScatterModelBase


class DWBAModel(ScatterModelBase):
"""Distorted-wave Born approximation scattering model."""

def __init__(self):
super().__init__()
self.long_name = 'distorted-wave Born approximation'
self.short_name = 'dwba'
self.analytical_type = 'approximate'
self.boundary_types = 'weakly scattering'
self.shapes = ['any']
self.max_ka = 20

def calculate_ts_single(self, theta, phi, f, target_rho, target_c):
"""Distorted-wave Born approximation scattering model.
Implements the distorted-wave Born approximation
model for calculating the acoustic backscatter from weakly scattering bodies.
Parameters
----------
theta : float
Incident wave pitch angle [°].
phi : float
Incident wave roll angle [°].
f : float
Frequency to run the model at [Hz]
target_rho : iterable[float]
Densities of each material. Must have at least the same number of entries as unique
integers in `volume` [kg/m³].
target_c : iterable[float]
Sound speed of each material. Must have at least the same number of entries as unique
integers in `volume` [m/s].
Returns
-------
: float
The target strength (re 1 m²) [dB] of the target.
Notes
-----
This class implements the method presented in Chu et al. (1993).
References
----------
Chu, D., Foote, K. G., & Stanton, T. K. (1993). Further analysis of target strength
measurements of Antarctic krill at 38 and 120 kHz: Comparison with deformed cylinder
model and inference or orientation distribution. The Journal of the Acoustical Society
of America, 93(5), 2985–2988. <https://doi.org/10.1121/1.405818>
"""
return None
69 changes: 69 additions & 0 deletions src/echosms/sdwbamodel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
"""The stochastic distorted-wave Born approximation model."""

from .scattermodelbase import ScatterModelBase


class SDWBAModel(ScatterModelBase):
"""Stochastic distorted-wave Born approximation scattering model."""

def __init__(self):
super().__init__()
self.long_name = "stochastic distorted-wave Born approximation"
self.short_name = "sdwba"
self.analytical_type = "approximate"
self.boundary_types = "weakly scattering"
self.shapes = ["any"]
self.max_ka = 20

def calculate_ts_single(self, theta, phi, f, target_rho, target_c):
"""Stochastic distorted-wave Born approximation scattering model.
Implements the stochastic distorted-wave Born approximation
model for calculating the acoustic backscatter from weakly scattering bodies.
Parameters
----------
theta : float
Incident wave pitch angle [°].
phi : float
Incident wave roll angle [°].
f : float
Frequency to run the model at [Hz]
target_rho : iterable[float]
Densities of each material. Must have at least the same number of entries as unique
integers in `volume` [kg/m³].
target_c : iterable[float]
Sound speed of each material. Must have at least the same number of entries as unique
integers in `volume` [m/s].
Returns
-------
: float
The target strength (re 1 m²) [dB] of the target.
Notes
-----
This class implements the method presented in Demer & Conti (2003), Demer & Conti (2004),
and Conti & Demer (2006).
References
----------
Demer, D. A., & Conti, S. G. (2003). Reconciling theoretical versus empirical target
strengths of krill: Effects of phase variability on the distorted-wave Born approximation.
ICES Journal of Marine Science, 60, 429-434.
<https://doi.org/10.1016/S1054-3139(03)00002-X>
Demer, D. A., & Conti, S. G. (2004). Reconciling theoretical versus empirical
target strengths of krill: Effects of phase variability on the distorted-wave Born
approximation. ICES Journal of Marine Science, 61(1), 157-158.
<https://doi.org/10.1016/j.icesjms.2003.12.003>
Conti, S. G., & Demer, D. A. (2006). Improved parameterization of the SDWBA for estimating
krill target strength. ICES Journal of Marine Science, 63(5), 928-935.
<https://doi.org/10.1016/j.icesjms.2006.02.007>
"""
return None

0 comments on commit 5abd16b

Please sign in to comment.