Skip to content

Commit

Permalink
fix experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed Mar 26, 2024
1 parent 4957885 commit c6527de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions notebooks/wp4/extreme_temperature_indices_future.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
" + [\n",
" {\n",
" **request_cordex,\n",
" \"experiment\": \"ssp5_8_5\",\n",
" \"experiment\": \"rcp_8_5\",\n",
" \"start_year\": start_year,\n",
" \"end_year\": end_year,\n",
" }\n",
Expand All @@ -280,7 +280,7 @@
" )\n",
" requests_future = download.split_request(\n",
" request_cmip6\n",
" | {\"year\": get_cmip6_years(future_slice), \"experiment\": \"rcp_8_5\"},\n",
" | {\"year\": get_cmip6_years(future_slice), \"experiment\": \"ssp5_8_5\"},\n",
" chunks=chunks,\n",
" )\n",
" request_sim = (\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@
" + [\n",
" {\n",
" **request_cordex,\n",
" \"experiment\": \"ssp5_8_5\",\n",
" \"experiment\": \"rcp_8_5\",\n",
" \"start_year\": start_year,\n",
" \"end_year\": end_year,\n",
" model_key: model,\n",
Expand All @@ -281,7 +281,7 @@
" request_cmip6\n",
" | {\n",
" \"year\": get_cmip6_years(future_slice),\n",
" \"experiment\": \"rcp_8_5\",\n",
" \"experiment\": \"ssp5_8_5\",\n",
" model_key: model,\n",
" },\n",
" chunks=chunks,\n",
Expand Down Expand Up @@ -465,7 +465,6 @@
"outputs": [],
"source": [
"kwargs = {\n",
" \"collection_id\": request_sim[0],\n",
" \"chunks\": chunks if collection_id == \"CMIP6\" else None,\n",
" \"transform_chunks\": False,\n",
" \"transform_func\": compute_indices_and_trends_future_vs_historical,\n",
Expand All @@ -478,7 +477,7 @@
" \"resample\": False,\n",
"}\n",
"ds_regrid = download.download_and_transform(\n",
" requests=[request | {model_key: model_regrid} for request in request_sim[1]],\n",
" *request_grid_out,\n",
" **kwargs,\n",
" transform_func_kwargs=transform_func_kwargs,\n",
")"
Expand All @@ -505,20 +504,19 @@
"source": [
"interpolated_datasets = []\n",
"model_datasets = {}\n",
"for model in models:\n",
"for model, requests in request_sim.items():\n",
" print(f\"{model=}\")\n",
" # Original model\n",
" ds = download.download_and_transform(\n",
" requests=[request | {model_key: model} for request in request_sim[1]],\n",
" **kwargs,\n",
" *requests**kwargs,\n",
" transform_func_kwargs=transform_func_kwargs,\n",
" )\n",
" model_datasets[model] = ds\n",
"\n",
" if model != model_regrid:\n",
" # Interpolated model\n",
" ds = download.download_and_transform(\n",
" requests=[request | {model_key: model} for request in request_sim[1]],\n",
" *requests,\n",
" **kwargs,\n",
" transform_func_kwargs=transform_func_kwargs\n",
" | {\n",
Expand Down

0 comments on commit c6527de

Please sign in to comment.