From efcadc58a091dbd74596736ed1a1f043208b703a Mon Sep 17 00:00:00 2001 From: akrherz Date: Tue, 24 Jan 2023 21:20:12 -0600 Subject: [PATCH] run for 1z through 0z period #321 --- scripts/era5/fetch_era5.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/era5/fetch_era5.py b/scripts/era5/fetch_era5.py index 684de0c83b..5e66133c67 100644 --- a/scripts/era5/fetch_era5.py +++ b/scripts/era5/fetch_era5.py @@ -145,13 +145,14 @@ def run(valid): def main(argv): """Go!""" + valid = utc(*[int(a) for a in argv[1:]]) if len(argv) == 5: - valid = utc(*[int(a) for a in argv[1:]]) - run(valid) + offsets = [0] elif len(argv) == 4: - valid = utc(*[int(a) for a in argv[1:]]) - for hr in range(24): - run(valid.replace(hour=hr)) + # Best to run for 1z through 0z as 0z has the 24hr sum to consider + offsets = range(1, 25) + for offset in offsets: + run(valid + timedelta(hours=offset)) if __name__ == "__main__":