OSOceanAcoustics / echopype

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

Add Index Aggregation Option for Cleaning Mask Functions #1326

Open ctuguinay opened 1 month ago

ctuguinay commented 1 month ago

Addresses #1321

codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 95.65217% with 4 lines in your changes missing coverage. Please review.

Project coverage is 97.97%. Comparing base (9f56124) to head (b8f8ece). Report is 119 commits behind head on main.

Files Patch % Lines
echopype/clean/api.py 90.24% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1326 +/- ## =========================================== + Coverage 83.52% 97.97% +14.45% =========================================== Files 64 3 -61 Lines 5686 198 -5488 =========================================== - Hits 4749 194 -4555 + Misses 937 4 -933 ``` | [Flag](https://app.codecov.io/gh/OSOceanAcoustics/echopype/pull/1326/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/1326/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OSOceanAcoustics) | `97.97% <95.65%> (+14.45%)` | :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.

ctuguinay commented 1 month ago

I wasn't sure if the transient noise bins indicated in the Ryan 2015 paper were radius or diameter values, but I couldn't run some examples if my assumption was radius (memory leakage problem since bins were so big) so I modified my assumption to diameter, and that is reflected in the default values of the transient noise mask function.

ctuguinay commented 1 month ago

@leewujung This PR is at a good spot for review

ctuguinay commented 3 weeks ago

For mask_transient_noise: Why do we need to copy operations in the functions?

# Copy `ds_Sv`
ds_Sv = ds_Sv.copy()

This copy is then copied again in index_binning_pool_Sv so I also commented there. I may be missing something, but I think we just need 1 copy that gets sliced with to exclude the shallower samples (exclude_above).

I agree it's not necessary. Even that second copy isn't required since when I remove all of them, the tests seem to pass.

ctuguinay commented 3 weeks ago

@leewujung Thanks for the review! This should be ready to look at again. I applied most of your suggestions, but I have a few questions/comments.