In [1]:
!git clone https://gitlab.windenergy.dtu.dk/TOPFARM/PyWake.git


Cloning into 'PyWake'...
remote: Enumerating objects: 382, done.
remote: Counting objects: 100% (382/382), done.
remote: Compressing objects: 100% (239/239), done.
remote: Total 382 (delta 182), reused 293 (delta 131)
Receiving objects: 100% (382/382), 4.34 MiB | 3.24 MiB/s, done.
Resolving deltas: 100% (182/182), done.

PyWake


In [0]:
%cd /content/PyWake
!pip install -e .


/content/PyWake
Obtaining file:///content/PyWake
Requirement already satisfied: matplotlib in /usr/local/lib/python3.6/dist-packages (from py-wake==1.0) (2.1.2)
Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from py-wake==1.0) (1.14.6)
Requirement already satisfied: pytest in /usr/local/lib/python3.6/dist-packages (from py-wake==1.0) (3.10.1)
Collecting pytest-cov (from py-wake==1.0)
  Downloading https://files.pythonhosted.org/packages/30/0a/1b009b525526cd3cd9f52f52391b426c5a3597447be811a10bcb1f6b05eb/pytest_cov-2.6.0-py2.py3-none-any.whl
Requirement already satisfied: pyyaml in /usr/local/lib/python3.6/dist-packages (from py-wake==1.0) (3.13)
Requirement already satisfied: scipy in /usr/local/lib/python3.6/dist-packages (from py-wake==1.0) (1.1.0)
Requirement already satisfied: sphinx in /usr/local/lib/python3.6/dist-packages (from py-wake==1.0) (1.8.2)
Collecting sphinx_rtd_theme (from py-wake==1.0)
  Downloading https://files.pythonhosted.org/packages/ef/0c/e4a462190506bc4bff6ca8cf93da07b2d13e540466d2e8a760352d0c69b0/sphinx_rtd_theme-0.4.2-py2.py3-none-any.whl (6.4MB)
    100% |████████████████████████████████| 6.4MB 4.6MB/s 
Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->py-wake==1.0) (2.5.3)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->py-wake==1.0) (2.3.0)
Requirement already satisfied: six>=1.10 in /usr/local/lib/python3.6/dist-packages (from matplotlib->py-wake==1.0) (1.11.0)
Requirement already satisfied: pytz in /usr/local/lib/python3.6/dist-packages (from matplotlib->py-wake==1.0) (2018.7)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.6/dist-packages (from matplotlib->py-wake==1.0) (0.10.0)
Requirement already satisfied: pluggy>=0.7 in /usr/local/lib/python3.6/dist-packages (from pytest->py-wake==1.0) (0.8.0)
Requirement already satisfied: atomicwrites>=1.0 in /usr/local/lib/python3.6/dist-packages (from pytest->py-wake==1.0) (1.2.1)
Requirement already satisfied: attrs>=17.4.0 in /usr/local/lib/python3.6/dist-packages (from pytest->py-wake==1.0) (18.2.0)
Requirement already satisfied: py>=1.5.0 in /usr/local/lib/python3.6/dist-packages (from pytest->py-wake==1.0) (1.7.0)
Requirement already satisfied: more-itertools>=4.0.0 in /usr/local/lib/python3.6/dist-packages (from pytest->py-wake==1.0) (4.3.0)
Requirement already satisfied: setuptools in /usr/local/lib/python3.6/dist-packages (from pytest->py-wake==1.0) (40.6.3)
Collecting coverage>=4.4 (from pytest-cov->py-wake==1.0)
  Downloading https://files.pythonhosted.org/packages/a4/5c/b3eac6aa7eb4af83c8580d9c1578343910bdcc59e64e3565402f9a527f9c/coverage-4.5.2-cp36-cp36m-manylinux1_x86_64.whl (205kB)
    100% |████████████████████████████████| 215kB 28.3MB/s 
