EchoData

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

Bases: object

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

Attributes Summary

group_map
nc_path
zarr_path

Methods Summary

compute_range([env_params, azfp_cal_type, …]) Computes the range of the data contained in this EchoData object, in meters.
raw2nc(save_path, combine_opt, overwrite, …)
raw2zarr(save_path, combine_opt, overwrite, …)
to_netcdf(save_path, **kwargs) Save content of EchoData to netCDF.
to_zarr(save_path, **kwargs) Save content of EchoData to zarr.

Attributes Documentation

group_map = {'beam': {'description': 'contains backscatter data and other beam or channel-specific data.', 'ep_group': 'Beam', 'name': 'Beam'}, 'beam_power': {'description': 'contains backscatter data (power-only) and other beam or channel-specific data.', 'ep_group': 'Beam_power', 'name': 'Beam Power'}, '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': 'Platform/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 specific metadata for the sonar system.', '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', 'name': 'Vendor specific'}}
nc_path
zarr_path

Methods Documentation

compute_range(env_params=None, azfp_cal_type=None, ek_waveform_mode=None, ek_encode_mode='complex')

Computes the range of the data contained in this EchoData object, in meters.

This method only applies to sonar_model`s of `”AZFP”, “EK60”, and “EK80”. If the sonar_model is not “AZFP”, “EK60”, or “EK80”, an error is raised.

Parameters:
env_params: dict

This dictionary should contain either: - “sound_speed”: float - “temperature”, “salinity”, and “pressure”: float`s, in which case the sound speed will be calculated. If the `sonar_model is “EK60” or “EK80”, and EchoData.environment.sound_speed_indicative exists, then this parameter does not need to be specified.

azfp_cal_type : {“Sv”, “Sp”}, optional
  • “Sv” for calculating volume backscattering strength
  • “Sp” for calculating point backscattering strength.

This parameter is only used if sonar_model is “AZFP”, and in that case it must be specified.

ek_waveform_mode : {“CW”, “BB”}, optional
  • “CW” for CW-mode samples, either recorded as complex or power samples
  • “BB” for BB-mode samples, recorded as complex samples

This parameter is only used if sonar_model is “EK60” or “EK80”, and in those cases it must be specified.

ek_encode_mode : {“complex”, “power”}, optional

For EK80 data, range can be computed from complex or power samples. The type of sample used can be specified with this parameter. - “complex” to use complex samples - “power” to use power samples This parameter is only used if sonar_model is “EK80”.

Returns:
xr.DataArray

The range of the data in meters.

Raises:
ValueError
  • When sonar_model is “AZFP” but azfp_cal_type is not specified or is None.
  • When sonar_model is “EK60” or “EK80” but ek_waveform_mode

is not specified or is None. - When sonar_model is “EK60” but waveform_mode is “BB” (EK60 cannot have broadband samples). - When sonar_model is “AZFP” and env_params does not contain either “sound_speed” or all of “temperature”, “salinity”, and “pressure”. - When sonar_model is “EK60” or “EK80”, EchoData.environment.sound_speed_indicative does not exist, and env_params does not contain either “sound_speed” or all of “temperature”, “salinity”, and “pressure”. - When sonar_model is not “AZFP”, “EK60”, or “EK80”.

raw2nc(save_path: PathHint = None, combine_opt: bool = False, overwrite: bool = False, compress: bool = True)
raw2zarr(save_path: PathHint = None, combine_opt: bool = False, overwrite: bool = False, compress: bool = True)
to_netcdf(save_path: Optional[PathHint] = None, **kwargs)

Save content of EchoData to netCDF.

Parameters:
save_path : str

path that converted .nc file will be saved

compress : bool

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

overwrite : bool

whether or not to overwrite existing files Defaults to False

parallel : bool

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

output_storage_options : dict

Additional keywords to pass to the filesystem class.

to_zarr(save_path: Optional[PathHint] = None, **kwargs)

Save content of EchoData to zarr.

Parameters:
save_path : str

path that converted .nc file will be saved

compress : bool

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

overwrite : bool

whether or not to overwrite existing files Defaults to False

parallel : bool

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

output_storage_options : dict

Additional keywords to pass to the filesystem class.