diff --git a/Inst_eddies/Analysis/plot_eddy_contours.py b/Inst_eddies/Analysis/plot_eddy_contours.py index fa4e606c8d63e289abcf1be6aaafaf8089ff4e9b..14ab41c32d43679f526aa3cb12aedb26d7670c4f 100755 --- a/Inst_eddies/Analysis/plot_eddy_contours.py +++ b/Inst_eddies/Analysis/plot_eddy_contours.py @@ -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()):