Skip to content

Commit

Permalink
Adjust filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
a-lucic committed Aug 23, 2024
1 parent 677ca14 commit 681dccb
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions aurora/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ def download_hres_rda_surf(
v_num = var_dict[variable]
print(f"Downloading {variable} for {year}-{month}-{day}...")

filename = f"ec.oper.an.sfc/{year}{month}/ec.oper.an.sfc.128_{v_num}_{variable}.regn1280sc.{year}{month}{day}.grb"
filename = (
f"ec.oper.an.sfc/{year}{month}/ec.oper.an.sfc.128_{v_num}_{variable}."
f"regn1280sc.{year}{month}{day}.grb"
)

outpath = save_dir / f"{variable}_{year}_{month}_{day}.grb"
url = "https://data.rda.ucar.edu/ds113.1/" + filename
Expand Down Expand Up @@ -90,9 +93,15 @@ def download_hres_rda_atmos(
print(f"Downloading {variable} for {year}-{month}-{day}-{timeofday}...")

if variable in ["z", "t", "q", "w"]:
filename = f"ec.oper.an.pl/{year}{month}/ec.oper.an.pl.128_{v_num}_{variable}.regn1280sc.{year}{month}{day}{timeofday}.grb"
filename = (
f"ec.oper.an.pl/{year}{month}/ec.oper.an.pl.128_{v_num}_{variable}."
f"regn1280sc.{year}{month}{day}{timeofday}.grb"
)
else: # u and v have different filenames than z, t, and q.
filename = f"ec.oper.an.pl/{year}{month}/ec.oper.an.pl.128_{v_num}_{variable}.regn1280uv.{year}{month}{day}{timeofday}.grb"
filename = (
f"ec.oper.an.pl/{year}{month}/ec.oper.an.pl.128_{v_num}_{variable}."
f"regn1280uv.{year}{month}{day}{timeofday}.grb"
)

url = "https://data.rda.ucar.edu/ds113.1/" + filename
outpath = save_dir / f"{variable}_{year}_{month}_{day}_{timeofday}.grb"
Expand Down

0 comments on commit 681dccb

Please sign in to comment.