Ejemplo n.º 1
0
    def create_power_function(self, x, y):

        Status.add("Creating interpolator", verbosity=3)

        if self.interpolation_mode == 'Linear':
            return interpolators.LinearPowerCurveInterpolator(
                x, y, self.cut_out_wind_speed)
        elif self.interpolation_mode == 'Cubic' or self.interpolation_mode == 'Cubic Spline':
            return interpolators.CubicSplinePowerCurveInterpolator(
                x, y, self.cut_out_wind_speed)
        elif self.interpolation_mode == 'Cubic Hermite':
            return interpolators.CubicHermitePowerCurveInterpolator(
                x, y, self.cut_out_wind_speed)
        elif self.interpolation_mode == 'Marmander' or self.interpolation_mode == 'Marmander (Cubic Spline)':
            return interpolators.MarmanderPowerCurveInterpolatorCubicSpline(
                x,
                y,
                self.cut_out_wind_speed,
                x_limits=self.x_limits,
                sub_power=self.sub_power)
        elif self.interpolation_mode == 'Marmander (Cubic Hermite)':
            return interpolators.MarmanderPowerCurveInterpolatorCubicHermite(
                x,
                y,
                self.cut_out_wind_speed,
                x_limits=self.x_limits,
                sub_power=self.sub_power)
        else:
            raise Exception('Unknown interpolation mode: {0}'.format(
                self.interpolation_mode))
Ejemplo n.º 2
0
    def createFunction(self, y_data, x_data):

        if x_data is None:
            x_data = pd.Series(y_data.index, index=y_data.index)
        x, y = [], []

        for i in y_data.index:
            if i in x_data.index:
                x.append(x_data[i])
            else:
                x.append(i)
            y.append(y_data[i])

        return interpolators.LinearPowerCurveInterpolator(x, y)
Ejemplo n.º 3
0
    def createPowerFunction(self, x, y):

        Status.add("Creating interpolator", verbosity=3)

        if self.interpolationMode == 'Linear':
            return interpolators.LinearPowerCurveInterpolator(
                x, y, self.cutOutWindSpeed)
        elif self.interpolationMode == 'Cubic':
            return interpolators.CubicPowerCurveInterpolator(
                x, y, self.cutOutWindSpeed)
        elif self.interpolationMode == 'Marmander':
            return interpolators.MarmanderPowerCurveInterpolator(
                x,
                y,
                self.cutOutWindSpeed,
                xLimits=self.xLimits,
                sub_power=self.sub_power)
        else:
            raise Exception('Unknown interpolation mode: %s' %
                            self.interpolationMode)
Ejemplo n.º 4
0
    def createFunction(self, y_data, x_data):

        if x_data is None:
            x_data = pd.Series(y_data.index, index=y_data.index)
        x, y = [], []

        for i in y_data.index:
            if i in x_data.index:
                x.append(x_data[i])
            else:
                x.append(i)
            y.append(y_data[i])

        if self.interpolationMode == 'Linear':
            return interpolators.LinearPowerCurveInterpolator(x, y)
        elif self.interpolationMode == 'Cubic':
            return interpolators.CubicPowerCurveInterpolator(
                x, y, self.cutOutWindSpeed)
        else:
            raise Exception('Unknown interpolation mode: %s' %
                            self.interpolationMode)
Ejemplo n.º 5
0
 def get_threshold_wind_speed(self):
     return float(
         interpolators.LinearPowerCurveInterpolator(
             self.power_points, self.wind_speed_points, self.rated_power)(
                 0.85 * self.rated_power) * 1.5)
Ejemplo n.º 6
0
 def getThresholdWindSpeed(self):
     return float(
         interpolators.LinearPowerCurveInterpolator(
             self.powerCurveLevels[self.actualPower].as_matrix(),
             list(self.powerCurveLevels[self.actualPower].index))(
                 0.85 * self.ratedPower))