uxarray.UxDataArray.gradient#
- UxDataArray.gradient(**kwargs)#
Computes the gradient of a data variable.
- Returns:
gradient – Dataset containing the zonal and merdional components of the gradient.
- Return type:
Notes
The Green-Gauss theorm is utilized, where a closed control volume around each cell is formed connecting centroids of the neighboring cells. The surface integral is approximated using the trapezoidal rule. The sum of the contributions is then normalized by the cell volume.
Example
>>> uxds["var"].gradient()