Skip to content

Commit

Permalink
Xarray/seabed (#134)
Browse files Browse the repository at this point in the history
* Ariza conversion and initial version of ariza_interactive

* Added xarray mask transformations

* Added experimental secondary thressholding support

* Added shoal demasking option for ariza (they show up as "spikes" in the mask)

* Stash

* Functional blackwell

* Functional blackwell

* For merge reasons

* Blackwell can now take custom percentile values

* Implemented modified Blackwell

* Fixed requirements.txt
  • Loading branch information
ruxandra-valcu authored Dec 5, 2023
1 parent fa1a3b0 commit 4a8a324
Show file tree
Hide file tree
Showing 7 changed files with 745 additions and 570 deletions.
22 changes: 7 additions & 15 deletions echopype/mask/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,9 @@ def get_seabed_mask(
a Dataset. This input must correspond to a Dataset that has the
coordinate ``channel`` and variables ``frequency_nominal`` and ``Sv``.
desired_channel: str - channel to generate the mask for
desired_freuency: int - desired frequency, in case the channel isn't directly specified
method: str with either "ariza", "experimental", "blackwell_mod",
"blackwell", "deltaSv", "maxSv"
based on the preferred method for seabed mask generation
desired_frequency: int - desired frequency, in case the channel isn't directly specified
method: str with either "ariza", "blackwell", based on the preferred method
for seabed mask generation
Returns
-------
xr.DataArray
Expand All @@ -574,8 +573,7 @@ def get_seabed_mask(
Raises
------
ValueError
If neither "ariza", "experimental", "blackwell_mod",
"blackwell", "deltaSv", "maxSv" are given
If neither "ariza", "blackwell" are given
Notes
-----
Expand All @@ -588,11 +586,7 @@ def get_seabed_mask(
source_Sv = get_dataset(source_Sv)
mask_map = {
"ariza": seabed._ariza,
"experimental": seabed._experimental,
"blackwell": seabed._blackwell,
"blackwell_mod": seabed._blackwell_mod,
"delta_Sv": seabed._deltaSv,
"max_Sv": seabed._maxSv,
}

if method not in mask_map.keys():
Expand Down Expand Up @@ -621,9 +615,8 @@ def get_seabed_mask_multichannel(
else it specifies the path to a zarr or netcdf file containing
a Dataset. This input must correspond to a Dataset that has the
coordinate ``channel`` and variables ``frequency_nominal`` and ``Sv``.
method: str with either "ariza", "experimental", "blackwell_mod",
"blackwell", "deltaSv", "maxSv"
based on the preferred method for seabed mask generation
method: str with either "ariza", "blackwell"
based on the preferred method for seabed mask generation
Returns
-------
xr.DataArray
Expand All @@ -633,8 +626,7 @@ def get_seabed_mask_multichannel(
Raises
------
ValueError
If neither "ariza", "experimental", "blackwell_mod",
"blackwell", "deltaSv", "maxSv" are given
If neither "ariza" or "blackwell" are given
Notes
-----
Expand Down
Loading

0 comments on commit 4a8a324

Please sign in to comment.