From 1b0c6bee59db64c21e6c4474fbab62edc370835d Mon Sep 17 00:00:00 2001 From: Robert Wilson Date: Thu, 13 Jun 2024 09:06:47 +0100 Subject: [PATCH] add some captions to comparisons --- ecoval/data/comparison_bias.ipynb | 22 ++++++++++------------ ecoval/data/comparison_regional.ipynb | 8 ++++++++ ecoval/data/comparison_seasonal.ipynb | 7 +++++-- ecoval/data/comparison_spatial.ipynb | 4 +++- 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/ecoval/data/comparison_bias.ipynb b/ecoval/data/comparison_bias.ipynb index bdb6d37..dbe0182 100644 --- a/ecoval/data/comparison_bias.ipynb +++ b/ecoval/data/comparison_bias.ipynb @@ -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, @@ -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", @@ -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" ] }, { @@ -276,7 +273,8 @@ "source": [ "for key in output:\n", " key\n", - " display(output[key])" + " display(output[key])\n", + " display(md_output[key])" ] }, { diff --git a/ecoval/data/comparison_regional.ipynb b/ecoval/data/comparison_regional.ipynb index a1cb484..bae7ad6 100644 --- a/ecoval/data/comparison_regional.ipynb +++ b/ecoval/data/comparison_regional.ipynb @@ -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, diff --git a/ecoval/data/comparison_seasonal.ipynb b/ecoval/data/comparison_seasonal.ipynb index fbcd4be..531c389 100644 --- a/ecoval/data/comparison_seasonal.ipynb +++ b/ecoval/data/comparison_seasonal.ipynb @@ -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" ] }, { @@ -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" ] }, { diff --git a/ecoval/data/comparison_spatial.ipynb b/ecoval/data/comparison_spatial.ipynb index b340cdb..7767104 100644 --- a/ecoval/data/comparison_spatial.ipynb +++ b/ecoval/data/comparison_spatial.ipynb @@ -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." ] }, {