From 6b528b3be17f0fd7334e48a32fac43ccd1c959f1 Mon Sep 17 00:00:00 2001 From: Marcel Frommelt Date: Tue, 22 Jun 2021 23:12:15 +0900 Subject: [PATCH] Script for download and stitching of atmospheric data --- DataRequest.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/DataRequest.py b/DataRequest.py index 02e5f22..d3e8c20 100644 --- a/DataRequest.py +++ b/DataRequest.py @@ -203,24 +203,21 @@ if download == True: if start.month == end.month: month = 'same' - print("same") elif end.month - start.month == 1 or end.month - start.month == -11: month = 'next' - print("next") else: month = 'more' - print("more") 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)] endascent = [str(i + 1).zfill(2) for i in range(ascent_window - len(startdays) + 1)] - print(startdays) else: short_ascent = 1 - startdays = [str(start.day + i).zfill(2) for i in range(ascent_window)] - print(startdays) + startdays = [str(startday + i).zfill(2) for i in range( + (date(start.year, startmonth + 1, 1) - date(startyear, startmonth, 1)).days - startday + 1)] + ascentdays = [str(start.day + i).zfill(2) for i in range(ascent_window)] if end.year == start.year: same_year = 1 @@ -234,7 +231,7 @@ if download == True: endfloat = [str(i + 1).zfill(2) for i in range(end.day)] if short_ascent == 1: - ERAlevelAscent(start.year, start.month, startdays, start_lat, start_lon, os.path.join(folder, "ascent1.nc")) + ERAlevelAscent(start.year, start.month, ascentdays, start_lat, start_lon, os.path.join(folder, "ascent1.nc")) else: ERAlevelAscent(start.year, start.month, startdays, start_lat, start_lon, os.path.join(folder, "ascent1.nc")) ERAlevelAscent(year2, next_month, endascent, start_lat, start_lon, os.path.join(folder, "ascent2.nc")) @@ -276,7 +273,7 @@ if download == True: else: count1 = 0 count2 = 0 - for m in range(12 - start.month): + for m in range(13 - 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,