EchoData#

class echopype.echodata.EchoData(converted_raw_path: Optional[PathHint] = None, storage_options: Optional[Dict[str, Any]] = None, source_file: Optional[PathHint] = None, xml_path: Optional[PathHint] = None, sonar_model: Optional[SonarModelsHint] = None, open_kwargs: Optional[Dict[str, Any]] = None)#

Bases: object

Echo data model class for handling raw converted data, including multiple files associated with the same data set.

Attributes
group_paths
nbytes
nc_path
version_info
zarr_path

Methods

cleanup_swap_files()

Clean up the swap files during raw data conversion

to_netcdf([save_path, compress, overwrite, ...])

Save content of EchoData to netCDF.

to_zarr([save_path, compress, overwrite, ...])

Save content of EchoData to zarr.

update_platform(extra_platform_data[, ...])

Updates the EchoData["Platform"] group with additional external platform data.

from_file

Attributes Summary

group_map

group_paths

nbytes

nc_path

version_info

zarr_path

Methods Summary

cleanup_swap_files()

Clean up the swap files during raw data conversion

from_file(converted_raw_path[, ...])

to_netcdf([save_path, compress, overwrite, ...])

Save content of EchoData to netCDF.

to_zarr([save_path, compress, overwrite, ...])

Save content of EchoData to zarr.

update_platform(extra_platform_data[, ...])

Updates the EchoData["Platform"] group with additional external platform data.

Attributes Documentation

group_map: Dict[str, Any] = {'beam': {'description': 'contains backscatter data (either complex samples or uncalibrated power samples) and other beam or channel-specific data, including split-beam angle data when they exist.', 'ep_group': 'Sonar/Beam_group1', 'name': 'Beam_group1'}, 'beam_group3': {'description': '', 'ep_group': 'Sonar/Beam_group3', 'name': 'Beam_group3'}, 'beam_group4': {'description': '', 'ep_group': 'Sonar/Beam_group4', 'name': 'Beam_group4'}, 'beam_power': {'description': 'contains backscatter power (uncalibrated) and other beam or channel-specific data, including split-beam angle data when they exist. Only exists if complex backscatter data are already in Sonar/Beam_group1', 'ep_group': 'Sonar/Beam_group2', 'name': 'Beam_group2'}, 'environment': {'description': 'contains information relevant to acoustic propagation through water.', 'ep_group': 'Environment', 'name': 'Environment'}, 'nmea': {'description': 'contains information specific to the NMEA protocol.', 'ep_group': 'Platform/NMEA', 'name': 'NMEA'}, 'platform': {'description': 'contains information about the platform on which the sonar is installed.', 'ep_group': 'Platform', 'name': 'Platform'}, 'provenance': {'description': 'contains metadata about how the SONAR-netCDF4 version of the data were obtained.', 'ep_group': 'Provenance', 'name': 'Provenance'}, 'sonar': {'description': 'contains sonar system metadata and sonar beam groups.', 'ep_group': 'Sonar', 'name': 'Sonar'}, 'top': {'description': 'contains metadata about the SONAR-netCDF4 file format.', 'ep_group': None, 'name': 'Top-level'}, 'vendor': {'description': 'contains vendor-specific information about the sonar and the data.', 'ep_group': 'Vendor_specific', 'name': 'Vendor_specific'}}#
group_paths#
nbytes#
nc_path#
version_info#
zarr_path#

Methods Documentation

cleanup_swap_files()#

Clean up the swap files during raw data conversion

classmethod from_file(converted_raw_path: str, storage_options: Optional[Dict[str, Any]] = None, open_kwargs: Dict[str, Any] = {}) EchoData#
to_netcdf(save_path: Optional[PathHint] = None, compress: bool = True, overwrite: bool = False, parallel: bool = False, output_storage_options: Dict[str, str] = {}, **kwargs)#

Save content of EchoData to netCDF.

Parameters
save_pathstr

path that converted .nc file will be saved

compressbool

whether or not to perform compression on data variables Defaults to True

overwritebool

whether or not to overwrite existing files Defaults to False

parallelbool

whether or not to use parallel processing. (Not yet implemented)

output_storage_optionsdict

Additional keywords to pass to the filesystem class.

**kwargsdict, optional

Extra arguments to xr.Dataset.to_netcdf: refer to xarray’s documentation for a list of all possible arguments.

to_zarr(save_path: Optional[PathHint] = None, compress: bool = True, overwrite: bool = False, parallel: bool = False, output_storage_options: Dict[str, str] = {}, consolidated: bool = True, **kwargs)#

Save content of EchoData to zarr.

Parameters
save_pathstr

path that converted .nc file will be saved

compressbool

whether or not to perform compression on data variables Defaults to True

overwritebool

whether or not to overwrite existing files Defaults to False

parallelbool

whether or not to use parallel processing. (Not yet implemented)

output_storage_optionsdict

Additional keywords to pass to the filesystem class.

consolidatedbool

Flag to consolidate zarr metadata. Defaults to True

**kwargsdict, optional

Extra arguments to xr.Dataset.to_zarr: refer to xarray’s documentation for a list of all possible arguments.

update_platform(extra_platform_data: Dataset, variable_mappings=typing.Dict[str, str], extra_platform_data_file_name=None)#

Updates the EchoData[“Platform”] group with additional external platform data.

extra_platform_data must be an xarray Dataset. Data is extracted from extra_platform_data by variable name. Only data assigned to a pre-existing (but possibly all-nan) variable name in Platform will be processed. These Platform variables include latitude, longitude, pitch, roll, vertical_offset, etc. See the variables present in the EchoData object’s Platform group to obtain a complete list of possible variables. Different external variables may be dependent on different time dimensions, but latitude and longitude (if specified) must share the same time dimension. New time dimensions will be added as needed. For example, if variables to be added from the external data use two time dimensions and the Platform group has time dimensions time2 and time2, new dimensions time3 and time4 will be created.

Parameters
extra_platform_dataxr.Dataset

An xr.Dataset containing the additional platform data to be added to the EchoData[“Platform”] group.

variable_mappings: Dict[str,str]

A dictionary mapping Platform variable names (dict key) to the external-data variable name (dict value).

extra_platform_data_file_name: str, default=None

File name for source of extra platform data, if read from a file

Examples

>>> ed = echopype.open_raw(raw_file, "EK60")
>>> extra_platform_data = xr.open_dataset(extra_platform_data_file_name)
>>> ed.update_platform(
>>>     extra_platform_data,
>>>     variable_mappings={"longitude": "lon", "latitude": "lat", "roll": "ROLL"},
>>>     extra_platform_data_file_name=extra_platform_data_file_name
>>> )