Beispiel #1
0
 def setUpClass(cls):
     ds = NREL()
     cls.turbine = ds.get_turbine(NREL.park_id['tehachapi'], 2004, 2005)
     cls.windpark = ds.get_windpark(NREL.park_id['tehachapi'], 3, 2004,
                                    2005)
     cls.pmapping = PowerMapping()
     cls.pdmapping = PowerDiffMapping()
Beispiel #2
0
 def test_nrel_repair(self):
     ds = NREL()
     target = ds.get_turbine(NREL.park_id['tehachapi'], 2005)
     measurements = target.get_measurements()[:43504]
     measurements = NRELRepair().repair(measurements)
     assert(NRELRepair().validate(measurements))
"""
Histogram of Wind Speeds
-------------------------------------------------------------

Histograms of wind speeds of a turbine near Cheyenne in the year 2004.
"""

# Author: Jendrik Poloczek <*****@*****.**>
# License: BSD 3 clause

import matplotlib.pyplot as plt
from pylab import plt
from windml.datasets.nrel import NREL

ds = NREL()
turbine = ds.get_turbine(NREL.park_id['cheyenne'], 2004)
speeds = list(map(lambda x : x[2], turbine.measurements))

plt.hist(speeds, color="#c4d8eb", bins=10, normed = 1)
plt.show()
"""
Histogram of Wind Speeds
-------------------------------------------------------------

Histograms of wind speeds of a turbine near Cheyenne in the year 2004.
"""

# Author: Jendrik Poloczek <*****@*****.**>
# License: BSD 3 clause

import matplotlib.pyplot as plt
from pylab import plt
from windml.datasets.nrel import NREL

ds = NREL()
turbine = ds.get_turbine(NREL.park_id['cheyenne'], 2004)
speeds = list(map(lambda x: x[2], turbine.measurements))

plt.hist(speeds, color="#c4d8eb", bins=10, normed=1)
plt.show()
Beispiel #5
0
This examples shows the topology of a turbine and gives a statistical overview
for different characteristics of its time series.
"""

# Author: Oliver Kramer <*****@*****.**>
# License: BSD 3 clause

import matplotlib.pyplot as plt
import numpy as np
import windml.util.features

from windml.datasets.nrel import NREL
from windml.visualization.show_coord_topo_turbine import show_coord_topo_turbine

ds = NREL()
turbine = ds.get_turbine(NREL.park_id['tehachapi'], 2004)

feat, month_power, ramps_up, ramps_down, power_freq = windml.util.features.compute_highlevel_features(
    turbine)

month = [
    'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct',
    'nov', 'dec'
]
figure = plt.figure(figsize=(15, 10))

# plot 1
plot1 = plt.subplot(2, 2, 1)
plt.title("Turbine Location")
show_coord_topo_turbine(turbine, show=False)
Beispiel #6
0
This examples shows the topology of a turbine and gives a statistical overview
for different characteristics of its time series.
'''

# Author: Oliver Kramer <*****@*****.**>
# License: BSD 3 clause

import matplotlib.pyplot as plt
import numpy as np
import windml.util.features

from windml.datasets.nrel import NREL
from windml.visualization.show_coord_topo_turbine import show_coord_topo_turbine

ds = NREL()
turbine = ds.get_turbine(NREL.park_id['tehachapi'], 2004)

feat, month_power, ramps_up, ramps_down, power_freq = windml.util.features.compute_highlevel_features(
    turbine)

month = ['jan', 'feb', 'mar', 'apr', 'may', 'jun',
         'jul', 'aug', 'sep', 'oct', 'nov', 'dec']
figure = plt.figure(figsize=(15, 10))

# plot 1
plot1 = plt.subplot(2, 2, 1)
plt.title('Turbine Location')
show_coord_topo_turbine(turbine, show=False)

# plot 2
plot2 = plt.subplot(2, 2, 2)
Beispiel #7
0
import matplotlib.pylab as plt
import datetime, time
import numpy as np

from numpy import array, matrix
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import KFold
from sklearn import __version__ as sklearn_version
from sklearn.svm import SVR

from sklearn.neighbors import KNeighborsRegressor
from windml.datasets.nrel import NREL
from windml.visualization.plot_response_curve import plot_response_curve

ds = NREL()
turbine = ds.get_turbine(NREL.park_id['palmsprings'], 2004, 2006)
timeseries = turbine.get_measurements()
max_speed = 40
skip = 1

# plot true values as blue points
speed = [m[2] for m in timeseries[::skip]]
score = [m[1] for m in timeseries[::skip]]

# Second Plot: KNN-Interpolation
# Built patterns und labels
X_train = speed[0:len(speed):1]
Y_train = score[0:len(score):1]
X_train_array = array([[element] for element in X_train])

# initialize KNN regressor from sklearn.
Beispiel #8
0
import datetime, time
import numpy as np

from numpy import array, matrix
from sklearn.grid_search import GridSearchCV
from sklearn.cross_validation import KFold
from sklearn import __version__ as sklearn_version
from sklearn.svm import SVR

from sklearn.neighbors import KNeighborsRegressor
from windml.datasets.nrel import NREL
from windml.visualization.plot_response_curve import plot_response_curve


ds = NREL()
turbine = ds.get_turbine(NREL.park_id['palmsprings'], 2004, 2006)
timeseries = turbine.get_measurements()
max_speed = 40
skip = 1


# plot true values as blue points
speed = [m[2] for m in timeseries[::skip]]
score = [m[1] for m in timeseries[::skip]]


# Second Plot: KNN-Interpolation
# Built patterns und labels
X_train = speed[0:len(speed):1]
Y_train = score[0:len(score):1]
X_train_array = array([[element] for element in X_train])
Beispiel #9
0
 def test_get_turbine(self):
     ds = NREL()
     target = ds.get_turbine(NREL.park_id['tehachapi'], 2004, 2005)
     t = target.get_measurements()[0]
     assert (len(t) == 3)
Beispiel #10
0
 def setUpClass(cls):
     ds = NREL()
     cls.turbine = ds.get_turbine(NREL.park_id['tehachapi'], 2004)
     cls.windpark = ds.get_windpark(NREL.park_id['tehachapi'], 3, 2004)
Beispiel #11
0
 def test_nrel_repair(self):
     ds = NREL()
     target = ds.get_turbine(NREL.park_id['tehachapi'], 2004)
     measurements = target.get_measurements()[:43504]
     measurements = NRELRepair().repair(measurements)
     assert(NRELRepair().validate(measurements))
Beispiel #12
0
 def test_get_turbine(self):
     ds = NREL()
     target = ds.get_turbine(NREL.park_id['tehachapi'], 2004, 2005)
     t = target.get_measurements()[0]
     assert(len(t) == 3)
Beispiel #13
0
 def setUpClass(cls):
     ds = NREL()
     cls.turbine = ds.get_turbine(NREL.park_id['tehachapi'], 2004)
     cls.windpark = ds.get_windpark(NREL.park_id['tehachapi'], 3, 2004)
Beispiel #14
0
 def setUpClass(cls):
     ds = NREL()
     cls.turbine = ds.get_turbine(NREL.park_id['tehachapi'], 2004, 2005)
     cls.windpark = ds.get_windpark(NREL.park_id['tehachapi'], 3, 2004, 2005)
     cls.pmapping = PowerMapping()
     cls.pdmapping = PowerDiffMapping()