pywasp.tswc_rotate#

pywasp.tswc_rotate(tswc, rotation_angle_deg)[source]#

Rotate wind direction in a time series wind climate by a specific angle.

Rotates the wind direction values by the specified angle. Wind direction is normalized to the range [0, 360).

Parameters:
  • tswc (xarray.Dataset) – Dataset containing time series wind climate with ‘wind_direction’ and ‘wind_speed’ variables. Can have any pywasp spatial structure.

  • rotation_angle_deg (float or DataArray) – Angle to rotate in degrees (clockwise positive).

Returns:

xarray.Dataset – Dataset with rotated ‘wind_direction’ while preserving ‘wind_speed’ and any other variables.

Raises:

ValueError – If rotation_angle_deg is provided as an xr.DataArray and does not have the same spatial structure as tswc.