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

Replace variable `n_days_avg` by `max_delta`

parent fde3c990
No related branches found
No related tags found
No related merge requests found
...@@ -176,13 +176,16 @@ if args.debug: ...@@ -176,13 +176,16 @@ if args.debug:
g.ep["cost_function"] = g.new_ep("float") g.ep["cost_function"] = g.new_ep("float")
SHPC = util_eddies.SHPC_class(args.SHPC_dir, args.orientation) SHPC = util_eddies.SHPC_class(args.SHPC_dir, args.orientation)
n_days_avg = 7 # number of days to average, must be >= 1
max_delta = 6
# maximum distance in number of eddies, over which we average, must be >= 0
print("Iterating on vertices...") print("Iterating on vertices...")
for n in g.vertices(): for n in g.vertices():
if n.in_degree() != 0: if n.in_degree() != 0:
# Define properties for beginning of the segment: # Define properties for beginning of the segment:
ip_beg = search_beg(g.vp.inst_eddies[n], n_days_avg - 1) ip_beg = search_beg(g.vp.inst_eddies[n], max_delta)
properties = node_to_prop( properties = node_to_prop(
g.vp.inst_eddies[n][:ip_beg], g.vp.inst_eddies[n][:ip_beg],
g.gp.e_overestim, g.gp.e_overestim,
...@@ -202,7 +205,7 @@ for n in g.vertices(): ...@@ -202,7 +205,7 @@ for n in g.vertices():
if ip_beg < len_seg: if ip_beg < len_seg:
# We have to read more from the shapefiles and redefine # We have to read more from the shapefiles and redefine
# properties. # properties.
ip_end = search_end(g.vp.inst_eddies[n], n_days_avg - 1) ip_end = search_end(g.vp.inst_eddies[n], max_delta)
if ip_beg <= ip_end: if ip_beg <= ip_end:
# We cannot use part of properties from the beginning # We cannot use part of properties from the beginning
......
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