openclimatefix / power_perceiver

Machine learning experiments using the Perceiver IO model to forecast the electricity system (starting with solar)
MIT License
7 stars 1 forks source link

Fix bug when trying to predict 8 hrs into the future. #138

Closed JackKelly closed 2 years ago

JackKelly commented 2 years ago

image

JackKelly commented 2 years ago

image

image

JackKelly commented 2 years ago

OK, I think I understand the problem:

The random t0 time periods include:

pd.DataFrame([{"start_dt": "2020-02-19 08:25", "end_dt": "2020-02-19 15:30"}, {"start_dt": "2020-02-21 08:20", "end_dt": "2020-02-21 15:30"}])

Given these periods, the RawNWPDataSource would've attempted to load data with init_times from 2020-02-21 06:00 to 2020-02-22 00:00

BUT! init times 2020-02-21 is missing init times at 06 and 09.

So, I think the solution is fairly simple: in RawNWPDataSource._convert_t0_time_periods_to_periods_to_load, don't take the floor of the start_dt. Instead find the most recent init_time_utc.