diff --git a/notebooks/wp5/lake_water_temperature_outlier_detection.ipynb b/notebooks/wp5/lake_water_temperature_outlier_detection.ipynb index a39e949..4c282a7 100644 --- a/notebooks/wp5/lake_water_temperature_outlier_detection.ipynb +++ b/notebooks/wp5/lake_water_temperature_outlier_detection.ipynb @@ -50,7 +50,7 @@ "source": [ "# Time\n", "start = \"1997-01\"\n", - "stop = \"1997-02\"\n", + "stop = \"2000-01\"\n", "\n", "# Region\n", "lon_slice = slice(28, 41)\n", @@ -151,20 +151,6 @@ "da = ds[varname].compute()" ] }, - { - "cell_type": "markdown", - "id": "328f352f", - "metadata": { - "editable": true, - "slideshow": { - "slide_type": "" - }, - "tags": [] - }, - "source": [ - "## Extract lake IDs to plot a map of the region" - ] - }, { "cell_type": "code", "execution_count": null, @@ -173,8 +159,10 @@ "outputs": [], "source": [ "# We use one of the request previously cached\n", - "single_request = requests[0]\n", - "single_request[\"month\"] = single_request[\"month\"][0]\n", + "single_request = {\n", + " k: v if isinstance(v, str) or k not in chunks else v[0]\n", + " for k, v in requests[0].items()\n", + "}\n", "da_lakeid = download.download_and_transform(\n", " collection_id,\n", " single_request,\n", @@ -255,7 +243,10 @@ "plt.show()\n", "\n", "# Print statistics\n", - "boxplot_stats = {}\n", + "boxplot_stats = {\n", + " lakeid: matplotlib.cbook.boxplot_stats(df_lakeid.dropna().values.squeeze())\n", + " for lakeid, df_lakeid in df.groupby(\"lakeid\")\n", + "}\n", "for lakeid, df_lakeid in df.groupby(\"lakeid\"):\n", " values = df_lakeid.dropna().values.squeeze()\n", " (boxplot_stats[lakeid],) = matplotlib.cbook.boxplot_stats(values)\n",