Note
Go to the end to download the full example code or to run this example in your browser via Binder
Build path of particle driftingΒΆ
Load data cube
c = GridCollection.from_netcdf_cube(
get_demo_path("dt_med_allsat_phy_l4_2005T2.nc"),
"longitude",
"latitude",
"time",
unset=True,
)
Advection properties
nb_days, step_by_day = 10, 6
nb_time = step_by_day * nb_days
kw_p = dict(nb_step=1, time_step=86400 / step_by_day)
t0 = 20210
Get paths
/home/docs/checkouts/readthedocs.org/user_builds/py-eddy-tracker/conda/latest/lib/python3.10/site-packages/numpy-1.24.3-py3.10-linux-x86_64.egg/numpy/ma/core.py:1020: RuntimeWarning: overflow encountered in multiply
result = self.f(da, db, *args, **kwargs)
/home/docs/checkouts/readthedocs.org/user_builds/py-eddy-tracker/conda/latest/lib/python3.10/site-packages/numpy-1.24.3-py3.10-linux-x86_64.egg/numpy/ma/core.py:4348: RuntimeWarning: invalid value encountered in multiply
self._data.__imul__(other_data)
Plot paths
ax = plt.figure(figsize=(9, 6)).add_subplot(111, aspect="equal")
ax.plot(x0, y0, "k.", ms=20)
ax.plot(x, y, lw=3)
ax.set_title("10 days particle paths")
ax.set_xlim(31, 35), ax.set_ylim(32, 34.5)
ax.grid()
Total running time of the script: ( 0 minutes 1.729 seconds)