From c8c047b2d48aee683676bc54c63be95064ba48d9 Mon Sep 17 00:00:00 2001 From: Lionel GUEZ <guez@lmd.ens.fr> Date: Wed, 10 Mar 2021 23:15:14 +0100 Subject: [PATCH] Rename `e_max` to `e_overestim` Clearer. `e_max` is now the number of eddies of the current orientation at the current date. See documentation. --- Convert_Matlab/convert_id.py | 4 ++-- Convert_Matlab/overlap_v6.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Convert_Matlab/convert_id.py b/Convert_Matlab/convert_id.py index c40b4853..fb100a5b 100644 --- a/Convert_Matlab/convert_id.py +++ b/Convert_Matlab/convert_id.py @@ -13,6 +13,6 @@ def convert_id(node_index): shapefiles. """ - k = (node_index - 1) // e_max - eddy_index = node_index - k * e_max + k = (node_index - 1) // e_overestim + eddy_index = node_index - k * e_overestim return date_index(date_num[k]), eddy_index diff --git a/Convert_Matlab/overlap_v6.py b/Convert_Matlab/overlap_v6.py index 9434c20d..babb9217 100755 --- a/Convert_Matlab/overlap_v6.py +++ b/Convert_Matlab/overlap_v6.py @@ -17,8 +17,8 @@ n_eddies = sio.loadmat(f"N{orientation}.mat", squeeze_me = True)\ [f"N{orientation}"].astype(int, casting = "safe", copy = False) n_dates = n_eddies.size print("n_dates =", n_dates) -e_max = id_child.shape[0] -print("e_max =", e_max) +e_overestim = id_child.shape[0] +print("e_overestim =", e_overestim) with open(f"edgelist_{orientation}.csv", "w", newline = '') as edgelist: writer = csv.writer(edgelist, delimiter = ' ', lineterminator = "\n") @@ -26,7 +26,7 @@ with open(f"edgelist_{orientation}.csv", "w", newline = '') as edgelist: for k1 in range(n_dates): for i1, id_child_1 in enumerate(id_child[:n_eddies[k1], k1]): - n1 = k1 * e_max + i1 + 1 + n1 = k1 * e_overestim + i1 + 1 # id_child_1 may be an int, which means there is a single # successor, or id_child_1 may be a numpy array, which means # there are several successors. -- GitLab