# In this case gif is use to create thumbnail which are not use but consume same time than video # So we create an empty file, to save time with open(args[0], "w") as _: pass return return super().save(*args, **kwargs) # %% # Data # ---- # Load Input time grid ADT c = GridCollection.from_netcdf_cube( get_demo_path("dt_med_allsat_phy_l4_2005T2.nc"), "longitude", "latitude", "time", # To create U/V variable heigth="adt", ) # %% # Anim # ---- # Particles setup step_p = 1 / 8 x, y = meshgrid(arange(13, 36, step_p), arange(28, 40, step_p)) x, y = x.reshape(-1), y.reshape(-1) # Remove all original position that we can't advect at first place t0 = 20181 m = ~isnan(c[t0].interp("u", x, y)) x0, y0 = x[m], y[m]
# So we create an empty file, to save time with open(args[0], "w") as _: pass return return super().save(*args, **kwargs) # %% n = NetworkObservations.load_file(get_path("network_med.nc")).network(651) n = n.extract_with_mask((n.time >= 20180) * (n.time <= 20269)) n = n.remove_dead_end(nobs=0, ndays=10) n.numbering_segment() c = GridCollection.from_netcdf_cube( get_path("dt_med_allsat_phy_l4_2005T2.nc"), "longitude", "latitude", "time", heigth="adt", ) # %% # Schema # ------ fig = plt.figure(figsize=(12, 6)) ax = fig.add_axes([0.05, 0.05, 0.9, 0.9]) _ = n.display_timeline(ax, field="longitude", marker="+", lw=2, markersize=5) # %% # Animation # --------- # Particle settings