es_sfgtools.seafloor_site_tools.soundspeed_operations module

Functions for processing sound velocity profile (SVP) data from various sources.

es_sfgtools.seafloor_site_tools.soundspeed_operations.CTD_to_svp_v1(source: str | Path) DataFrame[SoundVelocityDataFrame]

Converts CTD data from a specified source file into a sound velocity profile DataFrame (version 1).

This function reads a CSV file, expecting two columns (depth and speed), and negates the depth values.

Parameters:

source (str or Path) – The path to the CTD data file.

Returns:

A DataFrame containing ‘depth’ and ‘speed’ columns.

Return type:

DataFrame[SoundVelocityDataFrame]

es_sfgtools.seafloor_site_tools.soundspeed_operations.CTD_to_svp_v2(source: str | Path) DataFrame[SoundVelocityDataFrame]

Converts CTD data from a specified source file into a sound velocity profile DataFrame (version 2).

This function reads a space-separated file, renames columns to ‘depth’ and ‘speed’, negates depth values, and applies a small random adjustment to speed values.

Parameters:

source (str or Path) – The path to the CTD data file.

Returns:

A DataFrame containing ‘depth’ and ‘speed’ columns.

Return type:

DataFrame[SoundVelocityDataFrame]

es_sfgtools.seafloor_site_tools.soundspeed_operations.interpolate_svp(svp: DataFrame, additional_depth: float = 200.0) DataFrame

Interpolates a sound velocity profile (SVP) DataFrame to ensure coverage down to a specified additional depth.

This function checks the maximum depth in the provided SVP DataFrame and, if necessary, extends the profile by adding interpolated values down to the specified additional depth.

Parameters:
  • svp (pd.DataFrame) – A DataFrame containing ‘depth’ and ‘speed’ columns.

  • additional_depth (float, default 200.0) – The additional depth (in meters) to extend the SVP profile.

Returns:

A DataFrame with the interpolated SVP data.

Return type:

pd.DataFrame

es_sfgtools.seafloor_site_tools.soundspeed_operations.seabird_to_soundvelocity(source: str | Path) DataFrame[SoundVelocityDataFrame]

Reads sound velocity profile data from a Seabird-formatted file.

The function expects a file where data starts after a line containing “END”. It extracts depth and speed values to create a SoundVelocityDataFrame.

Parameters:

source (str or Path) – The path to the Seabird data file.

Returns:

A DataFrame containing ‘depth’ and ‘speed’ columns.

Return type:

DataFrame[SoundVelocityDataFrame]

Raises:
  • FileNotFoundError – If the source file does not exist.

  • ValueError – If no data is found in the file after the “END” marker.