Skip to content
Snippets Groups Projects
Commit fadc5795 authored by Alan De Smet's avatar Alan De Smet
Browse files

Limit GFS forecasts to 12 hours in the future

Matches original aitf-mirror behavior in cache update mode.
parent 0da1f620
No related branches found
No related tags found
No related merge requests found
......@@ -103,14 +103,8 @@ class GFSDownloader(csppfetch.Downloader):
# We can use forecasts from this far into the future
self.shortest_valid_forecast = dt.timedelta(hours=3)
# ...through this far into the future.
self.longest_valid_forecast = dt.timedelta(hours=15)
# Given that, valid forecasts are 3, 6, 9, 12, and 15.
# (The original specification allowed up to 12 hours,
# but was only tested against the start time of each pair,
# allowing the 15 forecast to sneak in. We want that
# because otherwise at 0:00-2:59 and every 6 hours after,
# there would not be a valid fallback option.)
self.longest_valid_forecast = dt.timedelta(hours=12)
# Given that, valid forecasts are 3, 6, 9, and 12.
valid_multiple = (self.shortest_valid_forecast-self.first_forecast)/self.forecast_step
if not valid_multiple.is_integer():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment