From 4c7b3d24ba3caa99121f0cc856fc73f5cc07dd91 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Tue, 26 Nov 2024 16:09:01 +0000 Subject: [PATCH] smooth --- india_forecast_app/models/all_models.yaml | 6 ++++-- india_forecast_app/models/pvnet/model.py | 8 -------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/india_forecast_app/models/all_models.yaml b/india_forecast_app/models/all_models.yaml index 642ab1b..bbd85c1 100644 --- a/india_forecast_app/models/all_models.yaml +++ b/india_forecast_app/models/all_models.yaml @@ -7,26 +7,28 @@ models: version: ae07c15de064e1d03cf4bc02618b65c6d5b17e8e client: ruvnl asset_type: wind + smooth_blocks: 4 - name: windnet_india_mo type: pvnet id: openclimatefix/windnet_india version: 546baded3d4216736d8ee8d6798d47235bd72b08 client: ruvnl asset_type: wind - smooth_blocks: 5 + smooth_blocks: 7 - name: windnet_india_mo_v2 type: pvnet id: openclimatefix/windnet_india version: 165267d34500cf0c881ed70d9318421f4e0d10f1 client: ruvnl asset_type: wind + smooth_blocks: 4 - name: windnet_india_mo_v3 type: pvnet id: openclimatefix/windnet_india version: 990bed9ad1dbb10515f830c181609b10e72c975e client: ruvnl asset_type: wind - smooth_blocks: 5 + smooth_blocks: 7 # RU client solar - name: pvnet_india type: pvnet diff --git a/india_forecast_app/models/pvnet/model.py b/india_forecast_app/models/pvnet/model.py index b808510..b432b29 100644 --- a/india_forecast_app/models/pvnet/model.py +++ b/india_forecast_app/models/pvnet/model.py @@ -184,14 +184,6 @@ def predict(self, site_id: str, timestamp: dt.datetime): ) * smooth_values[final_gen_index + idx] log.debug(f"New values are {values_df['forecast_power_kw']}") - if self.asset_type == "wind": - # Smooth with a 1 hour rolling window - # Only smooth the wind else we introduce too much of a lag in the solar - # going up and down throughout the day - values_df["forecast_power_kw"] = ( - values_df["forecast_power_kw"].rolling(4, min_periods=1).mean().astype(int) - ) - if self.smooth_blocks: log.info(f"Smoothing the forecast with {self.smooth_blocks} blocks") values_df["forecast_power_kw"] = (