add_depth#
- echopype.consolidate.add_depth(ds: Union[Dataset, str, Path], depth_offset: float = 0, tilt: float = 0, downward: bool = 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
- dsxr.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_offsetfloat
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.
- tiltfloat
Transducer tilt angle [degree]. Default is 0 (transducer mounted vertically).
- downwardbool
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.