From 56e2bcd47cf3b4bf8003abc085fa3248e4f68834 Mon Sep 17 00:00:00 2001 From: Lionel GUEZ <guez@lmd.ens.fr> Date: Tue, 12 Sep 2023 12:56:24 +0200 Subject: [PATCH] Use function `get_duration` The downside is that we store all duration values. --- Trajectories/plot_traj.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Trajectories/plot_traj.py b/Trajectories/plot_traj.py index 7b98f87c..897cb46a 100755 --- a/Trajectories/plot_traj.py +++ b/Trajectories/plot_traj.py @@ -88,13 +88,9 @@ if __name__ == "__main__": else: # args.min_duration > 1 n_long_traj = 0 + duration_array = get_duration(expanded_traj, e_overestim) - for traj in expanded_traj: - duration = report_graph.node_to_date_eddy(traj[- 1], e_overestim, - only_date = True) \ - - report_graph.node_to_date_eddy(traj[0], e_overestim, - only_date = True) - + for traj, duration in zip(expanded_traj, duration_array): if duration >= args.min_duration: n_long_traj += 1 plot_single_traj(traj, e_overestim, SHPC, args.orientation, ax, -- GitLab