mask_transient_noise

mask_transient_noise#

echopype.clean.mask_transient_noise(ds_Sv: Dataset, func: str = 'nanmean', depth_bin: str = '10m', num_side_pings: int = 25, exclude_above: str = '250.0m', transient_noise_threshold: str = '12.0dB', range_var: str = 'depth', use_index_binning: bool = False, chunk_dict: dict = {}) DataArray#

Locate and create a mask for transient noise using a pooling comparison.

Parameters
ds_Svxarray.Dataset

Calibrated Sv data with depth data variable.

func: str, default “nanmedian”

Pooling function used in the pooled Sv aggregation.

depth_binstr, default “10m”

Pooling bin size vertically along the vertical range variable (range_var).

num_side_pingsint, default 25

Number of side pings to look at for the pooling.

exclude_abovestr, default “250m”

Exclude all depth above (closer to the surface than) this value.

transient_noise_thresholdstr, default “10.0dB”

Transient noise threshold value (dB) for the pooling comparison.

range_varstr, default “depth”

Vertical Range Variable. Can be either depth or echo_range.

use_index_binningbool, default False

Speeds up aggregations by assuming depth is uniform and binning based on range_sample indices instead of depth values.

chunk_dictdict, default {}

Dictionary containing chunk sizes for use in the Dask-Image pooling function. Only used when use_index_binning=True.

Returns
xr.Dataset

Xarray boolean array transient noise mask.

References

This function’s implementation is based on the following text reference:

Ryan et al. (2015) Reducing bias due to noise and attenuation in open-ocean echo integration data, ICES Journal of Marine Science, 72: 2482–2493.

Additionally, this code was derived from echopy’s numpy single-channel implementation of transient noise masking and translated into xarray code: open-ocean-sounding/echopy # noqa

Examples

Default Transient Noise Mask Usage: Without using index binning along the vertical axis:

>>> mask_transient_noise(
>>>     ds_Sv
>>>     func="nanmean",
>>>     depth_bin = "10m",
>>>     num_side_pings = 25,
>>>     exclude_above = "250.0m",
>>>     transient_noise_threshold = "12.0dB",
>>>     range_var = "depth",
>>>     use_index_binning = False
>>> )

Vertical Index Binning Transient Noise Mask Usage with Chunking across Vertical and Horizontal Axis:

>>> mask_transient_noise(
>>>     ds_Sv
>>>     func="nanmean",
>>>     depth_bin = "10m",
>>>     num_side_pings = 25,
>>>     exclude_above = "250.0m",
>>>     transient_noise_threshold = "12.0dB",
>>>     range_var = "depth",
>>>     use_index_binning = True,
>>>     chunk_dict = {"ping_time": 1000, "range_sample": 50}
>>> )

To compute the pooled Sv, prior to the binning operation, the number of range sample indices needed to encapsulate “10m” will be calculated, and this number will be used to do a completely index based nanmean binning operation. This operation is exactly the same as applying a mean filter over an image, but in this case, it is applied to an Echogram.