openclimatefix / uk-pv-national-xg

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

Notify/raise eror with stale NWP data. #26

Open thomasarmstrong98 opened 1 year ago

thomasarmstrong98 commented 1 year ago

Check that input NWP is not too far behind the inference datetime.

If the NWP data is stale and the model does not know this, then the forecasts will look wrong. For example if we perform inference at 3pm but the NWP data we supply from the database has init_time_utc of 5am, then the +4 hour forecast will be taking NWPs projected for 9am that morning rather than 7pm that night. A to do would be raise an error if the NWP data is too stale.

For example in gradboost_pv.inference.models.NationalBoostInferenceModel.check_incoming_data there can be a check for data.nwp.init_time_utc > data.inference_time - timedelta_threshold. Where timedelta_threshold is a configurable param.