Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge/add multichannel masks #57

Merged
merged 4 commits into from
Sep 20, 2023
Merged

Conversation

ruxandra-valcu
Copy link
Collaborator

Added multichannel mask support to apply_mask - if a channelless or single-channel mask is provided it'll apply it to all channels of the dataset, whereas if a mask with multiple channels is provided, it'll apply each channel of the mask to the corresponding channel individually.

@simedroniraluca
Copy link
Collaborator

Is it safe to apply a single-channel mask across all channels if no specific mask is designed for each individual channel?

@simedroniraluca
Copy link
Collaborator

If you enhanced the functionality of apply_mask, shouldn't you also update the modified function's documentation?

@ruxandra-valcu
Copy link
Collaborator Author

Is it safe to apply a single-channel mask across all channels if no specific mask is designed for each individual channel?

This is the previous behaviour of the function - if you give it a mask with channels, it just applies channel 0 to everything

@ruxandra-valcu
Copy link
Collaborator Author

If you enhanced the functionality of apply_mask, shouldn't you also update the modified function's documentation?

Updated

Copy link
Collaborator

@mihaiboldeanu mihaiboldeanu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! It should be fine to add at this time, but we will have to investigate how to solve the test failing.

@ruxandra-valcu ruxandra-valcu merged commit 674091b into next-dev Sep 20, 2023
3 of 6 checks passed
@ruxandra-valcu ruxandra-valcu deleted the merge/add_multichannel_masks branch September 20, 2023 11:32
ruxandra-valcu added a commit that referenced this pull request Sep 21, 2023
* ci(deps): Bump actions/cache from 3.3.1 to 3.3.2 (OSOceanAcoustics#1161)

Bumps [actions/cache](https://github.com/actions/cache) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@v3.3.1...v3.3.2)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): [pre-commit.ci] pre-commit autoupdate (OSOceanAcoustics#1162)

updates:
- [github.com/psf/black: 23.7.0 → 23.9.1](psf/black@23.7.0...23.9.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Feature/add transient noise mask (#49)

* added the feature described in issue 1

* Moved code for the signal attenuation mask to new file

* Resolved merge conflicts by accepting remote versions of files

* Update mask_attenuated_signal.py

* renamed utils

* Added unit test

* Test can now automatically download its data

* Update echopype/utils/mask_transformation.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Update echopype/utils/mask_transformation.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Update echopype/utils/mask_transformation.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Update echopype/utils/mask_transformation.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Update echopype/utils/mask_transformation.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Update echopype/utils/mask_transformation.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Update echopype/utils/mask_transformation.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Cleaned up mask_transformation

* moved files and rerouted importing paths accordingly (#36)

Co-authored-by: alejandro-ariza <alejandro.ariza@ird.fr>

* Feature/add transient noise mask (#35)

* Completed feature #3 transient noise mask
---------

Co-authored-by: Mihai Boldeanu <35964395+mihaiboldeanu@users.noreply.github.com>
Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>
Co-authored-by: ruxandra valcu <ruxandra.valcu@gmail.com>

* Added extra tests for the utils/mask_transformation module to increase coverage

* Reverted test_mask.py reformating

* Moved impulse and transient noise functions to echopype/clean

* Fixed import order

* Fixed missing import in clean/conftest.py

* Moved content of tests/clean/conftest.py to tests/conftest.py

* Refactoring

* Running some linters on the code

* ci(deps): Bump actions/cache from 3.3.1 to 3.3.2 (OSOceanAcoustics#1161)

Bumps [actions/cache](https://github.com/actions/cache) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@v3.3.1...v3.3.2)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): [pre-commit.ci] pre-commit autoupdate (OSOceanAcoustics#1162)

updates:
- [github.com/psf/black: 23.7.0 → 23.9.1](psf/black@23.7.0...23.9.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Fix unused imports in conftest

* Update echopype/mask/mask_attenuated_signal.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

Update mask_transformation.py

Cleaned up mask_transformation

Delinted

Removing pytest req

Refactoring

Refactoring and cleaning imports

Fixed twod test

Fixing some future merge conflicts

Fix unused import

Added attenuation mask to init

* Added channel selection to signal attenuation mask

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Mihai Boldeanu <mishu_boldy@yahoo.com>
Co-authored-by: Mihai Boldeanu <35964395+mihaiboldeanu@users.noreply.github.com>
Co-authored-by: Andrei Rusu <andrei.rusu@beatfactor.net>
Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>
Co-authored-by: Andrei Rusu <beatfactor@users.noreply.github.com>
Co-authored-by: alejandro-ariza <alejandro.ariza@ird.fr>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Feature/add attenuation mask (#50)

* added the feature described in issue 1

* Moved code for the signal attenuation mask to new file

* Resolved merge conflicts by accepting remote versions of files

* Update mask_attenuated_signal.py

* renamed utils

* Added unit test

* Test can now automatically download its data

* Update echopype/utils/mask_transformation.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Update echopype/utils/mask_transformation.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Update echopype/utils/mask_transformation.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Update echopype/utils/mask_transformation.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Update echopype/utils/mask_transformation.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Update echopype/utils/mask_transformation.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Update echopype/utils/mask_transformation.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Cleaned up mask_transformation

* Update echopype/mask/mask_attenuated_signal.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

Update mask_transformation.py

Cleaned up mask_transformation

Delinted

Removing pytest req

Refactoring

Refactoring and cleaning imports

Fixed twod test

Fixing some future merge conflicts

Fix unused import

Added attenuation mask to init

* Added channel selection to signal attenuation mask

---------

Co-authored-by: Mihai Boldeanu <mishu_boldy@yahoo.com>
Co-authored-by: Mihai Boldeanu <35964395+mihaiboldeanu@users.noreply.github.com>
Co-authored-by: Andrei Rusu <andrei.rusu@beatfactor.net>
Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Patch/nasc (#51)

* Add conversion factors for NASC computation

- Convert backscattering cross-section to scattering cross-section.

- Convert meters to nmi.

* Fix nasc test

---------

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Merge/add shoal mask (#55)

* Mask utils

* rename

* Mask utils

* Weill shoal mask

* Decided against implementing the echoview method

* Turned out not to need these

* Add wrapper function

* Refactoring and adding channel selection capability

* Merge/add seabed mask (#56)

* Initial implementation of the seabed masking.

* Code for seabed masking

* Changed dilation source package from cv2 to skimage.

* some refactoring and add unit test

* Update echopype/mask/mask_seabed.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Update echopype/tests/mask/test_mask_seabed.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Re-added mask_transformation, with only the necessary functions kept

* Changed the tests to be able to autodownload its files - must check that I have the correct one though since the test isn't passing

* Cleaned up mask_transformation

* Copyright notices

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Update echopype/mask/mask_seabed.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Update echopype/mask/mask_seabed.py

Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Update incorrect file name

* Mask transformation consistency

* Mask transformation consistency

* Removing pytest req

* Refactoring

* Fix twod test

* Refactoring

* Test fixes

* Fixing merge compatibility

* Added dataset generation for datasets enriched with beam angle and location data

* Added dataset generation for datasets enriched with beam angle and location data

* Added channel selection.

* Modified Blackwell methods to use the physical beam angle rather than the raw EK60 beam angle - doing this using a correction on the angle itself (rather than modifying the constants) since the changes are nonlinear so if I want a linear transformation, I need to apply it on the angle data itself - angle * 22 * 128 / 180, which gets it close to how a decently calibrated EK60 instrument as used by Blackwell et al stores its raw angle data.

* Indent fix

* Merge fixes

---------

Co-authored-by: Mihai Boldeanu <mishu_boldy@yahoo.com>
Co-authored-by: Andrei Rusu <andrei.rusu@beatfactor.net>
Co-authored-by: Andrei Rusu <beatfactor@users.noreply.github.com>
Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>

* Merge/add multichannel masks (#57)

* Initial multichannel mask

* Fixed a has-channels check in apply_mask, added tests

* Documentation

* Made changes to conftest

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Mihai Boldeanu <mishu_boldy@yahoo.com>
Co-authored-by: Mihai Boldeanu <35964395+mihaiboldeanu@users.noreply.github.com>
Co-authored-by: Andrei Rusu <andrei.rusu@beatfactor.net>
Co-authored-by: Raluca Simedroni <92971445+simedroniraluca@users.noreply.github.com>
Co-authored-by: Andrei Rusu <beatfactor@users.noreply.github.com>
Co-authored-by: alejandro-ariza <alejandro.ariza@ird.fr>
beatfactor pushed a commit that referenced this pull request May 24, 2024
* Initial multichannel mask

* Fixed a has-channels check in apply_mask, added tests

* Documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echopype enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants