Skip to content

Commit

Permalink
Merge 7cc5a8e into 89ca403
Browse files Browse the repository at this point in the history
  • Loading branch information
uvchik committed Feb 26, 2020
2 parents 89ca403 + 7cc5a8e commit dbbd4c3
Show file tree
Hide file tree
Showing 16 changed files with 218 additions and 81 deletions.
2 changes: 1 addition & 1 deletion .stickler.yml
Expand Up @@ -3,7 +3,7 @@ linters:
python: 3
max-line-length: 79
select: C,E,F,W,B,B950
ignore: E203, E501, W503
ignore: E203, E501, W503, F401
black:
config: ./pyproject.toml
fixer: true
Expand Down
3 changes: 3 additions & 0 deletions README.rst
Expand Up @@ -8,6 +8,9 @@
:target: https://mybinder.org/v2/gh/wind-python/windpowerlib/dev?filepath=example
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black

.. image:: https://img.shields.io/lgtm/grade/python/g/wind-python/windpowerlib.svg?logo=lgtm&logoWidth=18
:target: https://lgtm.com/projects/g/wind-python/windpowerlib/context:python

Introduction
=============
Expand Down
62 changes: 62 additions & 0 deletions doc/getting_started.rst
Expand Up @@ -13,6 +13,9 @@ Getting started
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black

.. image:: https://img.shields.io/lgtm/grade/python/g/wind-python/windpowerlib.svg?logo=lgtm&logoWidth=18
:target: https://lgtm.com/projects/g/wind-python/windpowerlib/context:python

Introduction
=============

Expand Down Expand Up @@ -84,6 +87,12 @@ You can also look at the examples in the :ref:`examples_section_label` section.
Wind turbine data
==================

The windpowerlib provides data of many wind turbines but it is also possible to
use your own turbine data.

Use internal data
~~~~~~~~~~~~~~~~~

The windpowerlib provides `wind turbine data <https://github.com/wind-python/windpowerlib/tree/master/windpowerlib/oedb>`_
(power curves, hub heights, etc.) for a large set of wind turbines. See `Initialize wind turbine` in :ref:`examples_section_label` on how
to use this data in your simulations.
Expand All @@ -96,9 +105,62 @@ To update your local files with the latest version of the `oedb turbine library
from windpowerlib.wind_turbine import load_turbine_data_from_oedb
load_turbine_data_from_oedb()
If you find your turbine in the database it is very easy to use it in the
windpowerlib

.. code:: python
from windpowerlib import WindTurbine
enercon_e126 = {
"turbine_type": "E-126/4200", # turbine type as in register
"hub_height": 135, # in m
}
e126 = WindTurbine(**enercon_e126)
We would like to encourage anyone to contribute to the turbine library by adding turbine data or reporting errors in the data.
See `here <https://github.com/OpenEnergyPlatform/data-preprocessing/issues/28>`_ for more information on how to contribute.

Use your own turbine data
~~~~~~~~~~~~~~~~~~~~~~~~~

It is possible to use your own power curve. However, the most sustainable way
is to send us the data to be included in the windpowerlib and to be available
for all users. This may not be possible in all cases.

Assuming the data files looks like this:

.. code::
wind,power
0.0,0.0
3.0,39000.0
5.0,270000.0
10.0,2250000.0
15.0,4500000.0
25.0,4500000.0
You can use pandas to read the file and pass it to the turbine dictionary. I
you have basic knowledge of pandas it is easy to use any kind of data file.

.. code:: python
import pandas as pd
from windpowerlib import WindTurbine, create_power_curve
my_data = pd.read_csv("path/to/my/data/file.csv")
my_turbine_data = {
"nominal_power": 6e6, # in W
"hub_height": 115, # in m
"power_curve": create_power_curve(
wind_speed=my_data["wind"], power=my_data["power"]
),
}
my_turbine = WindTurbine(**my_turbine2)
See the `modelchain_example` for more information.


Contributing
==============

Expand Down
2 changes: 1 addition & 1 deletion example/modelchain_example.ipynb
Expand Up @@ -288,7 +288,7 @@
"source": [
"# specification of wind turbine where power coefficient curve and nominal\n",
"# power is provided in an own csv file\n",
"csv_path = 'data'\n",
"csv_path = ''\n",
"dummy_turbine = {\n",
" 'turbine_type': 'DUMMY 1', # turbine type as in file\n",
" 'hub_height': 100, # in m\n",
Expand Down

0 comments on commit dbbd4c3

Please sign in to comment.