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

Update outdated comments #102

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 24 additions & 10 deletions echopype/mask/seabed.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,12 @@ def _blackwell(Sv_ds: xr.DataArray, desired_channel: str, parameters: dict = MAX
below = np.zeros((len(r) - r1, maskchunk.shape[1]), dtype=bool)
mask = np.r_[above, maskchunk, below]

# return empty mask if aliased-seabed was not detected in Theta & Phi
# give empty mask if aliased-seabed was not detected in Theta & Phi
else:
warnings.warn("No aliased seabed detected in Theta & Phi. Returning empty mask.")
warnings.warn(
"No aliased seabed detected in Theta & Phi. "
"A default mask with all True values is returned."
)
mask = np.zeros_like(Sv, dtype=bool)

mask = np.logical_not(mask.T)
Expand Down Expand Up @@ -423,9 +426,12 @@ def _blackwell_mod(
if r0 > r1:
raise Exception("Minimum range has to be shorter than maximum range")

# return empty mask if searching range is outside the echosounder range
# give empty mask if searching range is outside the echosounder range
if (r0 > r[-1]) or (r1 < r[0]):
warnings.warn("Search range is outside the echosounder range. Returning empty mask.")
warnings.warn(
"Search range is outside the echosounder range."
"A default mask with all True values is returned."
)
mask = np.zeros_like(Sv, dtype=bool)

# delimit the analysis within user-defined range limits
Expand Down Expand Up @@ -485,9 +491,12 @@ def _blackwell_mod(
below = np.zeros((len(r) - i1, maskchunk.shape[1]), dtype=bool)
mask = np.r_[above, maskchunk, below]

# return empty mask if aliased-seabed was not detected in Theta & Phi
# give empty mask if aliased-seabed was not detected in Theta & Phi
else:
warnings.warn("Aliased seabed not detected in Theta & Phi. Returning empty mask.")
warnings.warn(
"Aliased seabed not detected in Theta & Phi."
"A default mask with all True values is returned."
)
mask = np.zeros_like(Sv, dtype=bool)

mask = np.logical_not(mask.T)
Expand Down Expand Up @@ -708,9 +717,12 @@ def _ariza(Sv_ds: xr.DataArray, desired_channel: str, parameters: dict = MAX_SV_
if r0 > r1:
raise Exception("Minimum range has to be shorter than maximum range")

# return empty mask if searching range is outside the echosounder range
# give empty mask if searching range is outside the echosounder range
if (r0 > r[-1]) or (r1 < r[0]):
warnings.warn("Search range is outside the echosounder range. Returning empty mask.")
warnings.warn(
"Search range is outside the echosounder range. "
"A default mask with all True values is returned."
)
mask = np.zeros_like(Sv, dtype=bool)

# get indexes for range offset and range limits
Expand All @@ -723,9 +735,11 @@ def _ariza(Sv_ds: xr.DataArray, desired_channel: str, parameters: dict = MAX_SV_
Sv_[0:r0, :] = -999
Sv_[r1:, :] = -999

# return empty mask if there is nothing above threshold
# give empty mask if there is nothing above threshold
if not (Sv_ > thr).any():
warnings.warn("Nothing found above the threshold. Returning empty mask.")
warnings.warn(
"Nothing found above the threshold. " "A default mask with all True values is returned."
)
mask = np.zeros_like(Sv_, dtype=bool)

# search for seabed otherwise
Expand Down
Loading