detect_seafloor

detect_seafloor#

echopype.mask.detect_seafloor(ds: Dataset, method: str, params: Dict) DataArray#

Dispatch seafloor detection to a chosen method and return a 1-D bottom line.

This function forwards ds and params to the selected implementation (e.g., "basic", "blackwell"). Any optional arguments omitted in params are filled by that method’s defaults.

Parameters:
dsxr.Dataset

Dataset containing calibrated Sv and required coordinates (at minimum ping_time and a vertical coordinate such as depth), plus any extra variables required by the chosen method.

methodstr
Name of the detection method to use. Supported:
  • "basic" → threshold-only detector

  • "blackwell" → Sv + split-beam angle detector

paramsdict

Method-specific keyword arguments (see below). Unspecified keys use the method’s defaults.

Returns:
xr.DataArray

1-D bottom depth per ping_time (no channel dimension). The output name and attributes are set by the called method.

Raises:
ValueError

If method is not supported.

Examples

>>> detect_seafloor(ds, "basic", {
...     "var_name": "Sv", "channel": "GPT  38 kHz ...",
...     "threshold": -50, "offset_m": 0.5, "bin_skip_from_surface": 200
... })
>>> detect_seafloor(ds, "blackwell", {
...     "channel": "GPT  38 kHz ...", "threshold": (-75, 0.02, 0.02),
...     "offset": 0.3, "r0": 0, "r1": 600, "wtheta": 28, "wphi": 52
... })