Skip to content
Snippets Groups Projects
Commit 364d1dfb authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Change weather data file name

parent dab3e09f
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,7 @@ import pytz ...@@ -11,6 +11,7 @@ import pytz
import netCDF4 as nc import netCDF4 as nc
### Config TODO: Make part of config file?
# TODO: Figure out where files will be collected from and stored to. # TODO: Figure out where files will be collected from and stored to.
infile_path = "in/" infile_path = "in/"
outfile_path = "out/" outfile_path = "out/"
...@@ -25,11 +26,11 @@ local_timezone = pytz.timezone("Europe/Oslo") ...@@ -25,11 +26,11 @@ local_timezone = pytz.timezone("Europe/Oslo")
# Empty the tmpfile folder # Empty the tmpfile folder
subprocess.run("rm %s*" % tmpfile_path, shell=True) 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 # Iterate the set of hourly weather data files
for file in weatherdata_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 # Assuming we're in the summer
wh_sum_date = datetime.fromisoformat("%sT00:00:00%s" % (file_date, utc_offset)) wh_sum_date = datetime.fromisoformat("%sT00:00:00%s" % (file_date, utc_offset))
#print(wh_sum_date) #print(wh_sum_date)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment