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

Make the function `convert_id` autonomous

Not dependant on global variables. `date_num` is no longer relevant.
parent c8c047b2
No related branches found
No related tags found
No related merge requests found
......@@ -8,11 +8,11 @@ def date_index(date_num):
date = datetime.date.fromordinal(date_num - 366) - datetime.date(1950, 1, 1)
return date.days
def convert_id(node_index):
def convert_id(node_index, e_overestim, d1):
"""Convert from node identification in graph to eddy identification in
shapefiles.
"""
k = (node_index - 1) // e_overestim
eddy_index = node_index - k * e_overestim
return date_index(date_num[k]), eddy_index
return d1 + k, eddy_index
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