openstef.postprocessing package

Submodules

openstef.postprocessing.postprocessing module

openstef.postprocessing.postprocessing.add_components_base_case_forecast(basecase_forecast)

Makes a basecase forecast for the forecast_other component.

This will make a simple basecase components forecast available and ensures that the sum of the components (other, wind and solar) is equal to the normal basecase forecast This is important for sending GLMD messages correctly to TenneT!

Parameters:

basecase_forecast (DataFrame) – pd.DataFrame with basecase forecast

Returns:

pd.DataFrame with extra “forecast_other component”

Return type:

basecase_forecast

openstef.postprocessing.postprocessing.add_prediction_job_properties_to_forecast(pj, forecast, algorithm_type, forecast_type=None, forecast_quality=None)

Adds prediciton job meta data to a forecast dataframe.

Parameters:
  • pj (PredictionJobDataClass) – Prediciton job.

  • forecast (DataFrame) – Forecast dataframe

  • algorithm_type (str) – Type of algirithm used for making the forecast.

  • forecast_type (Optional[Enum]) – Type of the forecast. Defaults to None.

  • forecast_quality (Optional[str]) – Quality of the forecast. Defaults to None.

Return type:

DataFrame

Returns:

Dataframe with added metadata.

openstef.postprocessing.postprocessing.calculate_wind_power(windspeed_100m)

Calculate the generated wind power based on the wind speed.

Values are related through the power curve, which is described by turbine_data. Default values are used and are normalized to 1MWp.

Parameters:

windspeed_100m (DataFrame) – Example: pd.DataFrame (index = datetime, columns = ["windspeed_100m"])

Return type:

DataFrame

Returns:

Example output pd.DataFrame(index = datetime, columns = ["windenergy"])

openstef.postprocessing.postprocessing.normalize_and_convert_weather_data_for_splitting(weather_data)

Normalize and converts weather data for use in energy splitting.

Parameters:

weather_data (DataFrame) – Weather data with “windspeed_100m” and “radiation”.

Return type:

DataFrame

Returns:

Dataframe with “windpower” and “radiation” columns.

openstef.postprocessing.postprocessing.post_process_wind_solar(forecast, forecast_type)

Function that caries out postprocessing for wind and solar power generators.

As these points will always produce energy, predicted energy consumption is set to zero. This function enforces the assumption that production is negative and consuption positive.

Parameters:
  • forecast (Series) – Series with forecast data.

  • forecast_type (ForecastType) – Specifies the type of forecast. This can be retrieved from the prediction job as pj[‘forecast_type’]

Return type:

DataFrame

Returns:

Post-processed forecast.

openstef.postprocessing.postprocessing.sort_quantiles(forecast, quantile_col_start='quantile_P')

Sort quantile values so quantiles do not cross.

This function assumes that all quantile columns start with ‘quantile_P’ For more academic details on why this is mathematically sounds, please refer to Quantile and Probability Curves Without Crossing (Chernozhukov, 2010)

Return type:

DataFrame

openstef.postprocessing.postprocessing.split_forecast_in_components(forecast, weather_data, split_coefs)

Make estimates of energy components based on given forecast.

Parameters:
  • forecast (DataFrame) – KTP load forecast

  • weather_data (DataFrame) – Weather data for energy splitting, at least; “windspeed_100m” and “radiation”

  • split_coefs (dict) – Previously determined splitting coefs for prediction job

Return type:

dict[str, DataFrame]

Returns:

Forecast dataframe for each component

Module contents