windwhisper.windspeed

Attributes

API_NEWA

FIXTURE_DIR

Classes

WindSpeed

Load wind speed data and derive turbine-specific mean profiles.

Functions

load_wind_speed_data(filepath_wind_speed[, ...])

Load hourly mean wind speed fields from disk or an array.

_download_single_turbine_data(name, turbine)

Download wind speed data for a single turbine location.

download_data(wind_turbines)

Fetch NEWA wind speed datasets for all turbines concurrently.

Module Contents

windwhisper.windspeed.API_NEWA
windwhisper.windspeed.FIXTURE_DIR
windwhisper.windspeed.load_wind_speed_data(filepath_wind_speed, filepath_correction=None, array=None)

Load hourly mean wind speed fields from disk or an array.

Parameters:
  • filepath_wind_speed (Path) – Path to the ERA5 mean wind speed NetCDF file.

  • filepath_correction (Path | None) – Optional correction factor NetCDF file.

  • array (xarray.DataArray | None) – In-memory wind speed dataset bypassing file loading.

Returns:

Hourly mean wind speed data indexed by latitude, longitude and height.

Return type:

xarray.DataArray

windwhisper.windspeed._download_single_turbine_data(name, turbine)

Download wind speed data for a single turbine location.

Parameters:
  • name (str) – Turbine identifier used for logging.

  • turbine (dict) – Turbine specification containing a position tuple.

Returns:

Simplified dataset containing the WS10 variable and the download size in kilobytes.

Return type:

tuple[xarray.Dataset, float]

Raises:

Exception – If the download fails after the configured attempts.

windwhisper.windspeed.download_data(wind_turbines)

Fetch NEWA wind speed datasets for all turbines concurrently.

Parameters:

wind_turbines (dict) – Turbine specifications keyed by identifier.

Returns:

Concatenated dataset indexed by turbine and time.

Return type:

xarray.DataArray

class windwhisper.windspeed.WindSpeed(wind_turbines, wind_speed_data=None)

Load wind speed data and derive turbine-specific mean profiles.

Parameters:
  • wind_turbines (dict)

  • wind_speed_data (xarray.DataArray | None)

wind_turbines
calculate_mean_speed()

Populate each turbine with an hourly mean wind speed profile.

Return type:

None