OSOceanAcoustics / echopype

Enabling interoperability and scalability in ocean sonar data analysis
https://echopype.readthedocs.io/
Apache License 2.0
96 stars 72 forks source link

Allow Waveform Mode FM in Calibrate API #1363

Closed ctuguinay closed 2 months ago

ctuguinay commented 2 months ago

Addresses #1334

This was the easiest way I could envision allowing FM. Otherwise, I would've reviewed all the calibrate code and added FM there. What are your thoughts @leewujung?

codecov-commenter commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.52%. Comparing base (9f56124) to head (1b55517). Report is 129 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1363 +/- ## ========================================== + Coverage 83.52% 89.52% +6.00% ========================================== Files 64 11 -53 Lines 5686 1002 -4684 ========================================== - Hits 4749 897 -3852 + Misses 937 105 -832 ``` | [Flag](https://app.codecov.io/gh/OSOceanAcoustics/echopype/pull/1363/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OSOceanAcoustics) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/OSOceanAcoustics/echopype/pull/1363/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OSOceanAcoustics) | `89.52% <100.00%> (+6.00%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OSOceanAcoustics#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

leewujung commented 2 months ago

Yeah I agree with this approach. Just much easier to implement.

The only suggestion I have is to do the following right at the top of _compute_cal, then we don't need to change the arguments. This also makes our intension clear:

# Make waveform_mode "FM" equivalent to "BB"
waveform_mode = "BB" if waveform_mode == "FM" else waveform_mode
ctuguinay commented 2 months ago

@leewujung Thanks! I added your suggestion. This should be ready for another quick review.