openclimatefix / uk-pv-national-xg

National PV forecasting using Gradient Boosted Methods.
4 stars 3 forks source link

Adjuster for National_XG #63

Closed peterdudfield closed 11 months ago

peterdudfield commented 1 year ago

Detailed Description

It would be good to get the Adjuster working for the National model

Context

Possible Implementation

This needs

peterdudfield commented 1 year ago
FROM forecast_value, gsp_yield 
WHERE forecast_value.uuid IN (SELECT anon_1.uuid 
FROM (SELECT DISTINCT ON (forecast_value.target_time) forecast_value.uuid AS uuid 
FROM forecast_value JOIN forecast ON forecast.id = forecast_value.forecast_id 
      JOIN location ON location.id = forecast.location_id 
      JOIN model ON model.id = forecast.model_id 
        WHERE location.gsp_id = 0 
      AND forecast_value.target_time - forecast_value.created_utc >= interval '450 minute' 
--    AND %(created_utc_1)s - forecast_value_last_seven_days.created_utc < interval '450 minute' 
      AND forecast_value.target_time > '2023-04-06'  
      AND forecast_value.target_time <= '2023-04-12' 
      AND model.name = 'National_xg' 
      ORDER BY forecast_value.target_time, forecast_value.created_utc DESC) AS anon_1) AND gsp_yield.id IN (SELECT anon_2.id 
FROM (SELECT gsp_yield.id AS id 
FROM gsp_yield JOIN location ON location.id = gsp_yield.location_id 
WHERE location.gsp_id = 0 
      AND gsp_yield.datetime_utc > '2023-04-06' 
      AND gsp_yield.datetime_utc <= '2023-04-12'  
      AND gsp_yield.regime = 'day-after') AS anon_2) 
      AND gsp_yield.datetime_utc = forecast_value.target_time 
      GROUP BY CAST(gsp_yield.datetime_utc AS TIME WITHOUT TIME ZONE)

Ran this, and found errors from 0 to 800 MW, so I think its worth doing the adjuster

peterdudfield commented 1 year ago

This is now working on dev

peterdudfield commented 1 year ago

All deployed on production now