Skip to content

Ocean Current

Derived ocean current variables computed from the eastward (u) and northward (v) horizontal current components.


cspd — Current speed

Returns sea water speed (m/s) as √(u² + v²).

Parameter Default Description
ucur "ucur" Eastward current component variable name
vcur "vcur" Northward current component variable name
derived_vars:
  - name: cspd
    func: cspd
    ucur: uo   # override if your dataset uses different names
    vcur: vo

cdir — Current direction

Returns sea water going-to direction in degrees (oceanographic convention: 0° = northward, 90° = eastward).

Parameter Default Description
ucur "ucur" Eastward current component variable name
vcur "vcur" Northward current component variable name
derived_vars:
  - name: cdir
    func: cdir
    ucur: uo
    vcur: vo

API reference

gridstats.derived.current.cspd(ds: xr.Dataset, *, ucur: str = 'ucur', vcur: str = 'vcur') -> xr.DataArray

Sea water speed from eastward/northward current components.

Parameters:

Name Type Description Default
ds Dataset

Input dataset.

required
ucur str

Name of the eastward current component variable.

'ucur'
vcur str

Name of the northward current component variable.

'vcur'

Returns:

Type Description
DataArray

Current speed DataArray (m/s).

gridstats.derived.current.cdir(ds: xr.Dataset, *, ucur: str = 'ucur', vcur: str = 'vcur') -> xr.DataArray

Sea water going-to direction from eastward/northward current components.

Parameters:

Name Type Description Default
ds Dataset

Input dataset.

required
ucur str

Name of the eastward current component variable.

'ucur'
vcur str

Name of the northward current component variable.

'vcur'

Returns:

Type Description
DataArray

Current direction DataArray (degrees, going-to oceanographic convention).