windpowerlib.wind_turbine.WindTurbine

class windpowerlib.wind_turbine.WindTurbine(hub_height, nominal_power=None, path='oedb', power_curve=None, power_coefficient_curve=None, rotor_diameter=None, turbine_type=None, **kwargs)[source]

Defines a standard set of wind turbine attributes.

Parameters:
  • hub_height (float) – Hub height of the wind turbine in m.
  • power_curve (pandas.DataFrame or dict (optional)) – If provided directly sets the power curve. DataFrame/dictionary must have ‘wind_speed’ and ‘value’ columns/keys with wind speeds in m/s and the corresponding power curve value in W. If not set the value is retrieved from ‘power_curve.csv’ file in path. In that case a turbine_type is needed. Default: None.
  • power_coefficient_curve (pandas.DataFrame or dict (optional)) – If provided directly sets the power coefficient curve. DataFrame/dictionary must have ‘wind_speed’ and ‘value’ columns/keys with wind speeds in m/s and the corresponding power coefficient curve value. If not set the value is retrieved from ‘power_coefficient_curve.csv’ file in path. In that case a turbine_type is needed. Default: None.
  • turbine_type (str (optional)) – Name of the wind turbine type. Must be provided if power (coefficient) curve, nominal power or rotor diameter is retrieved from self-provided or oedb turbine library csv files. If turbine_type is None it is not possible to retrieve turbine data from file. Use get_turbine_types() to see a table of all wind turbines for which power (coefficient) curve data and other turbine data is provided in the oedb turbine library. Default: None.
  • rotor_diameter (float (optional)) – Diameter of the rotor in m. If not set the value is retrieved from ‘turbine_data.csv’ file in path. In that case a turbine_type is needed. The rotor diameter only needs to be set if power output is calculated using the power coefficient curve. Default: None.
  • nominal_power (float (optional)) – The nominal power of the wind turbine in W. If not set the value is retrieved from ‘turbine_data.csv’ file in path. In that case a turbine_type is needed. Default: None.
  • path (str (optional)) – Directory where the turbine database files are located. The files need to be named ‘power_coefficient_curve.csv’, ‘power_curve.csv’, and ‘turbine_data.csv’. By default the oedb turbine library files are used. Set path to None to ignore turbine data from files. Default: ‘oedb’.
turbine_type

Name of the wind turbine.

Type:str
hub_height

Hub height of the wind turbine in m.

Type:float
rotor_diameter

Diameter of the rotor in m. Default: None.

Type:None or float
power_coefficient_curve

Power coefficient curve of the wind turbine. DataFrame/dictionary containing ‘wind_speed’ and ‘value’ columns/keys with wind speeds in m/s and the corresponding power coefficients. Default: None.

Type:None, pandas.DataFrame or dictionary
power_curve

Power curve of the wind turbine. DataFrame/dictionary containing ‘wind_speed’ and ‘value’ columns/keys with wind speeds in m/s and the corresponding power curve value in W. Default: None.

Type:None, pandas.DataFrame or dictionary
nominal_power

The nominal output of the wind turbine in W. Default: None.

Type:None or float

Notes

Your wind turbine object needs to have a power coefficient or power curve. By default they are fetched from the oedb turbine library that is provided along with the windpowerlib. In that case turbine_type must be specified. You can also set the curves directly or provide your own csv files with power coefficient and power curves. See example_power_curves.csv’, `example_power_coefficient_curves.csv and example_turbine_data.csv in example/data for the required format of such csv files.

Examples

>>> import os
>>> from windpowerlib import WindTurbine
>>> enerconE126={
...    'hub_height': 135,
...    'turbine_type': 'E-126/4200'}
>>> e126=WindTurbine(**enerconE126)
>>> print(e126.nominal_power)
4200000.0
>>> # Example with own path
>>> path=os.path.join(os.path.dirname(__file__), '../tests/data')
>>> example_turbine={
...    'hub_height': 100,
...    'rotor_diameter': 70,
...    'turbine_type': 'DUMMY 3',
...    'path' : path}
>>> e_t_1=WindTurbine(**example_turbine)
>>> print(e_t_1.power_curve['value'][7])
18000.0
>>> print(e_t_1.nominal_power)
1500000.0
__init__(hub_height, nominal_power=None, path='oedb', power_curve=None, power_coefficient_curve=None, rotor_diameter=None, turbine_type=None, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(hub_height[, nominal_power, path, …]) Initialize self.
to_group([number_turbines, total_capacity]) Creates a WindTurbineGroup, a NamedTuple data container with the fields ‘number_of_turbines’ and ‘wind_turbine’.