Sound Speed

Sound speed module within the kadlu package

class kadlu.sound.sound_speed.SoundSpeed(ocean=None, ssp=None, num_depths=50, rel_err=0.001, time=None)[source]

Bases: object

Class for handling computation and interpolation of sound speed.

The sound speed can be specified via the argument ssp (sound speed profile) or computed from the ocean variables (temperature, salinity).

ssp can be either a single value, in which case the sound speed is the same everywhere, or a tuple (c,z) where c is an array of sound speed values and z is an array of depths.

The interp and interp_xyz method may be used to obtain the interpolated sound speed at any set of coordinates.

TODO: provide proper implementation of time/epoch handling. TODO: SoundSpeed should inherit from BaseGeospatialInterpolator

Args:
ocean: instance of kadlu.geospatial.ocean.Ocean

Ocean variables

ssp: float or tuple

Sound speed profile. May be specified either as a float, in which case the sound speed is the same everywhere, or as a tuple (c,z) where c is an array of sound speeds and z is an array of depth values.

num_depths: int

Number of depth values for the interpolation grid. The default value is 50.

rel_err: float

Maximum deviation of the interpolation, expressed as a ratio of the range of sound-speed values. The default value is 0.001.

kadlu.sound.sound_speed.sound_speed_teos10(lats, lons, z, t, SP)[source]

Compute sound speed from temperature, salinity, and depth for a given latitude and longitude using the Thermodynamic Equation of Seawater 2010.

https://teos-10.github.io/GSW-Python/

Args:
lats: numpy array

Latitudes (-90 to 90 degrees)

lons: numpy array

Longitudes (-180 to 180 degrees)

z: numpy array

Depths (meters)

t: numpy array

In-situ temperature (Celsius)

SP: numpy array

Practical Salinity (psu)

Returns:
c: numpy array

Sound speed (m/s)