Geostrophy

Functions for calculating geostrophic currents.

gsw.geostrophy.distance(lon, lat, p=0, axis=-1)[source]

Great-circle distance in m between lon, lat points.

Parameters
lon, latarray-like, 1-D or 2-D (shapes must match)

Longitude, latitude, in degrees.

parray-like, scalar, 1-D or 2-D, optional, default is 0

Sea pressure (absolute pressure minus 10.1325 dbar), dbar

axisint, -1, 0, 1, optional

The axis or dimension along which lat and lon vary. This differs from most functions, for which axis is the dimension along which p increases.

Returns
distance1-D or 2-D array

distance in meters between adjacent points.

gsw.geostrophy.f(lat)[source]

Coriolis parameter in 1/s for latitude in degrees.

gsw.geostrophy.geo_strf_dyn_height(SA, CT, p, p_ref=0, axis=0, max_dp=1.0, interp_method='pchip')[source]

Dynamic height anomaly as a function of pressure.

Parameters
SAarray-like

Absolute Salinity, g/kg

CTarray-like

Conservative Temperature (ITS-90), degrees C

parray-like

Sea pressure (absolute pressure minus 10.1325 dbar), dbar

p_reffloat or array-like, optional

Reference pressure, dbar

axisint, optional, default is 0

The index of the pressure dimension in SA and CT.

max_dpfloat

If any pressure interval in the input p exceeds max_dp, the dynamic height will be calculated after interpolating to a grid with this spacing.

interp_methodstring {‘pchip’, ‘linear’}

Interpolation algorithm.

Returns
dynamic_heightarray

This is the integral of specific volume anomaly with respect to pressure, from each pressure in p to the specified reference pressure. It is the geostrophic streamfunction in an isobaric surface, relative to the reference surface.

gsw.geostrophy.geostrophic_velocity(geo_strf, lon, lat, p=0, axis=0)[source]

Calculate geostrophic velocity from a streamfunction.

Calculates geostrophic velocity relative to a reference pressure, given a geostrophic streamfunction and the position of each station in sequence along an ocean section. The data can be from a single isobaric or “density” surface, or from a series of such surfaces.

Parameters
geo_strfarray-like, 1-D or 2-D

geostrophic streamfunction; see Notes below.

lonarray-like, 1-D

Longitude, -360 to 360 degrees

latarray-like, 1-D

Latitude, degrees

pfloat or array-like, optional

Sea pressure (absolute pressure minus 10.1325 dbar), dbar. This used only for a tiny correction in the distance calculation; it is safe to omit it.

axisint, 0 or 1, optional

The axis or dimension along which pressure increases in geo_strf. If geo_strf is 1-D, it is ignored.

Returns
velocityarray, 2-D or 1-D

Geostrophic velocity in m/s relative to the sea surface, averaged between each successive pair of positions.

mid_lon, mid_latarray, 1-D

Midpoints of input lon and lat.

Notes

The geostrophic streamfunction can be:

  • geo_strf_dyn_height (in an isobaric surface)

  • geo_strf_Montgomery (in a specific volume anomaly surface)

  • geo_strf_Cunninhgam (in an approximately neutral surface such as a potential density surface).

  • geo_strf_isopycnal (in an approximately neutral surface such as a potential density surface, a Neutral Density surface, or an omega surface (Klocker et al., 2009)).

Only geo_strf_dyn_height() is presently implemented in GSW-Python.