diff --git a/Inst_eddies/Analysis/anim_eddy_contours.py b/Inst_eddies/Analysis/anim_eddy_contours.py index a63f2328b5b2e87bffacd294500ed04cd3e1093a..8caee5f68a80036ccfb1250dfbd2a013e455d5e2 100755 --- a/Inst_eddies/Analysis/anim_eddy_contours.py +++ b/Inst_eddies/Analysis/anim_eddy_contours.py @@ -33,8 +33,7 @@ def func(d, ax, ishape_lists_all, handlers, bbox, light): ax.set_ylim(bbox[1], bbox[3]) for ishape_lists, handler in zip(ishape_lists_all, handlers): - plot_eddy_contours.snapshot(ax, ishape_lists[d], handler["readers"], - light = light) + plot_eddy_contours.snapshot(ax, ishape_lists[d], handler, light = light) ax.gridlines(draw_labels = True) ax.coastlines() diff --git a/Inst_eddies/Analysis/plot_eddy_contours.py b/Inst_eddies/Analysis/plot_eddy_contours.py index ea08fe68ca11b8934c3dadf2973f158d09537e4b..2e309603d68adce31832fc769c21db79a17a55bb 100755 --- a/Inst_eddies/Analysis/plot_eddy_contours.py +++ b/Inst_eddies/Analysis/plot_eddy_contours.py @@ -57,18 +57,18 @@ def select_ishapes(d, d_init, ishape_last, reader_extr, window = None): return ishape_list -def snapshot(ax, ishape_list, readers, *, dashed = False, light = False, +def snapshot(ax, ishape_list, handler, *, dashed = False, light = False, src_crs = ccrs.PlateCarree()): """Plots extrema, outermost contours and max-speed contours. dashed: boolean.""" for ishape in ishape_list: - shape_rec_extr = readers["extremum"].shapeRecord(ishape) - shape_outer = readers["outermost_contour"].shape(ishape) + shape_rec_extr = handler["readers"]["extremum"].shapeRecord(ishape) + shape_outer = handler["readers"]["outermost_contour"].shape(ishape) - if "max_speed_contour" in readers: - shape_m_s = readers["max_speed_contour"].shape(ishape) + if "max_speed_contour" in handler["readers"]: + shape_m_s = handler["readers"]["max_speed_contour"].shape(ishape) else: shape_m_s = None @@ -263,7 +263,7 @@ if __name__ == "__main__": handler["readers"]["extremum"], args.window) if len(ishape_list) == 0: print(f"{shpc_dir}: No eddy found") - snapshot(ax, ishape_list, handler["readers"], dashed = args.dashed, + snapshot(ax, ishape_list, handler, dashed = args.dashed, light = args.light) ax.set_title(f"d = {d}", y = 1.05)