OceanStreamIO / oceanstream

Oceanstream is a Python library which can be used as a CLI tool to process raw acoustic data from echosounders. It uses echopype as a backend. Developed at @pineviewlabs
https://oceanstream.io
MIT License
4 stars 3 forks source link

Incorrect check for `waveform_mode` and `encode_mode` parameters in `compute_sv()` #45

Closed simedroniraluca closed 11 months ago

simedroniraluca commented 11 months ago

The current implementation of compute_sv() requires that the optional parameters waveform_mode and encode_mode appear exclusively for EK80. However, this behavior is not entirely correct.

Expected Behavior:

  1. For EK80: Both waveform_mode and encode_mode are required.
  2. For EK60: While these parameters can be present, they have a fixed configuration of waveform_mode="CW" and encode_mode="power".

Current Behavior: The function raises an error if waveform_mode and encode_mode are present for EK60, even if they have the correct configuration.

Suggested Fix: Update the checks in compute_sv() to account for the possibility of these parameters being present in the EK60 case with the previously mentioned configuration.

simedroniraluca commented 11 months ago

We only have clear info about the EK80 for waveform_mode and encode_mode. So, I'm only setting rules for EK80. Check the documentation here. We're not totally sure if all EK60 types use the same settings for these parameters.

ruxandra-valcu commented 11 months ago

Because all EK60 echosounders are narrowband devices, they will all use "CW" and "power"

simedroniraluca commented 11 months ago

Because of the phrases emphasized in the image below, taken from echopype documentation for computing Sv, I do not add checks on other instruments besides EK80. We do not know everything about all types of EK60. We will use our assumption that "For EK60: While these parameters can be present, they have a fixed configuration of waveform_mode='CW' and encode_mode='power', but not in checks.

Image

simedroniraluca commented 11 months ago

https://github.com/OceanStreamIO/oceanstream/pull/46

ruxandra-valcu commented 11 months ago

Fixed