Skip to content

Commit

Permalink
Merge/add transient noise mask (#82)
Browse files Browse the repository at this point in the history
* 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

* 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

* Changed parser in `parse_azfp.py` to maintain consistency over other parsers. (OSOceanAcoustics#1135)

* replaced usage of xml.dom.minidom with xml.etree.ElementTree

* modified azfp parser and parsed all parameters

* refactored the parse_azfp code and added new tests

* small tweak in test, rename conversion function to _camel_to_snake

* updated parameter names

* Replace camel-to-snake conversion funcitonality (#1)

* Create utils camel-to-snake-case function in new misc.py, and use it in ek_raw_parsers

* Replace AZFP camel-to-snake function with new utils/misc.py function

* fixed minor error in code

* minor change in test_convert_azfp.py

* fixed failing tests

* fixed failing tests related to attribute name

* fixed minor bug

---------

Co-authored-by: Wu-Jung Lee <leewujung@gmail.com>
Co-authored-by: Emilio Mayorga <emiliomayorga@gmail.com>

* ci: added support for running individual test files (OSOceanAcoustics#1166)

Added a support for testing individual test files also instead of having support for testing only subpackages.

* Delinting

* refactor(convert): refactor and cleanup parsed2zarr (OSOceanAcoustics#1070)

* Bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.1 (OSOceanAcoustics#999)

Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.6.4 to 1.8.1.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](pypa/gh-action-pypi-publish@v1.6.4...v1.8.1)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Bump actions/cache from 3.2.5 to 3.3.1 (OSOceanAcoustics#982)

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

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

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

* [pre-commit.ci] pre-commit autoupdate (OSOceanAcoustics#1022)

updates:
- [github.com/psf/black: 23.1.0 → 23.3.0](psf/black@23.1.0...23.3.0)

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

* Bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.5 (OSOceanAcoustics#1021)

Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.8.1 to 1.8.5.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](pypa/gh-action-pypi-publish@v1.8.1...v1.8.5)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  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>

* Bump actions/setup-python from 4.5.0 to 4.6.0 (OSOceanAcoustics#1036)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.5.0 to 4.6.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4.5.0...v4.6.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (OSOceanAcoustics#1041)

Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.8.5 to 1.8.6.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](pypa/gh-action-pypi-publish@v1.8.5...v1.8.6)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  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>

* Bump mamba-org/provision-with-micromamba from 15 to 16 (OSOceanAcoustics#1048)

Bumps [mamba-org/provision-with-micromamba](https://github.com/mamba-org/provision-with-micromamba) from 15 to 16.
- [Release notes](https://github.com/mamba-org/provision-with-micromamba/releases)
- [Commits](mamba-org/provision-with-micromamba@v15...v16)

---
updated-dependencies:
- dependency-name: mamba-org/provision-with-micromamba
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* Bump actions/setup-python from 4.6.0 to 4.6.1 (OSOceanAcoustics#1052)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4.6.0...v4.6.1)

---
updated-dependencies:
- dependency-name: actions/setup-python
  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>

* Extract out whether_write_to_zarr and remove use_swap arg

* Initial add of destination_path

* Start using destination path and storage options, modify cleanup

* Update docstrings, and add some checks

* Add sonar model attribute to parser object

* Pass sonar_model to parser and fix bug

* Move dataarrays creation to parsed2zarr

* Remove atexit registration

* Add default DEFAULT_ZARR_TEMP_DIR global var

* Initial test for parsed2zarr components

* Add explicit no swap for conversion test

* fix: add parsed2zarr_obj to self to fix bug

* fix: uncomment zarr store close to close the store

* fix: remove unneeded typing

* fix: no need to close fsmap zarr store anymore, removing code

* feat: write tx datagram to zarr in  during p2z

* feat: add  property for ek80 p2z

* feat: set  from swap array

* fix: missing transmit data when no swap

* fix: only delete col when it exists in p2z_ek80

* test(echodata): add simple P2Z object to utils mock

* fix: Import 'List' typehint

Added import for 'List' that is currently
in use but missing.

* fix: Remove elif for column removal

Changed the if elif to a for if so
it removes both 'power' and 'angle' columns
for RAW4 'tx_datagram_df' data.

* fix: Removed dependency to 'more-itertools'

Removed dependency to 'more-itertools' by using similar
method that uses 'numpy.array_split' instead to
evenly split data into desired chunks

* test: Set 'no_swap' for 'test_combine_echodata_combined_append'

Assign 'no_swap' to 'destination_path' during 'open_raw'
to ensure that everything is in memory since the new
parsed to zarr functionality is 'auto' by default.

* feat: Add 'auto' keyword to enable auto 'use_swap'

Changed the way that 'auto' determination of 'use_swap'
by specifying an 'auto' keyword, rather than by default.
Now defaulting back to 'no_swap' for empty 'destination_path'.

* revert: Removed 'no_swap' in 'test_combine_echodata_combined_append'

On OSOceanAcoustics@b6b79fa
'no_swap' was set, however because now the default is 'no_swap'
this shouldn't be needed!

* fix: Use convention yaml for 'backscatter_x'

Sets 'long_name' attributes for 'backscatter_r' and
'backscatter_i' from the convention yaml for p2z
outputs. Additionally, units changed from 'V' to 'dB' to
sync up with the "no_swap" counterpart.

Old tests for 'test_direct_to_zarr_integration' has been activated
again to ensure equivalency b/w the two methods.

* test: Added P2Z Arrays tests

Added testing for underlying methods that
gets called during a 'datagram_to_zarr'
call to ensure that zarr arrays actually gets
created.

Ref: OSOceanAcoustics#777

---------

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>

* fix(commongrid):  improve 'compute_MVBS' using flox [all tests ci] (OSOceanAcoustics#1124)

* chore(deps): add flox dependency >=0.7.2

* fix(commongrid): fixes 'compute_MVBS' so it can work better and scale

Under the hood, binning along ping time and echo range now uses flox.
This allows for scalability and more community-maintained.

* docs: add small code comment

* refactor: change how ping_time index is retrieved

* refactor: remove for loop for channel

* test(mvbs): add mock Sv datasets and tests for dims (#2)

Note that @leewujung also changed mean to nanmean for skipping NaNs in each bin.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix: change dask to numpy

Changed the use of dask for log10 to numpy instead since numpy can also handle dask array inputs properly.

* feat: Add method argument

Added 'method' argument to 'get_MVBS_along_channels'
and also expose additional keyword arguments control for
flox.

* fix(commongrid): Fixed to include lat lon

Fixed 'compute_MVBS' function to now
include latitude and longitude if the variables
exists in the Sv dataset.

Additionally, the flox method and keyword arguments
are now exposed within the 'compute_MVBS' function.

Ref: Issue OSOceanAcoustics#1002

* refactor: Set defaults to recommended

After some investigation, @lsetiawan
concluded that at this time the
method 'map-reduce', engine 'numpy',
and reindex True works the best,
so this is now set as default.

Also, getting echo range maximum is
through direct data slicing rather than
computation.

* feat(commongrid): Add 'range_var' argument to 'compute_MVBS'

Added a new argument 'range_var' so that user can set
the range variable to perform binning with.
There are 2 options of 'echo_range' and 'depth':

- 'echo_range': When this is set, variable 'water_level'
                is now included in the resulting MVBS dataset
- 'depth': A check is in place to ensure that this variable exists
           before moving forward and use this to perform range binning.

Ref: Issue OSOceanAcoustics#1002

* fix: Add missing attributes for lat lon

* test: Update test to use random generator

* fix: Add case for no 'water_level'

Added a case for dataset that doesn't have water level variable.

* test(nasc): Remove 'compute_NASC' import to avoid failure

* fix: Removed assumption on echo range max

Reverted back the echo range max computation
to computing on the fly since there may be some
NaN values.

* test: Extract api test and add markings

Extracted fixtures to conftest.py for commongrid.
Additionally, clean up unused functions and mark
tests b/w unit and integration. Added a new test module
called 'test_api.py' for 'commongrid.api'.

* test: Add latlon test for 'compute_MVBS'

Added a test for Sv dataset that contains latitude
and longitude going through 'compute_MVBS'
to ensure that those variables gets propagated through.

Ref: OSOceanAcoustics#1002

* test: Add small get_MVBS_along_channels test

Added test for 'get_MVBS_along_channels' with either 'depth'
as the 'range_var' or checking for 'has_positions' is True
or False.

* refactor: Integrate suggested changes

Integrated suggested changes from review such as
additional comments in code, fixing some variable names,
and extracting out the lin2log and log2lin functions.

Additionally, now echopype imports pint library
to start having unit checks in the input for compute_MVBS.

* test: Added check for position values

* test: Update range_meter_bin to strings

* test: Added 'compute_MVBS' values test

* Update echopype/tests/utils/test_processinglevels_integration.py

compute_MVBS now should preserve the processing level attributes. So, test for presence rather than absence

* test: Add 'nan' sprinkles

Sprinkled 'nan' values all over 'echo_range' to ensure that
computed values from 'compute_MVBS' doesn't take into account
the 'nan'. Added check for the expected distribution of 'nan'
in the resulting array.

Ref: OSOceanAcoustics#1124 (comment)

* revert: Revert the use of 'pint'

Removed dependency to 'pint' and use simple regex
to ensure that 'range_bin' input is unit 'm'.
Renamed 'range_meter_bin' argument to 'range_bin'.

Ref: OSOceanAcoustics#1124 (comment)

* feat: Allow 'range_bin' to have space

* fix: Apply suggestions from code review

Applied fix for regex not capturing decimal values by @emiliom

Ref: https://github.com/OSOceanAcoustics/echopype/pull/1124/files#r1320422121

Co-authored-by: Emilio Mayorga <emiliomayorga@gmail.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* test: Fix test text for wrong unit

* test: Remove the 'e.g.' part on pytest

Removed the part with '(e.g., '10m')' since
it's messing up pytests regex matching.

* test: Remove remnant for test_ek.py

* refactor: Extract range_bin parsing and add close arg

Extracts out the 'range_bin' string to float into a private function.
Additionally now there's a fine tune argument for bin close edges
so user can specify either close is 'left' or 'right'.
Bins are converted to pandas interval index before passing
into 'get_MVBS_along_channels'.

* refactor: Update arg types to include interval index

Added argument type options for 'range_interval' and 'ping_interval' to
also be interval index.

* test: Update tests to have brute force creation

Changed mock mvbs to be created by doing brute force
rather than hard coding.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* test: Fix brute force mvbs gen

Fixes the generation of expected mvbs with brute force
as well as tweaks to mvbs_along_channel test.

* chore: Clean up old code for doing compute MVBS

Removes old code that perfoms compute_MVBS since
now we've switched over to flox

* chore(pytest): Added custom markers 'unit' and 'integration'

* docs: Update docstring for `compute_MVBS`

Added options for literal arguments

* refactor: Change 'parse_range_bin' to 'parse_x_bin'

Make bin parsing to be more general by making it
to 'parse_x_bin'.

* chore: Update suggested changes

Update some texts from suggested review as discussed.

Ref: OSOceanAcoustics#1124 (review)

---------

Co-authored-by: Wu-Jung Lee <leewujung@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Emilio Mayorga <emiliomayorga@gmail.com>

* ci: Fix run-test.py for module runs (OSOceanAcoustics#1180)

Fixes the 'run-test.py' script so it can run module
based testing rather than only specific test files.

Ref: OSOceanAcoustics#1166

* Impulse noise: modified ryan_iterable to use ryan directly

* Impulse noise: renamed medianf

* Consolidating functions

* Impulse noise refactoring: using a parameter dictionary and a function map

* Frequency filtering

* Frequency filtering (temp add to transient noise and signal attenuation, will refactor)

* Signal attenuation refactor

* Transmission noise refactor

* Impulse noise default params

* Multichannel noise masks

* Made the noise masks able to handle taking a file path as an input

* Fixed import

* Fix

* Update conftest.py

 extra parenthesis on pytest fixture decorator

* Update test_noise.py

Fixed the missing parenthesis for the tests.

---------

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: Praneeth Ratna <63547155+praneethratna@users.noreply.github.com>
Co-authored-by: Wu-Jung Lee <leewujung@gmail.com>
Co-authored-by: Emilio Mayorga <emiliomayorga@gmail.com>
Co-authored-by: Don Setiawan <landungs@uw.edu>
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>
  • Loading branch information
13 people committed Oct 2, 2023
1 parent 14665b5 commit 119e831
Show file tree
Hide file tree
Showing 50 changed files with 2,795 additions and 2,283 deletions.
25 changes: 17 additions & 8 deletions .ci_helpers/run-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,24 @@
for k, v in test_to_run.items():
print(f"=== RUNNING {k.upper()} TESTS===")
print(f"Touched files: {','.join([os.path.basename(p) for p in v])}")
if k == "root":
file_glob_str = "echopype/tests/test_*.py"
cov_mod_arg = ["--cov=echopype"]
# Run specific test files
# The input files must all starts with "test" in their name
# otherwise module globbing for specific test files will
# be used
if all(f.name.startswith("test") for f in v):
# For specific test files
test_files = [str(p) for p in v]
else:
file_glob_str = f"echopype/tests/{k}/*.py"
cov_mod_arg = [f"--cov=echopype/{k}"]
if args.include_cov:
pytest_args = original_pytest_args + cov_mod_arg
test_files = glob.glob(file_glob_str)
# Run all tests in a module
if k == "root":
file_glob_str = "echopype/tests/test_*.py"
cov_mod_arg = ["--cov=echopype"]
else:
file_glob_str = f"echopype/tests/{k}/*.py"
cov_mod_arg = [f"--cov=echopype/{k}"]
if args.include_cov:
pytest_args = original_pytest_args + cov_mod_arg
test_files = glob.glob(file_glob_str)
final_args = pytest_args + test_files
print(f"Pytest args: {final_args}")
exit_code = pytest.main(final_args)
Expand Down
9 changes: 8 additions & 1 deletion docs/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,20 @@ the latter via `minio <https://minio.io>`_.
will execute all tests. The entire test suite can be a bit slow, taking up to 40 minutes
or more. If your changes impact only some of the subpackages (``convert``, ``calibrate``,
``preprocess``, etc), you can run ``run-test.py`` with only a subset of tests by passing
as an argument a comma-separated list of the modules that have changed. For example:
as an argument a comma-separated list of the modules that have changed or also run only particular test
files by passing a comma-separated list of test files that you want to run. For example:

.. code-block:: bash
python .ci_helpers/run-test.py --local --pytest-args="-vv" echopype/calibrate/calibrate_ek.py,echopype/preprocess/noise_est.py
will run only tests associated with the ``calibrate`` and ``preprocess`` subpackages.

.. code-block:: bash
python .ci_helpers/run-test.py --local --pytest-args="-vv" echopype/tests/convert/test_convert_azfp.py,echopype/tests/clean/test_noise.py
will run only the tests in the ``test_convert_azfp.py`` and ``test_noise.py`` files.
For ``run-test.py`` usage information, use the ``-h`` argument:
``python .ci_helpers/run-test.py -h``

Expand Down
4 changes: 2 additions & 2 deletions echopype/calibrate/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def compute_Sv(echodata: EchoData, **kwargs) -> xr.Dataset:
- for EK60 echosounder, allowed parameters include:
`"sa_correction"`, `"gain_correction"`, `"equivalent_beam_angle"`
- for AZFP echosounder, allowed parameters include:
`"EL"`, `"DS"`, `"TVR"`, `"VTX"`, `"equivalent_beam_angle"`, `"Sv_offset"`
`"EL"`, `"DS"`, `"TVR"`, `"VTX0"`, `"equivalent_beam_angle"`, `"Sv_offset"`
Passing in calibration parameters for other echosounders
are not currently supported.
Expand Down Expand Up @@ -242,7 +242,7 @@ def compute_TS(echodata: EchoData, **kwargs):
- for EK60 echosounder, allowed parameters include:
`"sa_correction"`, `"gain_correction"`, `"equivalent_beam_angle"`
- for AZFP echosounder, allowed parameters include:
`"EL"`, `"DS"`, `"TVR"`, `"VTX"`, `"equivalent_beam_angle"`, `"Sv_offset"`
`"EL"`, `"DS"`, `"TVR"`, `"VTX0"`, `"equivalent_beam_angle"`, `"Sv_offset"`
Passing in calibration parameters for other echosounders
are not currently supported.
Expand Down
4 changes: 2 additions & 2 deletions echopype/calibrate/cal_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"impedance_transceiver", # z_er
"receiver_sampling_frequency",
),
"AZFP": ("EL", "DS", "TVR", "VTX", "equivalent_beam_angle", "Sv_offset"),
"AZFP": ("EL", "DS", "TVR", "VTX0", "equivalent_beam_angle", "Sv_offset"),
}

EK80_DEFAULT_PARAMS = {
Expand Down Expand Up @@ -352,7 +352,7 @@ def get_cal_params_AZFP(beam: xr.DataArray, vend: xr.DataArray, user_dict: dict)
out_dict[p] = beam[p] # has only channel dim

# Params from Vendor_specific group
elif p in ["EL", "DS", "TVR", "VTX", "Sv_offset"]:
elif p in ["EL", "DS", "TVR", "VTX0", "Sv_offset"]:
out_dict[p] = vend[p] # these params only have the channel dimension

return out_dict
Expand Down
2 changes: 1 addition & 1 deletion echopype/calibrate/calibrate_azfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def _cal_power_samples(self, cal_type, **kwargs):
# TODO: take care of dividing by zero encountered in log10
spreading_loss = 20 * np.log10(self.range_meter)
absorption_loss = 2 * self.env_params["sound_absorption"] * self.range_meter
SL = self.cal_params["TVR"] + 20 * np.log10(self.cal_params["VTX"]) # eq.(2)
SL = self.cal_params["TVR"] + 20 * np.log10(self.cal_params["VTX0"]) # eq.(2)

# scaling factor (slope) in Fig.G-1, units Volts/dB], see p.84
a = self.cal_params["DS"]
Expand Down
2 changes: 1 addition & 1 deletion echopype/calibrate/range.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def compute_range_AZFP(echodata: EchoData, env_params: Dict, cal_type: str) -> x
# Notation below follows p.86 of user manual
N = vend["number_of_samples_per_average_bin"] # samples per bin
f = vend["digitization_rate"] # digitization rate
L = vend["lockout_index"] # number of lockout samples
L = vend["lock_out_index"] # number of lockout samples

# keep this in ref of AZFP matlab code,
# set to 1 since we want to calculate from raw data
Expand Down
11 changes: 8 additions & 3 deletions echopype/clean/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
from .api import estimate_noise, remove_noise
from .api import get_impulse_noise_mask, get_transient_noise_mask, get_attenuation_mask
from .api import (
estimate_noise,
get_attenuation_mask,
get_impulse_noise_mask,
get_transient_noise_mask,
remove_noise,
)

__all__ = [
"estimate_noise",
"remove_noise",
"get_impulse_noise_mask",
"get_transient_noise_mask",
"get_attenuation_mask"
"get_attenuation_mask",
]
Loading

0 comments on commit 119e831

Please sign in to comment.