Closed peterdudfield closed 1 year ago
This gets the two pred values in the same row
select * from (select distinct on (t0) forecast.created_utc, forecast.id as id_a, target_time as t0, expected_power_generation_megawatts as power0 from forecast
join model on model.id = model_id
join location on location.id = location_id
join forecast_value on forecast.id = forecast_id
where target_time>'2023-09-28'
and forecast_value.created_utc < target_time
and gsp_id=0
and name='blend'
order by t0, forecast.created_utc desc ) as A,
(select distinct on (t1) forecast.created_utc, forecast.id as id_b, target_time as t1, expected_power_generation_megawatts as power1 from forecast
join model on model.id = model_id
join location on location.id = location_id
join forecast_value on forecast.id = forecast_id
where target_time>'2023-09-28'
and forecast_value.created_utc < target_time - interval '1 hour'
and gsp_id=0
and name='blend'
order by t1, forecast.created_utc desc ) as B
where t0 = t1 - interval '1 hour'
and id_a = id_b
limit 100;
Detailed Description
Calculate ramp rate metric at different forecast horizons
Context
Possible Implementation