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

Add script for time filtering of trajectories

parent 1aebbed8
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
import json
import report_graph
import bisect
import sys
if len(sys.argv) != 4:
sys.exit("Required arguments: last-date input-file output-file")
with open("e_overestim.txt") as f: e_overestim = int(f.read())
last_date = int(sys.argv[1])
last_node = report_graph.date_eddy_to_node(last_date, e_overestim, e_overestim)
with open(sys.argv[2]) as f: expanded_traj = json.load(f)
filt_traj = []
for t in expanded_traj:
ip = bisect.bisect(t, last_node)
if ip != 0: filt_traj.append(t[:ip])
with open(sys.argv[3], "w") as f: json.dump(filt_traj, f)
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