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

Take handler as argument of snapshot

Instead of readers. Preparing for extension to receive orientation.
parent 36c4e583
No related branches found
No related tags found
No related merge requests found
...@@ -33,8 +33,7 @@ def func(d, ax, ishape_lists_all, handlers, bbox, light): ...@@ -33,8 +33,7 @@ def func(d, ax, ishape_lists_all, handlers, bbox, light):
ax.set_ylim(bbox[1], bbox[3]) ax.set_ylim(bbox[1], bbox[3])
for ishape_lists, handler in zip(ishape_lists_all, handlers): for ishape_lists, handler in zip(ishape_lists_all, handlers):
plot_eddy_contours.snapshot(ax, ishape_lists[d], handler["readers"], plot_eddy_contours.snapshot(ax, ishape_lists[d], handler, light = light)
light = light)
ax.gridlines(draw_labels = True) ax.gridlines(draw_labels = True)
ax.coastlines() ax.coastlines()
......
...@@ -57,18 +57,18 @@ def select_ishapes(d, d_init, ishape_last, reader_extr, window = None): ...@@ -57,18 +57,18 @@ def select_ishapes(d, d_init, ishape_last, reader_extr, window = None):
return ishape_list 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()): src_crs = ccrs.PlateCarree()):
"""Plots extrema, outermost contours and max-speed contours. """Plots extrema, outermost contours and max-speed contours.
dashed: boolean.""" dashed: boolean."""
for ishape in ishape_list: for ishape in ishape_list:
shape_rec_extr = readers["extremum"].shapeRecord(ishape) shape_rec_extr = handler["readers"]["extremum"].shapeRecord(ishape)
shape_outer = readers["outermost_contour"].shape(ishape) shape_outer = handler["readers"]["outermost_contour"].shape(ishape)
if "max_speed_contour" in readers: if "max_speed_contour" in handler["readers"]:
shape_m_s = readers["max_speed_contour"].shape(ishape) shape_m_s = handler["readers"]["max_speed_contour"].shape(ishape)
else: else:
shape_m_s = None shape_m_s = None
...@@ -263,7 +263,7 @@ if __name__ == "__main__": ...@@ -263,7 +263,7 @@ if __name__ == "__main__":
handler["readers"]["extremum"], handler["readers"]["extremum"],
args.window) args.window)
if len(ishape_list) == 0: print(f"{shpc_dir}: No eddy found") 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) light = args.light)
ax.set_title(f"d = {d}", y = 1.05) ax.set_title(f"d = {d}", y = 1.05)
......
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