In [1]:
%load_ext autoreload
%autoreload 2
from windIO.Plant import WTLayout
import numpy as np
In [2]:
# Some plotly imports
import plotly as pl
from plotly.graph_objs import *
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode() # run at the start of every ipython notebook to use plotly.offline
# this injects the plotly.js source files into the notebook
print(pl.__version__) # requires version >= 1.9.0
In [3]:
farm_name = "Middelgrunden"
file_name = 'middelgrunden.yml'
In [4]:
wtl = WTLayout(file_name)
In [5]:
wtl.plot_location((32,'U'),layout={'title': farm_name+' location'})
In [6]:
wtl.plot_layout(layout={'title': farm_name+' layout'})
In [7]:
turbine = wtl['turbine_types'][0]
ct = np.array(turbine['c_t_curve'])
iplot(Figure(data=[{
'x':ct[:,0],
'y':ct[:,1]}],
layout={
'xaxis':{'title':"Wind Speed [m/s]"},
'yaxis':{'title':'$C_T$'},
'title': '$C_T$ curve of the %s'%(turbine['name']),
}
))
In [8]:
from plotly.graph_objs import *
turbine = wtl['turbine_types'][0]
power = np.array(turbine['power_curve'])
iplot(Figure(data=[{
'x':power[:,0],
'y':power[:,1]}],
layout={
'xaxis':{'title':"Wind Speed [m/s]"},
'yaxis':{'title':'Power [kW]'},
'title': 'Power Curve of the %s'%(turbine['name']),
}
))
In [ ]: