windwhisper

Submodules

Attributes

__version__

DATA_DIR

Classes

WindTurbines

Manage wind turbine specifications and noise emission predictions.

WindSpeed

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

NoisePropagation

Model sound propagation and attenuation for wind turbine layouts.

NoiseAnalysis

Aggregate noise propagation, ambient data and outputs for reporting.

HumanHealth

Evaluate human health impacts resulting from noise exposure.

Package Contents

windwhisper.__version__ = (0, 0, 1)
windwhisper.DATA_DIR
class windwhisper.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.

Parameters:
  • wind_turbines (dict)

  • model_file (str)

  • retrain_model (bool)

  • dataset_file (str)

  • wind_speed_data (xarray.DataArray | str)

  • elevation_data (xarray.DataArray | str)

  • humidity (int)

  • temperature (int)

noise_propagation = None
ws = None
wind_turbines
fetch_noise_level_vs_wind_speed()

Predict emission spectra for wind speeds between 3 and 12 m/s.

plot_noise_curve()

Plot modelled noise levels for all turbines and wind speeds.

fetch_wind_speeds(wind_speed_data=None)

Attach hourly wind speed profiles to each turbine specification.

Parameters:

wind_speed_data (xarray.DataArray | str | None) – Precomputed dataset or path used to initialise windwhisper.windspeed.WindSpeed.

class windwhisper.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

class windwhisper.NoisePropagation(wind_turbines, humidity=70, temperature=20, elevation_data=None)

Model sound propagation and attenuation for wind turbine layouts.

Parameters:
  • wind_turbines (dict)

  • humidity (float)

  • temperature (float)

  • elevation_data (xarray.Dataset)

incr_noise_att = None
noise_attenuation = None
elevation_grid = None
haversine_distances = None
listeners = 70
wind_turbines
elevation_data = None
noise_level_at_wind_speeds
hourly_noise_levels
l_den
l_night
incr_noise_att_night
calculate_hourly_noise_levels()

Interpolate hourly emission levels for each turbine.

compute_lden()

Calculate the day-evening-night noise level from hourly levels.

Returns:

Lden noise level raster.

Return type:

xarray.DataArray

compute_lnight()

Calculate the night noise level from hourly levels.

Returns:

Lnight noise level raster.

Return type:

xarray.DataArray

calculate_incremental_noise_attenuation(noise)

Apply successive attenuation terms to the emission raster.

Parameters:

noise (xarray.DataArray) – Base noise level raster to which attenuations are applied.

Returns:

Dataset containing intermediate attenuation stages.

Return type:

xarray.Dataset

get_noise_emissions_vs_time_or_speed(noise, coord_name, coord_value)

Aggregate turbine emissions along the requested dimension.

Parameters:
  • noise (numpy.ndarray) – Noise levels per turbine for each coordinate value.

  • coord_name (str) – Name of the output coordinate ("wind_speed" or "hour").

  • coord_value (numpy.ndarray) – Coordinate values associated with the emissions.

Returns:

Noise levels summed over all turbines for each grid cell.

Return type:

xarray.DataArray

noise_map_at_wind_speeds(noise)

Backward compatible alias for get_noise_emissions_vs_time_or_speed().

Parameters:

noise (numpy.ndarray) – Noise levels per turbine for each wind speed.

Returns:

Noise map aggregated across turbines for each wind speed.

Return type:

xarray.DataArray

abstract calculate_sound_level_at_distance(*args, **kwargs)

Deprecated compatibility wrapper for legacy APIs.

Raises:

NotImplementedError – Always raised to direct users to get_noise_emissions_vs_time_or_speed().

superimpose_wind_turbines_noise()

Deprecated alias returning the aggregated wind speed noise map.

calculate_noise_attenuation_terms()

Compute distance, atmospheric, ground and obstacle attenuation.

plot_noise_map(dimension='wind_speed')

Display interactive contour plots of turbine noise levels.

Parameters:

dimension (str) – Dimension to explore ("wind_speed" or "hour").

class windwhisper.NoiseAnalysis(noise_propagation, wind_turbines, listeners=None)

Aggregate noise propagation, ambient data and outputs for reporting.

noise_propagation
wind_turbines
l_den
l_night
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.

Return type:

tuple[xarray.Dataset, xarray.Dataset]

generate_map(filepath='noise_map.html')

Render interactive HTML maps for Lden and Lnight rasters.

Parameters:

filepath (str) – Base filepath for the generated HTML maps.

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.

Return type:

tuple[Any, Any, Any, Any, Any]

class windwhisper.HumanHealth(noiseanalysis, lifetime=20)

Evaluate human health impacts resulting from noise exposure.

Parameters:
lifetime = 20
load_factor
electricity_production
population
noiseanalysis
disease_data
human_health_parameters
population_rate
human_health_wo_turbines
human_health_per_kWh_wo_turbines
human_health
human_health_per_kWh
get_disease_totals(disease)

Return YLD and YLL totals for the active country.

Parameters:

disease (str) – Disease identifier (e.g. "ischemic_heart_disease").

Returns:

Tuple containing the YLD and YLL values.

Return type:

tuple[float, float]

Raises:

ValueError – If no statistics are available for the disease.

calculate_highly_annoyed_dalys(lden, noise_type_ha)

Calculate DALYs for the highly annoyed indicator.

Parameters:
  • lden (xarray.DataArray) – Day-evening-night noise level raster.

  • noise_type_ha (str) – Human health parameter set identifier.

Returns:

DALY raster for the highly annoyed population.

Return type:

xarray.DataArray

calculate_high_sleep_disorder_dalys(lnight, noise_type_hsd)

Calculate DALYs for the high sleep disorder indicator.

Parameters:
  • lnight (xarray.DataArray) – Night noise level raster.

  • noise_type_hsd (str) – Human health parameter set identifier.

Returns:

DALY raster for the high sleep disorder population.

Return type:

xarray.DataArray

calculate_ihd_dalys(lden, noise_type)

Calculate DALYs attributable to ischemic heart disease.

Parameters:
  • lden (xarray.DataArray) – Day-evening-night noise level raster.

  • noise_type (str) – Human health parameter set identifier.

Returns:

DALY raster for ischemic heart disease.

Return type:

xarray.DataArray

calculate_diabetes_dalys(lden, noise_type)

Calculate DALYs attributable to diabetes.

Parameters:
  • lden (xarray.DataArray) – Day-evening-night noise level raster.

  • noise_type (str) – Human health parameter set identifier.

Returns:

DALY raster for diabetes.

Return type:

xarray.DataArray

calculate_stroke_dalys(lden, noise_type)

Calculate DALYs attributable to stroke.

Parameters:
  • lden (xarray.DataArray) – Day-evening-night noise level raster.

  • noise_type (str) – Human health parameter set identifier.

Returns:

DALY raster for stroke.

Return type:

xarray.DataArray

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.

Parameters:
  • lden (xarray.DataArray) – Day-evening-night noise level raster.

  • lnight (xarray.DataArray) – Night noise level raster.

  • noise_type_ha (str) – Parameter set for the highly annoyed metric.

  • noise_type_hsd (str) – Parameter set for the sleep disorder metric.

  • noise_type (str) – Parameter set for chronic disease metrics.

Returns:

Dataset containing the DALY layers for each impact.

Return type:

xarray.Dataset

export_to_excel(filepath='human_health_results.xlsx')

Export human health inputs and results to an Excel workbook.

Parameters:

filepath (str) – Destination path for the generated workbook.

Return type:

None