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

Rename `eddy_index_Matlab` to `node_index`

parent 72d378dd
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,7 @@ import datetime
import csv
import sys
def convert_id(cyclone, eddy_index_Matlab):
def convert_id(cyclone, node_index):
"""Convert from Matlab eddy identification to eddy
identification in shapefiles.
......@@ -21,15 +21,15 @@ def convert_id(cyclone, eddy_index_Matlab):
"""
k = (eddy_index_Matlab - 1) // n_max
k = (node_index - 1) // n_max
date = datetime.date.fromordinal(date_num[k] - 366) - datetime.date(1950,
1, 1)
date = date.days
if cyclone:
eddy_index_F = Nanti[k] + eddy_index_Matlab - k * n_max
eddy_index_F = Nanti[k] + node_index - k * n_max
else:
eddy_index_F = eddy_index_Matlab - k * n_max
eddy_index_F = node_index - k * n_max
return date, eddy_index_F
......@@ -42,9 +42,9 @@ def print_edgelist(id_child, cyclone):
try:
# Try processing id_child_1 as an array:
for eddy_index_Matlab in id_child_1:
for node_index in id_child_1:
writer.writerow(convert_id(*predecessor)
+ convert_id(cyclone, eddy_index_Matlab))
+ convert_id(cyclone, node_index))
except TypeError:
# id_child_1 is a scalar int.
writer.writerow(convert_id(*predecessor)
......
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