From dbe865904ff7d399071ef35abbeff5224797660a Mon Sep 17 00:00:00 2001 From: Lionel GUEZ <guez@lmd.ipsl.fr> Date: Wed, 10 Jul 2024 08:07:15 +0200 Subject: [PATCH] Use method `comp_ishape_n` --- Overlap/Analysis/report_graph.py | 7 ++----- Trajectories/Analysis/plot_traj.py | 5 +---- Trajectories/cost_function.py | 3 +-- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Overlap/Analysis/report_graph.py b/Overlap/Analysis/report_graph.py index b58442b0..2ad72b04 100755 --- a/Overlap/Analysis/report_graph.py +++ b/Overlap/Analysis/report_graph.py @@ -42,11 +42,8 @@ def set_attribute(G, SHPC, orientation): <= SHPC.get_n_shapes(0, orientation) * SHPC.n_slices / 100 ): for n in G: - date_index, eddy_index = util_eddies.node_to_date_eddy( - n, G.graph["e_overestim"] - ) - i_slice, ishape = SHPC.comp_ishape( - date_index, eddy_index, orientation + i_slice, ishape = SHPC.comp_ishape_n( + n, G.graph["e_overestim"], orientation ) reader = SHPC.get_reader(i_slice, orientation, "extremum") shape_rec = reader.shapeRecord(ishape) diff --git a/Trajectories/Analysis/plot_traj.py b/Trajectories/Analysis/plot_traj.py index cd53fd12..6b2550e0 100755 --- a/Trajectories/Analysis/plot_traj.py +++ b/Trajectories/Analysis/plot_traj.py @@ -22,10 +22,7 @@ def get_extr_coord(traj, e_overestim, SHPC, orientation): y = [] for node in traj: - date_index, eddy_index = util_eddies.node_to_date_eddy( - node, e_overestim - ) - i_slice, ishape = SHPC.comp_ishape(date_index, eddy_index, orientation) + i_slice, ishape = SHPC.comp_ishape_n(node, e_overestim, orientation) shape = SHPC.get_reader(i_slice, orientation, layer="extremum").shape( ishape ) diff --git a/Trajectories/cost_function.py b/Trajectories/cost_function.py index e0b7abae..82698f6d 100755 --- a/Trajectories/cost_function.py +++ b/Trajectories/cost_function.py @@ -76,8 +76,7 @@ def node_to_prop(node_list, e_overestim, SHPC, orientation): properties = [] for n in node_list: - date_index, eddy_index = util_eddies.node_to_date_eddy(n, e_overestim) - i_slice, ishape = SHPC.comp_ishape(date_index, eddy_index, orientation) + i_slice, ishape = SHPC.comp_ishape_n(n, e_overestim, orientation) shapeRec = SHPC.get_reader( i_slice, orientation, "extremum" ).shapeRecord(ishape) -- GitLab