Skip to content
Snippets Groups Projects
Commit c8c047b2 authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

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.
parent 68da90cd
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment