Skip to content

Commit

Permalink
time gap
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed Nov 20, 2023
1 parent c048450 commit f66fc5b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions notebooks/wp5/gravimetric_mass_balance_trends.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@
" print(f\"The amount of months that is {string} between these two dates is\", date)\n",
"\n",
"missing = 100 * abs(expected - actual) / expected\n",
"print(f\"The amount of missing months is {missing:.2f}%\")"
"print(f\"The amount of missing months is {missing:.2f}%\")\n",
"\n",
"(12 * ds[\"time\"].diff(\"time\").astype(int) / year_to_ns).round().plot()\n",
"plt.ylabel(\"Time gap [month]\")\n",
"plt.grid()"
]
},
{
Expand All @@ -175,7 +179,7 @@
"def plot_timeseries(ds):\n",
" fig, axs = plt.subplots(len(variables), 1, layout=\"constrained\")\n",
" for ax, da in zip(axs, ds.data_vars.values()):\n",
" da.plot(ax=ax)\n",
" da.plot(ax=ax, marker=\".\")\n",
" ax.set_title(f\"{da.attrs['region']} Ice Sheet\")\n",
" ax.grid()\n",
" return fig, axs"
Expand Down

0 comments on commit f66fc5b

Please sign in to comment.