windkit.shear_exponent#

windkit.shear_exponent(da)[source]#

Compute the shear exponent from vertical wind speed profiles using finite differences in log-space.

Parameters:

da (xarray.DataArray) – Wind speed DataArray. The DataArray must contain a height coordinate and horizontal coordinates (‘west_east’, ‘south_north’) or be convertible to that structure. Wind speeds must be positive.

Returns:

The shear exponent computed as (d ln u) / (d ln z) at log-space midpoints between input heights. The returned DataArray has the same spatial structure as the input and only contains the points where valid shear calculations could be made.

Return type:

xarray.DataArray

Raises:

ValueError – If the input cannot be converted to a point/vertical structure by windkit.spatial.to_point.

Notes

  • The function sorts profiles by (west_east, south_north, height) and computes backward finite differences along the “point” axis.

  • Midpoint heights are computed in log-space and assigned to the output shear DataArray.

Examples

>>> shear = shear_exponent(da)