windwhisper =========== .. py:module:: windwhisper Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/windwhisper/ambient_noise/index /autoapi/windwhisper/atmospheric_absorption/index /autoapi/windwhisper/electricity_production/index /autoapi/windwhisper/elevation_grid/index /autoapi/windwhisper/geometric_divergence/index /autoapi/windwhisper/ground_attenuation/index /autoapi/windwhisper/health_impacts/index /autoapi/windwhisper/noiseanalysis/index /autoapi/windwhisper/noisepropagation/index /autoapi/windwhisper/plotting/index /autoapi/windwhisper/settlement/index /autoapi/windwhisper/utils/index /autoapi/windwhisper/windspeed/index /autoapi/windwhisper/windturbines/index Attributes ---------- .. autoapisummary:: windwhisper.__version__ windwhisper.DATA_DIR Classes ------- .. autoapisummary:: windwhisper.WindTurbines windwhisper.WindSpeed windwhisper.NoisePropagation windwhisper.NoiseAnalysis windwhisper.HumanHealth Package Contents ---------------- .. py:data:: __version__ :value: (0, 0, 1) .. py:data:: DATA_DIR .. py:class:: WindTurbines(wind_turbines, model_file = None, retrain_model = False, dataset_file = None, wind_speed_data = None, elevation_data = None, humidity = 70, temperature = 10) Manage wind turbine specifications and noise emission predictions. .. py:attribute:: noise_propagation :value: None .. py:attribute:: ws :value: None .. py:attribute:: wind_turbines .. py:method:: fetch_noise_level_vs_wind_speed() Predict emission spectra for wind speeds between 3 and 12 m/s. .. py:method:: plot_noise_curve() Plot modelled noise levels for all turbines and wind speeds. .. py:method:: fetch_wind_speeds(wind_speed_data = None) Attach hourly wind speed profiles to each turbine specification. :param wind_speed_data: Precomputed dataset or path used to initialise :class:`windwhisper.windspeed.WindSpeed`. :type wind_speed_data: xarray.DataArray | str | None .. 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. .. py:class:: NoisePropagation(wind_turbines, humidity = 70, temperature = 20, elevation_data = None) Model sound propagation and attenuation for wind turbine layouts. .. py:attribute:: incr_noise_att :value: None .. py:attribute:: noise_attenuation :value: None .. py:attribute:: elevation_grid :value: None .. py:attribute:: haversine_distances :value: None .. py:attribute:: listeners :value: 70 .. py:attribute:: wind_turbines .. py:attribute:: elevation_data :value: None .. py:attribute:: noise_level_at_wind_speeds .. py:attribute:: hourly_noise_levels .. py:attribute:: l_den .. py:attribute:: l_night .. py:attribute:: incr_noise_att_night .. py:method:: calculate_hourly_noise_levels() Interpolate hourly emission levels for each turbine. .. py:method:: compute_lden() Calculate the day-evening-night noise level from hourly levels. :returns: Lden noise level raster. :rtype: xarray.DataArray .. py:method:: compute_lnight() Calculate the night noise level from hourly levels. :returns: Lnight noise level raster. :rtype: xarray.DataArray .. py:method:: calculate_incremental_noise_attenuation(noise) Apply successive attenuation terms to the emission raster. :param noise: Base noise level raster to which attenuations are applied. :type noise: xarray.DataArray :returns: Dataset containing intermediate attenuation stages. :rtype: xarray.Dataset .. py:method:: get_noise_emissions_vs_time_or_speed(noise, coord_name, coord_value) Aggregate turbine emissions along the requested dimension. :param noise: Noise levels per turbine for each coordinate value. :type noise: numpy.ndarray :param coord_name: Name of the output coordinate (``"wind_speed"`` or ``"hour"``). :type coord_name: str :param coord_value: Coordinate values associated with the emissions. :type coord_value: numpy.ndarray :returns: Noise levels summed over all turbines for each grid cell. :rtype: xarray.DataArray .. py:method:: noise_map_at_wind_speeds(noise) Backward compatible alias for :meth:`get_noise_emissions_vs_time_or_speed`. :param noise: Noise levels per turbine for each wind speed. :type noise: numpy.ndarray :returns: Noise map aggregated across turbines for each wind speed. :rtype: xarray.DataArray .. py:method:: calculate_sound_level_at_distance(*args, **kwargs) :abstractmethod: Deprecated compatibility wrapper for legacy APIs. :raises NotImplementedError: Always raised to direct users to :meth:`get_noise_emissions_vs_time_or_speed`. .. py:method:: superimpose_wind_turbines_noise() Deprecated alias returning the aggregated wind speed noise map. .. py:method:: calculate_noise_attenuation_terms() Compute distance, atmospheric, ground and obstacle attenuation. .. py:method:: plot_noise_map(dimension = 'wind_speed') Display interactive contour plots of turbine noise levels. :param dimension: Dimension to explore (``"wind_speed"`` or ``"hour"``). :type dimension: str .. py:class:: NoiseAnalysis(noise_propagation, wind_turbines, listeners=None) Aggregate noise propagation, ambient data and outputs for reporting. .. py:attribute:: noise_propagation .. py:attribute:: wind_turbines .. py:attribute:: l_den .. py:attribute:: l_night .. py:method:: merge_maps() Merge ambient and propagation rasters into combined datasets. :returns: Tuple ``(merged_dataset, merged_dataset_night)`` containing Lden and Lnight datasets with ambient, wind, combined, net and flip layers. :rtype: tuple[xarray.Dataset, xarray.Dataset] .. py:method:: generate_map(filepath='noise_map.html') Render interactive HTML maps for Lden and Lnight rasters. :param filepath: Base filepath for the generated HTML maps. :type filepath: str .. py:method:: get_geojson_contours() Create GeoJSON contour layers for the combined noise outputs. :returns: Tuple containing GeoJSON objects for daytime and night-time combined, ambient and net layers plus the coordinate reference system string. :rtype: tuple[Any, Any, Any, Any, Any] .. py:class:: HumanHealth(noiseanalysis, lifetime = 20) Evaluate human health impacts resulting from noise exposure. .. py:attribute:: lifetime :value: 20 .. py:attribute:: load_factor .. py:attribute:: electricity_production .. py:attribute:: population .. py:attribute:: noiseanalysis .. py:attribute:: disease_data .. py:attribute:: human_health_parameters .. py:attribute:: population_rate .. py:attribute:: human_health_wo_turbines .. py:attribute:: human_health_per_kWh_wo_turbines .. py:attribute:: human_health .. py:attribute:: human_health_per_kWh .. py:method:: get_disease_totals(disease) Return YLD and YLL totals for the active country. :param disease: Disease identifier (e.g. ``"ischemic_heart_disease"``). :type disease: str :returns: Tuple containing the YLD and YLL values. :rtype: tuple[float, float] :raises ValueError: If no statistics are available for the disease. .. py:method:: calculate_highly_annoyed_dalys(lden, noise_type_ha) Calculate DALYs for the highly annoyed indicator. :param lden: Day-evening-night noise level raster. :type lden: xarray.DataArray :param noise_type_ha: Human health parameter set identifier. :type noise_type_ha: str :returns: DALY raster for the highly annoyed population. :rtype: xarray.DataArray .. py:method:: calculate_high_sleep_disorder_dalys(lnight, noise_type_hsd) Calculate DALYs for the high sleep disorder indicator. :param lnight: Night noise level raster. :type lnight: xarray.DataArray :param noise_type_hsd: Human health parameter set identifier. :type noise_type_hsd: str :returns: DALY raster for the high sleep disorder population. :rtype: xarray.DataArray .. py:method:: calculate_ihd_dalys(lden, noise_type) Calculate DALYs attributable to ischemic heart disease. :param lden: Day-evening-night noise level raster. :type lden: xarray.DataArray :param noise_type: Human health parameter set identifier. :type noise_type: str :returns: DALY raster for ischemic heart disease. :rtype: xarray.DataArray .. py:method:: calculate_diabetes_dalys(lden, noise_type) Calculate DALYs attributable to diabetes. :param lden: Day-evening-night noise level raster. :type lden: xarray.DataArray :param noise_type: Human health parameter set identifier. :type noise_type: str :returns: DALY raster for diabetes. :rtype: xarray.DataArray .. py:method:: calculate_stroke_dalys(lden, noise_type) Calculate DALYs attributable to stroke. :param lden: Day-evening-night noise level raster. :type lden: xarray.DataArray :param noise_type: Human health parameter set identifier. :type noise_type: str :returns: DALY raster for stroke. :rtype: xarray.DataArray .. py:method:: calculate_total_dalys(lden, lnight, noise_type_ha = 'road_without_alpinestudies', noise_type_hsd = 'combined', noise_type = 'road middle') Aggregate DALY layers across all health indicators. :param lden: Day-evening-night noise level raster. :type lden: xarray.DataArray :param lnight: Night noise level raster. :type lnight: xarray.DataArray :param noise_type_ha: Parameter set for the highly annoyed metric. :type noise_type_ha: str :param noise_type_hsd: Parameter set for the sleep disorder metric. :type noise_type_hsd: str :param noise_type: Parameter set for chronic disease metrics. :type noise_type: str :returns: Dataset containing the DALY layers for each impact. :rtype: xarray.Dataset .. py:method:: export_to_excel(filepath = 'human_health_results.xlsx') Export human health inputs and results to an Excel workbook. :param filepath: Destination path for the generated workbook. :type filepath: str