uxarray.UxDataArray.curl

uxarray.UxDataArray.curl#

UxDataArray.curl(other, scale_by_radius=True)#

Computes the curl of the vector field defined by this UxDataArray and other, in the horizontal direction (i.e., along the unstructured grid dimension).

The formula is: curl(u,v) = ∂v/∂x - ∂u/∂y + u·tan(φ)/a, where u, x correspond to the zonal direction; v, y the meridional direction; φ=latitude; and a=sphere radius.

Parameters:
  • self (UxDataArray) – The zonal (u) component of the vector field. Data must be face-centered.

  • other (UxDataArray) – The meridional (v) component of the vector field. Data must be face-centered, and must have other.uxgrid == self.uxgrid.

  • scale_by_radius (bool, default=True) –

    Whether to divide unit-sphere derivatives by uxgrid.sphere_radius. When True (and the grid’s sphere_radius is set correctly), the result carries physical units: [u units]/meter (e.g. result has units of 1/s if u represents velocity). When False (or if the grid’s sphere_radius is set to 1.0), the result caries per-radian units: [u units]/radian. (e.g. result has units of (m/s)/rad if u represents velocity).

    CAUTION: this scaling does not account for any radius increases due to vertical levels; it simply divides by uxgrid.sphere_radius.

Returns:

curl – The curl of the vector field (self, other), as a UxDataArray. Units determined by scale_by_radius.

Return type:

UxDataArray

Notes

The curl is computed using the existing gradient infrastructure. For a 2D vector field (u, v), the curl is a scalar field representing the rotation or circulation density at each point.

Example

>>> u_component = uxds["u_wind"]
>>> v_component = uxds["v_wind"]
>>> curl_field = u_component.curl(v_component)