From d18af0e0b2fd73a6a599000c1ab3eea1ed34becb Mon Sep 17 00:00:00 2001 From: chenyangkang Date: Mon, 3 Jun 2024 16:53:43 +0800 Subject: [PATCH] gif gridding debug --- stemflow/utils/plot_gif.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stemflow/utils/plot_gif.py b/stemflow/utils/plot_gif.py index 13a3d20..7652218 100644 --- a/stemflow/utils/plot_gif.py +++ b/stemflow/utils/plot_gif.py @@ -147,10 +147,10 @@ def animate(i, norm, log_scale=log_scale): temporal_value = np.array(sub[Temporal1].values)[0] g1 = np.digitize(sub[Spatio1], lng_gird, right=True) - g1 = np.where(g1 >= np.max(lng_gird), np.max(lng_gird) - 1, g1).astype("int") + g1 = np.where(g1 >= lng_size, lng_size - 1, g1).astype("int") g2 = np.digitize(sub[Spatio2], lat_gird, right=True) - g2 = np.where(g2 >= np.max(lat_gird), np.max(lat_gird) - 1, g2).astype("int") + g2 = np.where(g2 >= lng_size, lng_size - 1, g2).astype("int") sub.loc[:, f"{Spatio1}_grid"] = g1 sub.loc[:, f"{Spatio2}_grid"] = g2