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

Rename `n_max` to `e_max`

n is for node number, e for eddy number at a given date.
parent 9f31076f
Branches
Tags
No related merge requests found
...@@ -23,8 +23,8 @@ def convert_id(node_index): ...@@ -23,8 +23,8 @@ def convert_id(node_index):
shapefiles. shapefiles.
""" """
k = (node_index - 1) // n_max k = (node_index - 1) // e_max
eddy_index = node_index - k * n_max eddy_index = node_index - k * e_max
return date_index(date_num[k]), eddy_index return date_index(date_num[k]), eddy_index
orientation = sys.argv[1] # "cyclo" or "anti" orientation = sys.argv[1] # "cyclo" or "anti"
...@@ -35,8 +35,8 @@ n_eddies = sio.loadmat(f"N{orientation}.mat", squeeze_me = True)\ ...@@ -35,8 +35,8 @@ n_eddies = sio.loadmat(f"N{orientation}.mat", squeeze_me = True)\
date_num = sio.loadmat("date_num.mat", squeeze_me = True)["date_num"] date_num = sio.loadmat("date_num.mat", squeeze_me = True)["date_num"]
n_dates = n_eddies.size n_dates = n_eddies.size
print("n_dates =", n_dates) print("n_dates =", n_dates)
n_max = id_child.shape[0] e_max = id_child.shape[0]
print("n_max =", n_max) print("e_max =", e_max)
with open(f"edgelist_{orientation}.csv", "w", newline = '') as edgelist: with open(f"edgelist_{orientation}.csv", "w", newline = '') as edgelist:
writer = csv.writer(edgelist, delimiter = ' ', lineterminator = "\n") writer = csv.writer(edgelist, delimiter = ' ', lineterminator = "\n")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment