From f28f609b49e2c48daee64b3991f155ae046ccfd8 Mon Sep 17 00:00:00 2001 From: Emilio Mayorga Date: Wed, 15 Mar 2023 14:26:37 -0700 Subject: [PATCH 1/3] Handling of non-positive values causing log10 warnings on EK calibration (#986) * Handle values <= 0 in calibration compute to eliminate log10 warnings. Set those values to np.nan --- echopype/calibrate/calibrate_ek.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/echopype/calibrate/calibrate_ek.py b/echopype/calibrate/calibrate_ek.py index a1b1fb7f4..56de116d7 100644 --- a/echopype/calibrate/calibrate_ek.py +++ b/echopype/calibrate/calibrate_ek.py @@ -65,6 +65,8 @@ def _cal_power_samples(self, cal_type: str, power_ed_group: str = None) -> xr.Da tvg_mod_range = range_mod_TVG_EK( self.echodata, self.ed_group, self.range_meter, sound_speed ) + tvg_mod_range = tvg_mod_range.where(tvg_mod_range > 0, np.nan) + spreading_loss = 20 * np.log10(tvg_mod_range) absorption_loss = 2 * absorption * tvg_mod_range @@ -375,11 +377,14 @@ def _cal_complex_samples(self, cal_type: str, complex_ed_group: str) -> xr.Datas # TVG compensation with modified range tvg_mod_range = range_mod_TVG_EK(self.echodata, self.ed_group, range_meter, sound_speed) + tvg_mod_range = tvg_mod_range.where(tvg_mod_range > 0, np.nan) + spreading_loss = 20 * np.log10(tvg_mod_range) absorption_loss = 2 * absorption * tvg_mod_range # Get power from complex samples prx = self._get_power_from_complex(beam=beam, chirp=tx, z_et=z_et, z_er=z_er) + prx = prx.where(prx > 0, np.nan) # Compute based on cal_type if cal_type == "Sv": From 8aca47523c87efb07a38d3184f3cfe211310f337 Mon Sep 17 00:00:00 2001 From: Wu-Jung Lee Date: Wed, 15 Mar 2023 15:35:57 -0700 Subject: [PATCH 2/3] fix bug to pass in env_params from parent class method (#987) --- echopype/calibrate/calibrate_ek.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/echopype/calibrate/calibrate_ek.py b/echopype/calibrate/calibrate_ek.py index 56de116d7..8b3e5198b 100644 --- a/echopype/calibrate/calibrate_ek.py +++ b/echopype/calibrate/calibrate_ek.py @@ -134,7 +134,7 @@ def __init__(self, echodata, env_params, cal_params, **kwargs): self.sonar_type = "EK60" # Get env_params - self.env_params = get_env_params_EK60(echodata=echodata, user_env_dict=env_params) + self.env_params = get_env_params_EK60(echodata=echodata, user_env_dict=self.env_params) self.waveform_mode = "CW" self.encode_mode = "power" From e65a92183cc3ae78f26bc498d87444395ba67a34 Mon Sep 17 00:00:00 2001 From: Wu-Jung Lee Date: Wed, 15 Mar 2023 21:29:37 -0700 Subject: [PATCH 3/3] Add what's new for v0.6.4.1 (#989) * add whats new in v0.6.4.1 * tweak wording --- docs/source/whats-new.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/source/whats-new.md b/docs/source/whats-new.md index 877f1ac29..9bcaf8368 100644 --- a/docs/source/whats-new.md +++ b/docs/source/whats-new.md @@ -4,6 +4,22 @@ What's new See [GitHub releases page](https://github.com/OSOceanAcoustics/echopype/releases) for the complete history. +# v0.6.4.1 (2023 March 15) + +## Overview + +This is a minor release that includes a small bug fix and an enhancement, which removes excessive warnings due to changes in v0.6.4. + +## Bug fix +- Fix a bug that prevented passing in `env_params` for EK60 calibration (#987) + +## Enhancement +- Handling non-positive values that causes log10 warnings on EK calibration (#986) + + + + + # v0.6.4 (2023 March 13) ## Overview