Skip to content

Commit

Permalink
Merge fcbd378 into 89ca403
Browse files Browse the repository at this point in the history
  • Loading branch information
uvchik committed Mar 10, 2020
2 parents 89ca403 + fcbd378 commit 5c1eb17
Show file tree
Hide file tree
Showing 26 changed files with 380 additions and 141 deletions.
63 changes: 62 additions & 1 deletion 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 Expand Up @@ -82,8 +85,14 @@ You can also look at the examples in the `Examples section <http://windpowerlib.
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. Have a look at the `example <http://windpowerlib.readthedocs.io/en/stable/modelchain_example_notebook.html#Initialize-wind-turbine>`_ on how
(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.

The dataset is hosted and maintained on the `OpenEnergy database <https://openenergy-platform.org/dataedit/>`_ (oedb).
Expand All @@ -94,9 +103,61 @@ 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
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 5c1eb17

Please sign in to comment.