cf.relative_vorticity¶
-
cf.relative_vorticity(u, v, wrap=None, one_sided_at_boundary=False, radius=6371229.0, cyclic=None)[source]¶ Calculate the relative vorticity using centred finite differences. According to the formula given here:
https://www.ncl.ucar.edu/Document/Functions/Built-in/uv2vr_cfd.shtml
“According to H.B. Bluestein [Synoptic-Dynamic Meteorology in Midlatitudes, 1992, Oxford Univ. Press p113-114], 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 y-subscript, and i be the longitude x-subscript:
rv = Dv/Dx - Du/Dy + (u/a)*tan(phi)
- rv(j,i) = (v(j,i+1)-v(j,i-1))/dx2(j)
- (u(j+1,i)-u(j-1,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 non-cyclic boundaries may either be filled with missing values or calculated with off-centre finite differences.
Parameters: - u: cf.Field
A field containing the x-wind. Must be on the same grid as the y-wind.
- v: cf.Field
A field containing the y-wind. Must be on the same grid as the x-wind.
- radius: optional
The radius of the sphere when the winds are on a spherical polar coordinate domain. May be any numeric scalar object that can be converted to a
Dataobject (which includes numpy array andDataobjects). By default radius has a value of 6371229.0 metres, representing the Earth’s radius. If units are not specified then units of metres are assumed.- Parameter example:
Five equivalent ways to set a radius of 6371200 metres:
radius=6371200,radius=numpy.array(6371200),radius=cf.Data(6371200),radius=cf.Data(6371200, 'm'),radius=cf.Data(6371.2, 'km').
- wrap:
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 off-centre finite differences are calculated at the boundaries, otherwise missing values are used at the boundaries.
Returns: FieldThe relative vorticity calculated with centred finite differences.