diff --git a/Overlap/report_graph.py b/Overlap/report_graph.py index 17dbdbdc184822a91c73fbf1af513a341986b7b0..e77a55303f692a68eb9ac7f37909312c322fe513 100755 --- a/Overlap/report_graph.py +++ b/Overlap/report_graph.py @@ -30,8 +30,6 @@ def date_eddy_to_node(d, eddy_index, e_overestim, d_init): return (d- d_init) * e_overestim + eddy_index def read_eddy_graph(edgelist, shpc_dir = None): - """shpc_dir is for visible eddies.""" - if os.access(edgelist, os.R_OK): G = nx.read_edgelist(edgelist, create_using = nx.DiGraph, nodetype = int, data = [("weight", float)]) @@ -42,7 +40,7 @@ def read_eddy_graph(edgelist, shpc_dir = None): G.graph["d_init"] = node_id_param["d_init"] if shpc_dir is not None: - # Read and set attributes of Visible eddies: + # Read and set attributes of eddies: extr_file = path.join(shpc_dir, "extremum") set_attribute(G, extr_file) else: @@ -59,8 +57,7 @@ def set_attribute(G, extr_file): G.graph["e_overestim"], G.graph["d_init"]) if shape_rec.record.valid == 1 and n in G: - G.add_node(n, - coordinates = tuple(shape_rec.shape.points[0]), + G.add_node(n, coordinates = tuple(shape_rec.shape.points[0]), speed = shape_rec.record.speed, ssh = shape_rec.record.ssh)