Skip to content

Commit

Permalink
add some captions to comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
robertjwilson committed Jun 13, 2024
1 parent 2ec6ad8 commit 1b0c6be
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
22 changes: 10 additions & 12 deletions ecoval/data/comparison_bias.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@
"num_models = len(model_dict)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "16fc288e",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -120,13 +112,14 @@
"id": "cf964f4a",
"metadata": {
"tags": [
"remove-cell",
"remove-input"
"remove-input",
"remove-cell"
]
},
"outputs": [],
"source": [
"output = dict()\n",
"md_output = dict()\n",
"# list to track data frames with correlation coefficients\n",
"df_cor = []\n",
"df_abs = []\n",
Expand Down Expand Up @@ -259,7 +252,11 @@
" title = f\"{model1} - {model2}\"\n",
" ds_diff.set_longnames({ds_diff.variables[0]: title})\n",
" ds_diff.to_latlon(lon = lons, lat = lats, res = [0.111, 0.067]) \n",
" ds_diff.pub_plot( fig = fig, gs = gs[0,2], title = title, limits = [\"2%\", \"98%\"])"
" ds_diff.pub_plot( fig = fig, gs = gs[0,2], title = title, limits = [\"2%\", \"98%\"])\n",
"\n",
"\n",
" md_output[key] = md(f\"**Figure {i_figure}**: Model bias for {variable}. The first two columns show **model - observation** for the two simulations. The third column shows the difference between the two models.\")\n",
" i_figure += 1"
]
},
{
Expand All @@ -276,7 +273,8 @@
"source": [
"for key in output:\n",
" key\n",
" display(output[key])"
" display(output[key])\n",
" display(md_output[key])"
]
},
{
Expand Down
8 changes: 8 additions & 0 deletions ecoval/data/comparison_regional.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
"chunk_start"
]
},
{
"cell_type": "markdown",
"id": "028b0b6f",
"metadata": {},
"source": [
"**Note**: These comparisons are only exact when the model grids are identical. Otherwise, the comparisons are based on the overlap between the model grids and the region of interest, and the results may not be totally comparable."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
7 changes: 5 additions & 2 deletions ecoval/data/comparison_seasonal.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
"annual_paths[\"base_name\"] = annual_paths[\"path\"].apply(lambda x: os.path.basename(x))\n",
"# only interested in netcdf file in path\n",
"annual_paths = annual_paths[annual_paths[\"base_name\"].str.contains(\".nc\")]\n",
"\n"
"\n",
"i_figure = 0"
]
},
{
Expand Down Expand Up @@ -222,7 +223,9 @@
"source": [
"for key in output:\n",
" key\n",
" display(output[key])"
" display(output[key])\n",
" md(f\"**Figure {i_figure}**: {key}. Correlation coefficient between models and observations in each grid cell and each climatological month.\")\n",
" i_figure += 1"
]
},
{
Expand Down
4 changes: 3 additions & 1 deletion ecoval/data/comparison_spatial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
"The ability of the models to reproduce spatial patterns for key variables was assessed by comparing the modelled value and the observed values in each grid cell.\n",
"The spatial correlation coefficient was used to quantify the spatial pattern similarity between the modelled and observed values. This was calculated for each variable and each model using the values in each grid cell.\n",
"\n",
"Models were compared by regridding each one to the same grid and ensuring grid cells with missing values in at least one model were excluded."
"Models were compared by regridding each one to the same grid and ensuring grid cells with missing values in at least one model were excluded.\n",
"\n",
"**Note**: these summaries provided performance across the entire domain. The results are only strictly comparable when model grids are the same."
]
},
{
Expand Down

0 comments on commit 1b0c6be

Please sign in to comment.