windwhisper.windturbines
Wind turbine specifications, model training and emission estimation.
Classes
Manage wind turbine specifications and noise emission predictions. |
Functions
|
Train the wind turbine noise emission model. |
|
Load a previously trained wind turbine emission model. |
|
Validate user-provided turbine specifications. |
Module Contents
- windwhisper.windturbines.train_wind_turbine_model(file_path=None)
Train the wind turbine noise emission model.
- Parameters:
file_path (str | None) – Optional path to the training CSV file.
- Returns:
Trained scikit-learn model and the list of noise column names.
- Return type:
tuple[sklearn.base.RegressorMixin, list[str]]
- Raises:
FileNotFoundError – If the training dataset cannot be located.
ValueError – When the provided file is not a CSV file.
- windwhisper.windturbines.load_model(filepath=None)
Load a previously trained wind turbine emission model.
- Parameters:
filepath (str | Path | None) – Optional path to the
.skopsmodel archive.- Returns:
Trained model and the list of noise column names.
- Return type:
tuple[sklearn.base.RegressorMixin, list[str]]
- Raises:
FileNotFoundError – If the model archive does not exist.
- windwhisper.windturbines.check_wind_turbine_specs(wind_turbines)
Validate user-provided turbine specifications.
- Parameters:
wind_turbines (dict) – Mapping of turbine identifiers to specification dictionaries.
- Returns:
Normalised turbine specifications with numeric values.
- Return type:
dict
- Raises:
KeyError – If a required field is missing.
ValueError – If numeric fields are invalid or positions are malformed.
- class windwhisper.windturbines.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.