Skip to content

Commit

Permalink
estimation
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed Apr 4, 2024
1 parent 1275027 commit 54f3990
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions notebooks/wp5/glacier_distribution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,41 @@
"for ax in facet.axs.flatten():\n",
" ax.grid()"
]
},
{
"cell_type": "markdown",
"id": "25",
"metadata": {},
"source": [
"# Under/over estimation"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "26",
"metadata": {},
"outputs": [],
"source": [
"year = 2000\n",
"interpolated = ds[\"Cumulative\"].interp(time=means[\"weighted\"].to_xarray())\n",
"volume = 1.091 * (interpolated - ds[\"Cumulative\"].sel(time=year)).compute()\n",
"for region, result in volume.groupby(\"region\", squeeze=False):\n",
" print(\n",
" f\"The volume estimate in RGI region {region:>2}\"\n",
" f\" for the year {year} AD is\"\n",
" f\" {'under' if result <0 else 'over':>5}estimated\"\n",
" f\" by {abs(float(result)):.2f} km3.\"\n",
" )\n",
"\n",
"total = volume.sum()\n",
"print(\n",
" f\"\\nThe volume estimate at the global scale\"\n",
" f\" for the year {year} AD is\"\n",
" f\" {'under' if result <0 else 'over'}estimated\"\n",
" f\" by {abs(float(total)):.2f} km3.\"\n",
")"
]
}
],
"metadata": {
Expand Down

0 comments on commit 54f3990

Please sign in to comment.