diff --git a/Convert_Matlab/convert_id.py b/Convert_Matlab/convert_id.py index c40b485341970199f79f3c8184444a44446e636a..fb100a5b2609f4853fa2d3cc62d208d7b0048e0c 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 9434c20d94fcf2b0b0bf6735ab291f99482f5d8f..babb921778688ec717ef78823c723a7df41897b3 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.