windwhisper.windspeed ===================== .. py:module:: windwhisper.windspeed Attributes ---------- .. autoapisummary:: windwhisper.windspeed.API_NEWA windwhisper.windspeed.FIXTURE_DIR Classes ------- .. autoapisummary:: windwhisper.windspeed.WindSpeed Functions --------- .. autoapisummary:: windwhisper.windspeed.load_wind_speed_data windwhisper.windspeed._download_single_turbine_data windwhisper.windspeed.download_data Module Contents --------------- .. py:data:: API_NEWA .. py:data:: FIXTURE_DIR .. py:function:: load_wind_speed_data(filepath_wind_speed, filepath_correction = None, array = None) Load hourly mean wind speed fields from disk or an array. :param filepath_wind_speed: Path to the ERA5 mean wind speed NetCDF file. :type filepath_wind_speed: Path :param filepath_correction: Optional correction factor NetCDF file. :type filepath_correction: Path | None :param array: In-memory wind speed dataset bypassing file loading. :type array: xarray.DataArray | None :returns: Hourly mean wind speed data indexed by latitude, longitude and height. :rtype: xarray.DataArray .. py:function:: _download_single_turbine_data(name, turbine) Download wind speed data for a single turbine location. :param name: Turbine identifier used for logging. :type name: str :param turbine: Turbine specification containing a ``position`` tuple. :type turbine: dict :returns: Simplified dataset containing the ``WS10`` variable and the download size in kilobytes. :rtype: tuple[xarray.Dataset, float] :raises Exception: If the download fails after the configured attempts. .. py:function:: download_data(wind_turbines) Fetch NEWA wind speed datasets for all turbines concurrently. :param wind_turbines: Turbine specifications keyed by identifier. :type wind_turbines: dict :returns: Concatenated dataset indexed by turbine and time. :rtype: xarray.DataArray .. py:class:: WindSpeed(wind_turbines, wind_speed_data = None) Load wind speed data and derive turbine-specific mean profiles. .. py:attribute:: wind_turbines .. py:method:: calculate_mean_speed() Populate each turbine with an hourly mean wind speed profile.