Skip to content

Commit

Permalink
Fixed an array issue (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruxandra-valcu authored Dec 6, 2023
1 parent a378be5 commit defe1f6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion echopype/mask/seabed.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,6 @@ def _blackwell(Sv_ds: xr.DataArray, desired_channel: str, parameters: dict = MAX

# calculate rank percentile Sv of angle-masked regions, and mask Sv above
Sv_masked = Sv.where(angle_mask)
# anglemasked_threshold = Sv_masked.median(skipna=True).item()
anglemasked_threshold = dask_nanpercentile(Sv_masked.values, rank)

if np.isnan(anglemasked_threshold):
Expand Down Expand Up @@ -637,4 +636,6 @@ def _blackwell(Sv_ds: xr.DataArray, desired_channel: str, parameters: dict = MAX
# get threshold mask with shallow and deep waters masked
range_filter = (mask["range_sample"] >= up) & (mask["range_sample"] <= lw)
mask = mask.where(range_filter, other=True)
mask.data = mask.data.compute()

return mask
3 changes: 1 addition & 2 deletions echopype/mask/shoal.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,5 @@ def _weill(
).compute()
dask_mask = da.asarray(dask_mask, allow_unknown_chunksizes=False)

mask.values = dask_mask.compute()

mask.data = dask_mask.compute()
return mask
1 change: 0 additions & 1 deletion echopype/tests/mask/test_mask_seabed.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
ARIZA_EXPERIMENTAL_DEFAULT_PARAMS,
BLACKWELL_DEFAULT_PARAMS,
BLACKWELL_MOD_DEFAULT_PARAMS,

)

DESIRED_CHANNEL = "GPT 38 kHz 009072033fa5 1 ES38"
Expand Down

0 comments on commit defe1f6

Please sign in to comment.