Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added try/except for model download #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions unisacsi/MET_model_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ def download_MET_model_data(config_file):
print("############################################################")
print("start downloading latest data")
print("############################################################")
MET_model_download_class(config_settings)
try:
MET_model_download_class(config_settings)
except:
print("ERROR! download failed, skipping file")
elif config_settings["save_daily_files"]:
days = pd.date_range(config_settings["start_day"], config_settings["end_day"], freq="1D")
daily_config = copy.copy(config_settings)
Expand All @@ -65,10 +68,16 @@ def download_MET_model_data(config_file):
print("############################################################")
print(f"start downloading data from {d.strftime('%Y-%m-%d')}")
print("############################################################")
MET_model_download_class(daily_config)
try:
MET_model_download_class(daily_config)
except:
print("ERROR! download failed, skipping file")
else:
config_settings["out_path"] = f"{config_settings['out_path']}_{config_settings['resolution']}.nc"
MET_model_download_class(config_settings)
try:
MET_model_download_class(config_settings)
except:
print("ERROR! download failed, skipping file")


return
Expand Down Expand Up @@ -1474,4 +1483,4 @@ def download_pressure_level_data(self):