Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed Jul 21, 2023
1 parent a365f8a commit 878f185
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions notebooks/wp5/lake_water_temperature_outlier_detection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 878f185

Please sign in to comment.