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

GFS can be 5 hours "late" and it's okay

3 hour delays are typical.
4.5 hours delays are moderately common.
parent fadc5795
Branches
Tags
No related merge requests found
......@@ -57,7 +57,7 @@ SST = csppfetch.Downloader(
)
################################################################################
###############################################################################
#
# Data: Global Forecast System
#
......@@ -78,6 +78,18 @@ class GFSDownloader(csppfetch.Downloader):
local_filename = "gfs.t%Hz.pgrbf{priority}"
localdir = "gfs_grib2_0.5deg/%Y/%m/%d/"
# Why 5 hours?
#
# Examination of geodb in 2019 covering 2019-03-01 through 2019-06-12
# and 2021 covering 2021-07-02 through 2021-09-01, suggests the data
# usually available within about 65 minutes, and is almost always
# available within 4 hours and 30 minutes. Round up to 5 arbitrarily.
#
# As we don't really have use for the data until 3 hours after
# nominal generation and don't _need_ it until 6 hours, this seems
# a reasonable number.
expected_newest = dt.timedelta(hours=5)
super().__init__(
name="Global Forecast System",
package_env_id = PACKAGE_ENV_ID,
......@@ -85,9 +97,9 @@ class GFSDownloader(csppfetch.Downloader):
url_relative = CSPP_GEO_AITF_URL_DIR_PART+remote_filename,
local = localdir+local_filename,
period = dt.timedelta(hours=6),
epoch_start = dt.datetime(2010,1,1,0,0,0)
epoch_start = dt.datetime(2010,1,1,0,0,0),
expected_newest = expected_newest,
)
#expected_newest = dt.timedelta(hours=1) - TODO, what's the age?
# Fields we're not using:
# oldest_usable - Not meaningful; the limit is how far into the future
......@@ -165,7 +177,7 @@ class GFSDownloader(csppfetch.Downloader):
urls_to_files.update(self.url_to_file_for_time(generated_time, forecast_start))
urls_to_files.update(self.url_to_file_for_time(generated_time, end))
expected = self.is_expected(forecast_start) and self.is_expected(end)
expected = self.is_expected(generated_time)
startstr = str(int(forecast_start.total_seconds()/(60*60)))
endstr = str(int( end.total_seconds()/(60*60)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment