From 364d1dfb5af1bf2c52c1d5479c7125bc23d8a108 Mon Sep 17 00:00:00 2001 From: Tor-Einar Skog <tor-einar.skog@nibio.no> Date: Tue, 17 Oct 2023 14:30:56 +0200 Subject: [PATCH] Change weather data file name --- SEPTREFHUM.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SEPTREFHUM.py b/SEPTREFHUM.py index 0c6a49b..ae5f60f 100755 --- a/SEPTREFHUM.py +++ b/SEPTREFHUM.py @@ -11,6 +11,7 @@ import pytz import netCDF4 as nc +### Config TODO: Make part of config file? # TODO: Figure out where files will be collected from and stored to. infile_path = "in/" outfile_path = "out/" @@ -25,11 +26,11 @@ local_timezone = pytz.timezone("Europe/Oslo") # Empty the tmpfile folder subprocess.run("rm %s*" % tmpfile_path, shell=True) -weatherdata_files = glob.glob("%sanalysis-*.nc" % infile_path) +weatherdata_files = glob.glob("%sweather-*.nc" % infile_path) # Iterate the set of hourly weather data files for file in weatherdata_files: - file_date = file[file.index("analysis")+9:file.index("analysis")+19] + file_date = file[file.index("weather")+8:file.index("weather")+18] # Assuming we're in the summer wh_sum_date = datetime.fromisoformat("%sT00:00:00%s" % (file_date, utc_offset)) #print(wh_sum_date) -- GitLab