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

Take advantage of new `comp_ishape` functionality

`comp_ishape` can now compute `i_slice`.
parent ec92f226
No related branches found
No related tags found
No related merge requests found
...@@ -39,10 +39,7 @@ else: ...@@ -39,10 +39,7 @@ else:
eddy_index = int(reply[1]) eddy_index = int(reply[1])
assert eddy_index >= 1 assert eddy_index >= 1
i_slice = SHPC.get_slice(date) i_slice, ishape = SHPC.comp_ishape(date, eddy_index, args.orientation)
i_slice, ishape = SHPC.comp_ishape(
date, eddy_index, args.orientation, i_slice
)
print("ishape =", ishape) print("ishape =", ishape)
......
...@@ -25,13 +25,11 @@ date_head, eddy_i_head = util_eddies.node_to_date_eddy(my_head, e_overestim) ...@@ -25,13 +25,11 @@ date_head, eddy_i_head = util_eddies.node_to_date_eddy(my_head, e_overestim)
date_tail, eddy_i_tail = util_eddies.node_to_date_eddy(my_tail, e_overestim) date_tail, eddy_i_tail = util_eddies.node_to_date_eddy(my_tail, e_overestim)
print(f"{date_head=}") print(f"{date_head=}")
print(f"{date_tail=}") print(f"{date_tail=}")
i_slice_head = SHPC.get_slice(date_head)
i_slice_tail = SHPC.get_slice(date_tail)
i_slice_head, ishape_head = SHPC.comp_ishape( i_slice_head, ishape_head = SHPC.comp_ishape(
date_head, eddy_i_head, orientation, i_slice_head date_head, eddy_i_head, orientation
) )
i_slice_tail, ishape_tail = SHPC.comp_ishape( i_slice_tail, ishape_tail = SHPC.comp_ishape(
date_tail, eddy_i_tail, orientation, i_slice_tail date_tail, eddy_i_tail, orientation
) )
fig = plt.figure() fig = plt.figure()
projection = ccrs.PlateCarree() projection = ccrs.PlateCarree()
......
...@@ -45,9 +45,8 @@ def set_attribute(G, SHPC, orientation): ...@@ -45,9 +45,8 @@ def set_attribute(G, SHPC, orientation):
date_index, eddy_index = util_eddies.node_to_date_eddy( date_index, eddy_index = util_eddies.node_to_date_eddy(
n, G.graph["e_overestim"] n, G.graph["e_overestim"]
) )
i_slice = SHPC.get_slice(date_index)
i_slice, ishape = SHPC.comp_ishape( i_slice, ishape = SHPC.comp_ishape(
date_index, eddy_index, orientation, i_slice date_index, eddy_index, orientation
) )
reader = SHPC.get_reader(i_slice, orientation, "extremum") reader = SHPC.get_reader(i_slice, orientation, "extremum")
shape_rec = reader.shapeRecord(ishape) shape_rec = reader.shapeRecord(ishape)
......
...@@ -25,10 +25,7 @@ def get_extr_coord(traj, e_overestim, SHPC, orientation): ...@@ -25,10 +25,7 @@ def get_extr_coord(traj, e_overestim, SHPC, orientation):
date_index, eddy_index = util_eddies.node_to_date_eddy( date_index, eddy_index = util_eddies.node_to_date_eddy(
node, e_overestim node, e_overestim
) )
i_slice = SHPC.get_slice(date_index) i_slice, ishape = SHPC.comp_ishape(date_index, eddy_index, orientation)
i_slice, ishape = SHPC.comp_ishape(
date_index, eddy_index, orientation, i_slice
)
shape = SHPC.get_reader(i_slice, orientation, layer="extremum").shape( shape = SHPC.get_reader(i_slice, orientation, layer="extremum").shape(
ishape ishape
) )
......
...@@ -77,10 +77,7 @@ def node_to_prop(node_list, e_overestim, SHPC, orientation): ...@@ -77,10 +77,7 @@ def node_to_prop(node_list, e_overestim, SHPC, orientation):
for n in node_list: for n in node_list:
date_index, eddy_index = util_eddies.node_to_date_eddy(n, e_overestim) date_index, eddy_index = util_eddies.node_to_date_eddy(n, e_overestim)
i_slice = SHPC.get_slice(date_index) i_slice, ishape = SHPC.comp_ishape(date_index, eddy_index, orientation)
i_slice, ishape = SHPC.comp_ishape(
date_index, eddy_index, orientation, i_slice
)
shapeRec = SHPC.get_reader( shapeRec = SHPC.get_reader(
i_slice, orientation, "extremum" i_slice, orientation, "extremum"
).shapeRecord(ishape) ).shapeRecord(ishape)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment