cf.relative_vorticity¶

cf.
relative_vorticity
(u, v, cyclic=None, one_sided_at_boundary=False)[source]¶ Calculate the relative vorticity using centred finite differences. According to the formula given here:
https://www.ncl.ucar.edu/Document/Functions/Builtin/uv2vr_cfd.shtml
“According to H.B. Bluestein [SynopticDynamic Meteorology in Midlatitudes, 1992, Oxford Univ. Press p113114], let D represent the partial derivative, a the radius of the earth, phi the latitude and dx2/dy2 the appropriate longitudinal and latitudinal spacing, respectively. Then, letting j be the latitude ysubscript, and i be the longitude xsubscript:
rv = Dv/Dx  Du/Dy + (u/a)*tan(phi)
 rv(j,i) = (v(j,i+1)v(j,i1))/dx2(j)
 (u(j+1,i)u(j1,i))/dy2(j)
 (u(j,i)/a)*tan(phi(j))
The last term accounts for the convergence of the meridians on a sphere.”
The grid may be global or limited area. If missing values are present then missing values will be returned at points where the centred finite difference could not be calculated. The boundary conditions may be cyclic in longitude. The noncyclic boundaries may either be filled with missing values or calculated with offcentre finite differences.
Parameters:  u: cf.Field
A field containing the xwind. Must be on the same grid as the ywind.
 v: cf.Field
A field containing the ywind. Must be on the same grid as the xwind.
 cyclic:
bool
, optional Whether the longitude is cyclic or not. By default this is autodetected.
 one_sided_at_boundary:
bool
, optional If True then if the field is not cyclic offcentre finite differences are calculated at the boundaries, otherwise missing values are used at the boundaries.
Returns:  rv: cf.Field
The relative vorticity calculated with centred finite differences.