Skip to content
Snippets Groups Projects
Commit 5cb106c2 authored by Christoph.Fischer's avatar Christoph.Fischer
Browse files

fixed graph output

parent b3439fdd
No related branches found
No related tags found
No related merge requests found
def plot_from_desc(graph_desc):
return None
\ No newline at end of file
......@@ -89,9 +89,6 @@ class TrackingTechnique(ABC):
self.postprocess(object_desc) # only postprocess object desc, THEN to graph
# TODO next link pairs together to "path"
# track then has N-list of IDs
# TODO what if tracks are the identification? e.g. AEW identification in Hovmoller
pass
......@@ -106,20 +103,28 @@ class TrackingTechnique(ABC):
self.graph = self.pb_reference.DatasetDescription()
self.graph.CopyFrom(object_desc)
for c in connections: # TODO this over the weekend, prepare case studies in met3d -> Montag AF -> Di Pres.
obj_con = self.pb_reference.ObjectConnection()
start, end = c.n1, c.n2
obj_con.n1.time = obj_set.timesteps[start.time_index].valid_time
obj_with_startid = \
[objindex for objindex, obj in enumerate(obj_set.timesteps[start.time_index].objects) if
obj.id == start.object_id][0]
obj_con.n1.object.CopyFrom(obj_set.timesteps[start.time_index].objects[obj_with_startid])
obj_con.n2.time = obj_set.timesteps[end.time_index].valid_time
obj_with_endid = [objindex for objindex, obj in enumerate(obj_set.timesteps[end.time_index].objects) if
for set_idx, objdesc_set in enumerate(object_desc.sets):
graph_set = self.graph.sets[set_idx]
# empty the graph set
del graph_set.timesteps[:]
graph_set.ref_graph.Clear()
# refg
for c in objdesc_set.ref_graph.connections:
obj_con = self.pb_reference.ObjectConnection()
start, end = c.n1, c.n2
obj_con.n1.time = objdesc_set.timesteps[start.time_index].valid_time
obj_with_startid = \
[objindex for objindex, obj in enumerate(objdesc_set.timesteps[start.time_index].objects) if
obj.id == start.object_id][0]
obj_con.n1.object.CopyFrom(objdesc_set.timesteps[start.time_index].objects[obj_with_startid])
obj_con.n2.time = objdesc_set.timesteps[end.time_index].valid_time
obj_with_endid = [objindex for objindex, obj in enumerate(objdesc_set.timesteps[end.time_index].objects) if
obj.id == end.object_id][0]
obj_con.n2.object.CopyFrom(obj_set.timesteps[end.time_index].objects[obj_with_endid])
obj_con.n2.object.CopyFrom(objdesc_set.timesteps[end.time_index].objects[obj_with_endid])
graph_set.object_graph.connections.append(obj_con)
graph_set.object_graph.connections.append(obj_con)
return self.graph
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