diff --git a/Overlap/Analysis/plot_components.py b/Overlap/Analysis/plot_components.py index acb00fd7ff05991bfa2cea54f8312139e8cefc60..a1e606685ef37ed3a40f8f47f09f31f168a9dd08 100755 --- a/Overlap/Analysis/plot_components.py +++ b/Overlap/Analysis/plot_components.py @@ -214,30 +214,30 @@ if __name__ == "__main__": t0 = t1 print("Finding components...") - if args.window is not None: - for n, d in G.nodes.items(): - if util_eddies.in_window(d["coordinates"], args.window): - if "component" not in d: - extract_component_nx.add_component(G, n) + if args.window is None: + assign_all_components(G) if args.time: t1 = time.perf_counter() print("Elapsed time:", t1 - t0, "s") - t0 = t1 print("Plotting...") - dest_crs = ccrs.PlateCarree((args.window[0] + args.window[2]) / 2) - ax = plt.axes(projection=dest_crs) + ax = plt.axes(projection=ccrs.PlateCarree()) plot_all_components(G, label) else: - assign_all_components(G) + for n, d in G.nodes.items(): + if util_eddies.in_window(d["coordinates"], args.window): + if "component" not in d: + extract_component_nx.add_component(G, n) if args.time: t1 = time.perf_counter() print("Elapsed time:", t1 - t0, "s") + t0 = t1 print("Plotting...") - ax = plt.axes(projection=ccrs.PlateCarree()) + dest_crs = ccrs.PlateCarree((args.window[0] + args.window[2]) / 2) + ax = plt.axes(projection=dest_crs) plot_all_components(G, label) ax.coastlines()