From f66fc5bc7bab5f3153c9a27553d88844ff11ef82 Mon Sep 17 00:00:00 2001 From: Mattia Almansi Date: Mon, 20 Nov 2023 11:13:34 +0100 Subject: [PATCH] time gap --- notebooks/wp5/gravimetric_mass_balance_trends.ipynb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/notebooks/wp5/gravimetric_mass_balance_trends.ipynb b/notebooks/wp5/gravimetric_mass_balance_trends.ipynb index 56534d3..2ab8f17 100644 --- a/notebooks/wp5/gravimetric_mass_balance_trends.ipynb +++ b/notebooks/wp5/gravimetric_mass_balance_trends.ipynb @@ -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()" ] }, { @@ -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"