metpy.calc.
divergence
Calculate the horizontal divergence of a vector.
u ((…, M, N) xarray.DataArray or pint.Quantity) – x component of the vector
xarray.DataArray
pint.Quantity
v ((…, M, N) xarray.DataArray or pint.Quantity) – y component of the vector
dx (pint.Quantity, optional) – The grid spacing(s) in the x-direction. If an array, there should be one item less than the size of u along the applicable axis. Optional if xarray.DataArray with latitude/longitude coordinates used as input. Keyword-only argument.
dy (pint.Quantity, optional) – The grid spacing(s) in the y-direction. If an array, there should be one item less than the size of u along the applicable axis. Optional if xarray.DataArray with latitude/longitude coordinates used as input. Keyword-only argument.
x_dim (int, optional) – Axis number of x dimension. Defaults to -1 (implying […, Y, X] order). Automatically parsed from input if using xarray.DataArray. Keyword-only argument.
y_dim (int, optional) – Axis number of y dimension. Defaults to -2 (implying […, Y, X] order). Automatically parsed from input if using xarray.DataArray. Keyword-only argument.
(…, M, N) xarray.DataArray or pint.Quantity – The horizontal divergence
Changed in version 1.0: Changed signature from (u, v, dx, dy)
(u, v, dx, dy)
See also
vorticity