# %% # Load Input grid, ADT will be used to detect eddies g = RegularGridDataset( data.get_path("nrt_global_allsat_phy_l4_20190223_20190226.nc"), "longitude", "latitude", ) ax = start_axes("ADT (cm)") m = g.display(ax, "adt", vmin=-120, vmax=120, factor=100) update_axes(ax, m) # %% # Get parameter for ow u_x = g.compute_stencil(g.grid("ugos")) u_y = g.compute_stencil(g.grid("ugos"), vertical=True) v_x = g.compute_stencil(g.grid("vgos")) v_y = g.compute_stencil(g.grid("vgos"), vertical=True) ow = g.vars["ow"] = (u_x - v_y)**2 + (v_x + u_y)**2 - (v_x - u_y)**2 ax = start_axes("Okubo weis") m = g.display(ax, "ow", vmin=-1e-10, vmax=1e-10, cmap="bwr") update_axes(ax, m) # %% # Gulf stream zoom ax = start_axes("Okubo weis, Gulf stream", zoom=True) m = g.display(ax, "ow", vmin=-1e-10, vmax=1e-10, cmap="bwr") kw_ed = dict(intern_only=True, color="k", lw=1) a.display(ax, **kw_ed), c.display(ax, **kw_ed)
return return super().save(*args, **kwargs) # %% # Data # ---- # To compute vorticity (:math:`\omega`) we compute u/v field with a stencil and apply the following equation with stencil # method : # # .. math:: # \omega = \frac{\partial v}{\partial x} - \frac{\partial u}{\partial y} g = RegularGridDataset(get_path("dt_med_allsat_phy_l4_20160515_20190101.nc"), "longitude", "latitude") g.add_uv("adt") u_y = g.compute_stencil(g.grid("u"), vertical=True) v_x = g.compute_stencil(g.grid("v")) g.vars["vort"] = v_x - u_y # %% # Display vorticity field fig, ax, _ = start_ax() mappable = g.display(ax, abs(g.grid("vort")), **kw_vorticity) cb = update_axes(ax, mappable) cb.set_label("Vorticity") # %% # Particles # --------- # Particles specification step = 1 / 32