Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
csppfetch
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cspp_geo
csppfetch
Commits
820a6e8e
Commit
820a6e8e
authored
4 years ago
by
Alan De Smet
Browse files
Options
Downloads
Patches
Plain Diff
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
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
example/aitf/ancil.py
+16
-4
16 additions, 4 deletions
example/aitf/ancil.py
with
16 additions
and
4 deletions
example/aitf/ancil.py
+
16
−
4
View file @
820a6e8e
...
...
@@ -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
)))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment