Skip to content

Commit

Permalink
fix coords
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed Apr 4, 2024
1 parent b284f67 commit 2e776f8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions notebooks/wp5/glacier_distribution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,10 @@
"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",
"cumulative = ds[\"cumulative\"]\n",
"weighted_time = means[\"weighted\"].to_xarray().assign_coords(region=cumulative[\"region\"])\n",
"interpolated = cumulative.interp(time=means[\"weighted\"].to_xarray())\n",
"volume = 1.091 * (interpolated - 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",
Expand Down

0 comments on commit 2e776f8

Please sign in to comment.