Script for download and stitching of atmospheric data

This commit is contained in:
Marcel Christian Frommelt 2021-06-22 23:12:15 +09:00
parent 4db0f70ad1
commit 6b528b3be1
1 changed files with 5 additions and 8 deletions

View File

@ -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,