From 0b006304e01df5a914351dc7c587fa4b495fc555 Mon Sep 17 00:00:00 2001 From: Marcel Frommelt Date: Wed, 23 Jun 2021 00:11:31 +0900 Subject: [PATCH] Script for download and stitching of ERA5 atmospheric data --- DataRequest.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/DataRequest.py b/DataRequest.py index d3e8c20..9a79004 100644 --- a/DataRequest.py +++ b/DataRequest.py @@ -211,12 +211,12 @@ if download == True: if start.day + ascent_window > (date(year2, next_month, 1) - date(start.year, start.month, 1)).days: short_ascent = 0 startdays = [str(start.day + i).zfill(2) for i in range( - (date(start.year, start.month + 1, 1) - date(start.year, start.month, 1)).days - start.day + 1)] + (date(year2, next_month, 1) - date(start.year, start.month, 1)).days - start.day + 1)] endascent = [str(i + 1).zfill(2) for i in range(ascent_window - len(startdays) + 1)] else: short_ascent = 1 startdays = [str(startday + i).zfill(2) for i in range( - (date(start.year, startmonth + 1, 1) - date(startyear, startmonth, 1)).days - startday + 1)] + (date(year2, next_month, 1) - date(start.year, start.month, 1)).days - startday + 1)] ascentdays = [str(start.day + i).zfill(2) for i in range(ascent_window)] if end.year == start.year: @@ -261,9 +261,9 @@ if download == True: if same_year == 1: for m in range(end.month - start.month - 1): - ERAsingle(start.year, start.month + 1 + m, days, north_lim, south_lim, east_lim, west_lim, + ERAsingle(start.year, next_month + m, days, north_lim, south_lim, east_lim, west_lim, os.path.join(folder, "single" + str(m + 2) + ".nc")) - ERAlevelFloat(start.year, start.month + 1 + m, days, north_lim, south_lim, east_lim, west_lim, + ERAlevelFloat(start.year, next_month + m, days, north_lim, south_lim, east_lim, west_lim, os.path.join(folder, "float" + str(m + 2) + ".nc")) ERAsingle(start.year, end.month, endfloat, north_lim, south_lim, east_lim, west_lim, @@ -273,18 +273,18 @@ if download == True: else: count1 = 0 count2 = 0 - for m in range(13 - start.month): + for m in range(12 - start.month): ERAsingle(start.year, start.month + 1 + m, days, north_lim, south_lim, east_lim, west_lim, os.path.join(folder, "single" + str(m + 2) + ".nc")) - ERAlevelFloat(start.year, start.month + 1 + m, days, north_lim, south_lim, east_lim, west_lim, + ERAlevelFloat(, start.month + 1 + m, days, north_lim, south_lim, east_lim, west_lim, os.path.join(folder, "float" + str(m + 2) + ".nc")) count1 = m + 2 for m in range(end.month - 1): ERAsingle(end.year, 1 + m, days, north_lim, south_lim, east_lim, west_lim, - os.path.join(folder, "single" + str(count1 + m + 1) + ".nc")) + os.path.join(folder, "single" + str(count1 + m + 2) + ".nc")) ERAlevelFloat(end.year, 1 + m, days, north_lim, south_lim, east_lim, west_lim, - os.path.join(folder, "float" + str(count1 + m + 1) + ".nc")) - count2 = count1 + m + 1 + os.path.join(folder, "float" + str(count1 + m + 2) + ".nc")) + count2 = count1 + m + 2 ERAsingle(end.year, end.month, endfloat, north_lim, south_lim, east_lim, west_lim, os.path.join(folder, "single" + str(count2 + 1) + ".nc"))