Skip to content

Differences in KRM implementations #30

@gavinmacaulay

Description

@gavinmacaulay

The Clay & Horne (1994) paper, in the line immediately after equation 13, says

and $k_b \approx k$ at low contrast.

Setting $k_b$ to $k$ gives TS results that differ by around 1 dB compared to not setting $k_b$ to be $k$ for some example datasets. It is not clear why this approximation is necessary (it doesn't simplify the calculations at all) and it perhaps leads to less accurate TS results. Some other implementations of the KRM that echoSMs has been compared against set $k_b$ to $k$, so echoSMs currently does the same.

To allow for testing and comparison of other KRM implementations, the fish shapes from the online KRM TS calculator (https://www.fisheries.noaa.gov/data-tools/krm-model) have been included in echoSMs in a toml-formatted file (or use the KRMorganism Python class for easy access).

The TS for the sardine shape from there can be calculated and compared to the online results with:

from echosms import KRMModel, KRMdata
import matplotlib.pyplot as plt
import numpy as np

mod = KRMModel()

fish = KRMdata().model('Sardine')

p = {'medium_c': 1490, 'medium_rho': 1030, 'organism': fish, 'theta': 90,
     'f': np.arange(12, 121, 1)*1e3}

krm_ts = mod.calculate_ts(p)

noaa_ts = KRMdata.ts('Sardine')

d = np.mean(np.abs(np.array(krm_ts) - np.array(noaa_ts[' TS (dB).1'])))
print(f'Mean difference in results is {d:.2f} dB')

plt.plot(fish.body.x, fish.body.z_U, fish.body.x, fish.body.z_L, c='black')
for s in fish.inclusions:
    plt.plot(s.x, s.z_U, s.x, s.z_L, c='C0' if s.boundary == 'fluid' else 'C1')
plt.gca().set_aspect('equal')
plt.show()

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions