Script for download and stitching of ERA5 atmospheric data
This commit is contained in:
parent
6b528b3be1
commit
0b006304e0
@ -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"))
|
||||
|
Loading…
Reference in New Issue
Block a user