Requirement already satisfied: babel!=2.0,>=1.3 in /usr/local/lib/python3.6/dist-packages (from sphinx->py-wake==1.0) (2.6.0)
Requirement already satisfied: imagesize in /usr/local/lib/python3.6/dist-packages (from sphinx->py-wake==1.0) (1.1.0)
Requirement already satisfied: Pygments>=2.0 in /usr/local/lib/python3.6/dist-packages (from sphinx->py-wake==1.0) (2.1.3)
Requirement already satisfied: docutils>=0.11 in /usr/local/lib/python3.6/dist-packages (from sphinx->py-wake==1.0) (0.14)
Requirement already satisfied: sphinxcontrib-websupport in /usr/local/lib/python3.6/dist-packages (from sphinx->py-wake==1.0) (1.1.0)
Requirement already satisfied: Jinja2>=2.3 in /usr/local/lib/python3.6/dist-packages (from sphinx->py-wake==1.0) (2.10)
Requirement already satisfied: packaging in /usr/local/lib/python3.6/dist-packages (from sphinx->py-wake==1.0) (18.0)
Requirement already satisfied: alabaster<0.8,>=0.7 in /usr/local/lib/python3.6/dist-packages (from sphinx->py-wake==1.0) (0.7.12)
Requirement already satisfied: snowballstemmer>=1.1 in /usr/local/lib/python3.6/dist-packages (from sphinx->py-wake==1.0) (1.2.1)
Requirement already satisfied: requests>=2.0.0 in /usr/local/lib/python3.6/dist-packages (from sphinx->py-wake==1.0) (2.18.4)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.6/dist-packages (from Jinja2>=2.3->sphinx->py-wake==1.0) (1.1.0)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests>=2.0.0->sphinx->py-wake==1.0) (2.6)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests>=2.0.0->sphinx->py-wake==1.0) (1.22)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests>=2.0.0->sphinx->py-wake==1.0) (2018.11.29)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests>=2.0.0->sphinx->py-wake==1.0) (3.0.4)
datascience 0.10.6 has requirement coverage==3.7.1, but you'll have coverage 4.5.2 which is incompatible.
coveralls 0.5 has requirement coverage<3.999,>=3.6, but you'll have coverage 4.5.2 which is incompatible.
Installing collected packages: coverage, pytest-cov, sphinx-rtd-theme, py-wake
  Found existing installation: coverage 3.7.1
    Uninstalling coverage-3.7.1:
      Successfully uninstalled coverage-3.7.1
  Running setup.py develop for py-wake
Successfully installed coverage-4.5.2 py-wake pytest-cov-2.6.0 sphinx-rtd-theme-0.4.2

In [0]:
import numpy as np
from py_wake.aep._aep import AEP
from py_wake.examples.data.hornsrev1 import wt_x, wt_y, HornsrevV80,\
    HornsrevSite
from py_wake.wake_models.noj import NOJ
from py_wake.wake_models.fuga import FugaWakeModel


import matplotlib.pyplot as plt
wt_x = np.array(wt_x)[[0,1,2,8,9,10,16,17,18]]
wt_y = np.array(wt_y)[[0,1,2,8,9,10,16,17,18]]

from py_wake.tests.test_files import tfp
path = tfp + 'fuga/2MW/Z0=0.03000000Zi=00401Zeta0=0.00E+0/'
wake_model = FugaWakeModel(path, windTurbines)

wake_model=

wt = HornsrevV80()
aep = AEP(HornsrevSite(), wt, NOJ(wt))

print('AEP [GWh]', aep.calculate_AEP(wt_x, wt_y)[0].sum())
x_j = np.linspace(min(wt_x)-1000, max(wt_x)+1000, 500)
y_j = np.linspace(min(wt_y)-1000, max(wt_y)+1000, 300)

X, Y, Z = aep.wake_map(x_j, y_j, 70, wt_x, wt_y, wd=[0], ws=[9])
c = plt.contourf(X, Y, Z, np.arange(2, 9.1, .01), cmap='Blues_r')
plt.colorbar(c, label='wind speed [m/s]')

plt.plot(wt_x, wt_y, '.k')
for i, (x_, y_) in enumerate(zip(wt_x, wt_y)):
    plt.annotate(i, (x_, y_))
plt.axis('equal')
plt.show()


AEP [GWh] 9.097729056246472

In [0]:


In [0]:



Out[0]:
py_wake.aep._aep.AEP