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

Use method `ishape_range` in `select_ishapes`

Use method `ishape_range` in function `select_ishapes`.
parent ea0375b1
No related branches found
No related tags found
No related merge requests found
......@@ -31,27 +31,21 @@ def select_ishapes(d, SHPC, i_slice, orientation, window = None):
"""
ishape_first = SHPC.comp_ishape(d, eddy_index = 1, i_slice = i_slice,
orientation = orientation)
try:
ishape_last = SHPC.get_ishape_last(i_slice, orientation)\
[d - SHPC.d_init[i_slice]]
except TypeError:
ishape_list = []
ishape_list = SHPC.ishape_range(d, i_slice, orientation)
if window is None:
ishape_list_filt = ishape_list
else:
if window is None:
ishape_list = list(range(ishape_first, ishape_last + 1))
else:
ishape_list = []
reader = SHPC.get_reader(i_slice, layer = "extremum",
orientation = orientation)
ishape_list_filt = []
reader = SHPC.get_reader(i_slice, layer = "extremum",
orientation = orientation)
for ishape in range(ishape_first, ishape_last + 1):
points = reader.shape(ishape).points[0]
if util_eddies.in_window(points, window):
ishape_list.append(ishape)
for ishape in ishape_list:
points = reader.shape(ishape).points[0]
if util_eddies.in_window(points, window):
ishape_list_filt.append(ishape)
return ishape_list
return ishape_list_filt
def snapshot(ax, ishape_list, SHPC, i_slice, orientation, *, dashed = False,
light = False, src_crs = ccrs.PlateCarree()):
......
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