.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "python_module/08_tracking_manipulation/pet_display_track.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. or to run this example in your browser via Binder .. rst-class:: sphx-glr-example-title .. _sphx_glr_python_module_08_tracking_manipulation_pet_display_track.py: Display Tracks ====================== .. GENERATED FROM PYTHON SOURCE LINES 6-12 .. code-block:: Python from matplotlib import pyplot as plt import py_eddy_tracker_sample from py_eddy_tracker.observations.tracking import TrackEddiesObservations .. GENERATED FROM PYTHON SOURCE LINES 13-14 Load experimental atlas .. GENERATED FROM PYTHON SOURCE LINES 14-24 .. code-block:: Python a = TrackEddiesObservations.load_file( py_eddy_tracker_sample.get_demo_path( "eddies_med_adt_allsat_dt2018/Anticyclonic.zarr" ) ) c = TrackEddiesObservations.load_file( py_eddy_tracker_sample.get_demo_path("eddies_med_adt_allsat_dt2018/Cyclonic.zarr") ) print(a) .. rst-class:: sphx-glr-script-out .. code-block:: none /home/docs/checkouts/readthedocs.org/user_builds/py-eddy-tracker/conda/latest/lib/python3.12/site-packages/py_eddy_tracker/observations/observation.py:303: RuntimeWarning: invalid value encountered in divide v = v.astype("f4") / v.sum() * 100 /home/docs/checkouts/readthedocs.org/user_builds/py-eddy-tracker/conda/latest/lib/python3.12/site-packages/py_eddy_tracker/observations/observation.py:305: RuntimeWarning: invalid value encountered in divide v /= hist_numba(x, bins=bins)[0] | 473554 observations from 15706.0 to 25334.0 (9629.0 days, ~49 obs/day) | Speed area : 0.00 Mkm²/day | Effective area : 0.00 Mkm²/day ----Distribution in Amplitude: | Amplitude bounds (cm) 0.00 1.00 2.00 3.00 4.00 5.00 10.00 500.00 | Percent of eddies : 21.69 25.72 15.32 9.95 6.20 14.80 6.32 ----Distribution in Radius: | Speed radius (km) 0.00 15.00 30.00 45.00 60.00 75.00 100.00 200.00 2000.00 | Percent of eddies : 0.85 48.58 36.33 10.97 2.59 0.64 0.03 0.00 | Effective radius (km) 0.00 15.00 30.00 45.00 60.00 75.00 100.00 200.00 2000.00 | Percent of eddies : 100.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ----Distribution in Latitude Latitude bounds -90.00 -60.00 -15.00 15.00 60.00 90.00 Percent of eddies : 0.00 0.00 0.00 100.00 0.00 Percent of speed area : nan nan nan nan nan Percent of effective area : nan nan nan nan nan Mean speed radius (km) : nan nan nan 32.28 nan Mean effective radius (km): nan nan nan 0.00 nan Mean amplitude (cm) : nan nan nan 3.51 nan | 12224 tracks (38.74 obs/tracks, shorter 10 obs, longer 1183 obs) | 27246 filled observations (2.23 obs/tracks, 5.75 % of total) | Intepolated speed area : 0.00 Mkm²/day | Intepolated effective area : 0.00 Mkm²/day | Distance by day : Mean 3.68 , Median 2.53 km/day | Distance by track : Mean 139.01 , Median 77.28 km/track ----Distribution in lifetime: | Lifetime (days ) 1.00 30.00 90.00 180.00 270.00 365.00 1000.00 10000.00 | Percent of tracks : 65.03 26.87 5.72 1.20 0.51 0.65 0.03 | Percent of eddies : 27.88 33.88 17.90 6.74 4.02 8.65 0.93 .. GENERATED FROM PYTHON SOURCE LINES 25-26 keep only eddies longer than 20 weeks, use -1 to have no upper limit .. GENERATED FROM PYTHON SOURCE LINES 26-30 .. code-block:: Python a = a.extract_with_length((7 * 20, -1)) c = c.extract_with_length((7 * 20, -1)) print(a) .. rst-class:: sphx-glr-script-out .. code-block:: none /home/docs/checkouts/readthedocs.org/user_builds/py-eddy-tracker/conda/latest/lib/python3.12/site-packages/py_eddy_tracker/observations/observation.py:303: RuntimeWarning: invalid value encountered in divide v = v.astype("f4") / v.sum() * 100 /home/docs/checkouts/readthedocs.org/user_builds/py-eddy-tracker/conda/latest/lib/python3.12/site-packages/py_eddy_tracker/observations/observation.py:305: RuntimeWarning: invalid value encountered in divide v /= hist_numba(x, bins=bins)[0] | 124198 observations from 15706.0 to 25334.0 (9629.0 days, ~13 obs/day) | Speed area : 0.00 Mkm²/day | Effective area : 0.00 Mkm²/day ----Distribution in Amplitude: | Amplitude bounds (cm) 0.00 1.00 2.00 3.00 4.00 5.00 10.00 500.00 | Percent of eddies : 5.11 9.99 12.06 11.79 9.32 31.51 20.21 ----Distribution in Radius: | Speed radius (km) 0.00 15.00 30.00 45.00 60.00 75.00 100.00 200.00 2000.00 | Percent of eddies : 0.19 22.20 46.88 22.96 6.31 1.39 0.07 0.00 | Effective radius (km) 0.00 15.00 30.00 45.00 60.00 75.00 100.00 200.00 2000.00 | Percent of eddies : 100.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ----Distribution in Latitude Latitude bounds -90.00 -60.00 -15.00 15.00 60.00 90.00 Percent of eddies : 0.00 0.00 0.00 100.00 0.00 Percent of speed area : nan nan nan nan nan Percent of effective area : nan nan nan nan nan Mean speed radius (km) : nan nan nan 40.03 nan Mean effective radius (km): nan nan nan 0.00 nan Mean amplitude (cm) : nan nan nan 6.62 nan | 469 tracks (264.81 obs/tracks, shorter 140 obs, longer 1183 obs) | 3348 filled observations (7.14 obs/tracks, 2.70 % of total) | Intepolated speed area : 0.00 Mkm²/day | Intepolated effective area : 0.00 Mkm²/day | Distance by day : Mean 3.13 , Median 2.00 km/day | Distance by track : Mean 825.11 , Median 695.99 km/track ----Distribution in lifetime: | Lifetime (days ) 1.00 30.00 90.00 180.00 270.00 365.00 1000.00 10000.00 | Percent of tracks : 0.00 0.00 37.74 31.34 13.22 16.84 0.85 | Percent of eddies : 0.00 0.00 22.44 25.72 15.34 32.97 3.53 .. GENERATED FROM PYTHON SOURCE LINES 31-32 Position filtering for nice display .. GENERATED FROM PYTHON SOURCE LINES 32-35 .. code-block:: Python a.position_filter(median_half_window=1, loess_half_window=5) c.position_filter(median_half_window=1, loess_half_window=5) .. GENERATED FROM PYTHON SOURCE LINES 36-37 Plot .. GENERATED FROM PYTHON SOURCE LINES 37-45 .. code-block:: Python fig = plt.figure(figsize=(12, 5)) ax = fig.add_axes((0.05, 0.1, 0.9, 0.9)) ax.set_aspect("equal") ax.set_xlim(-6, 36.5), ax.set_ylim(30, 46) a.plot(ax, ref=-10, label="Anticyclonic ({nb_tracks} tracks)", color="r", lw=0.1) c.plot(ax, ref=-10, label="Cyclonic ({nb_tracks} tracks)", color="b", lw=0.1) ax.legend() ax.grid() .. image-sg:: /python_module/08_tracking_manipulation/images/sphx_glr_pet_display_track_001.png :alt: pet display track :srcset: /python_module/08_tracking_manipulation/images/sphx_glr_pet_display_track_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.965 seconds) .. _sphx_glr_download_python_module_08_tracking_manipulation_pet_display_track.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/AntSimi/py-eddy-tracker/master?urlpath=lab/tree/notebooks/python_module/08_tracking_manipulation/pet_display_track.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: pet_display_track.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: pet_display_track.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: pet_display_track.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_