# add_depth

echopype.consolidate. add_depth ds: True Dataset

Create a depth data variable based on data in Sv dataset.

The depth is generated based on whether the transducers are mounted vertically or with a polar angle to vertical, and whether the transducers were pointed up or down.

Parameters

- ds : xr.Dataset or str or pathlib.Path

  Source Sv dataset or path to a file containing the Source Sv dataset to which a depth variable will be added. Must contain echo_range.

- depth_offset : float

  Offset along the vertical (depth) dimension to account for actual transducer position in water, since echo_range is counted from transducer surface. Default is 0.

- tilt : float

  Transducer tilt angle [degree]. Default is 0 (transducer mounted vertically).

- downward : bool

  Whether or not the transducers point downward. Default to True.

Returns

- The input dataset with a depth variable (in meters) added

Notes

Currently this function only scalar inputs of depth_offset and tilt angle. In future expansion we plan to add the following options:

- Allow inputs as xr.DataArray for time-varying variations of these variables

- Use data stored in the EchoData object or raw-converted file from which the Sv is derived, specifically water_level, vertical_offtset and tilt in the Platform group.