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

Polish

parent c6d6d8af
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
# A script that takes a segmented graph in the gt format and performs the
# non-local cost function calculation where each edge will have a cost
# function assigned to it.
# Inputs (to be changed within the script):
# node_id_param_file
# gt graph
# shapefiles
# Output: a gt graph with cost functions and an xml graph with cost functions
"""A script that takes a segmented graph in the gt format and performs
the non-local cost function calculation where each edge will have a
cost function assigned to it.
Input:
- "node_id_param.json", expected to be in the current directory
- the graph of segments, "segments.gt" or "segments.graphml", expected
to be in the current directory
- shapefiles, specified as command line arguments
Output: the graph of segments with cost functions,
'segments_cost_functions.gt'
"""
import graph_tool
import time
......@@ -297,15 +306,5 @@ for edge in g.edges():
g.ep.nl_cost_function[edge] = cf
################################
# Writing to an GT Graph File #
################################
#g.save("segments_cyclo_gl_cf.xml")
#print("Done writing xml.")
print("Done writing gt.")
#g.save('segmented_cf.gv', fmt = "dot")
#print("Done writing dot file.")
g.save('segments_cost_functions.gt')
print('All done')
#!/usr/bin/env python3
"""Collapses the input graph into a new graph: the graph of
segments. A vertex of the new graph is a segment. The new graph is
output in the binary format of graph-tool. Input file should be an
edgelist in CSV format. Output file can have suffix ".gt" or
"""Collapses the input graph of instantaneous eddies into a new graph:
the graph of segments. A vertex of the new graph is a segment. The new
graph is output in the binary format of Graph-tool. Input file should
be an edgelist in CSV format. Output file can have suffix ".gt" or
".graphml".
"""
......
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