Kinematic Calculations¶
metpy.calc.kinematics
¶
-
metpy.calc.kinematics.
v_vorticity
(u, v, dx, dy)¶ Calculate the vertical vorticity of the horizontal wind.
The grid must have a constant spacing in each direction.
Parameters: - u ((X, Y) ndarray) – x component of the wind
- v ((X, Y) ndarray) – y component of the wind
- dx (float) – The grid spacing in the x-direction
- dy (float) – The grid spacing in the y-direction
Returns: vertical vorticity
Return type: (X, Y) ndarray
See also
-
metpy.calc.kinematics.
h_convergence
(u, v, dx, dy)¶ Calculate the horizontal convergence of the horizontal wind.
The grid must have a constant spacing in each direction.
Parameters: - u ((X, Y) ndarray) – x component of the wind
- v ((X, Y) ndarray) – y component of the wind
- dx (float) – The grid spacing in the x-direction
- dy (float) – The grid spacing in the y-direction
Returns: The horizontal convergence
Return type: (X, Y) ndarray
See also
-
metpy.calc.kinematics.
convergence_vorticity
(u, v, dx, dy)¶ Calculate the horizontal convergence and vertical vorticity of the horizontal wind.
The grid must have a constant spacing in each direction.
Parameters: - u ((X, Y) ndarray) – x component of the wind
- v ((X, Y) ndarray) – y component of the wind
- dx (float) – The grid spacing in the x-direction
- dy (float) – The grid spacing in the y-direction
Returns: convergence, vorticity – The horizontal convergence and vertical vorticity, respectively
Return type: tuple of (X, Y) ndarrays
See also
Notes
This is a convenience function that will do less work than calculating the horizontal convergence and vertical vorticity separately.
-
metpy.calc.kinematics.
advection
(scalar, wind, deltas)¶ Calculate the advection of a scalar field by the wind.
The order of the dimensions of the arrays must match the order in which the wind components are given. For example, if the winds are given [u, v], then the scalar and wind arrays must be indexed as x,y (which puts x as the rows, not columns).
Parameters: - scalar (N-dimensional array) – Array (with N-dimensions) with the quantity to be advected.
- wind (sequence of arrays) – Length N sequence of N-dimensional arrays. Represents the flow, with a component of the wind in each dimension. For example, for horizontal advection, this could be a list: [u, v], where u and v are each a 2-dimensional array.
- deltas (sequence) – A (length N) sequence containing the grid spacing in each dimension.
Returns: An N-dimensional array containing the advection at all grid points.
Return type: N-dimensional array
-
metpy.calc.kinematics.
geostrophic_wind
(heights, f, dx, dy, geopotential=False)¶ Calculate the geostrophic wind given from the heights.
Parameters: - heights ((x,y) ndarray) – The height field, given with leading dimensions of x by y. There can be trailing dimensions on the array. These are assumed in meters and will be scaled by gravity.
- f (array_like) – The coriolis parameter in s^-1. This can be a scalar to be applied everywhere or an array of values.
- dx (scalar) – The grid spacing in the x-direction in meters.
- dy (scalar) – The grid spacing in the y-direction in meters.
Returns: A tuple of the x-component and y-component of the geostropic wind in m s^-1.
Return type: A 2-item tuple of arrays
Other Parameters: geopotential (boolean, optional) – If true, the heights are assumed to actually be values of geopotential, in units of m^2 s^-2, and the values will not be scaled by gravity.
-
metpy.calc.kinematics.
tke
(u, v, w)¶ Compute the turbulence kinetic energy (tke) from the time series of the velocity components.
Parameters: - u (array_like) – The wind component along the x-axis
- v (array_like) – The wind component along the y-axis
- w (array_like) – The wind componennt along the z-axis
Returns: The corresponding tke value(s)
Return type: array_like