.. 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_select_track_across_area.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_select_track_across_area.py: Tracks which go through area ============================ .. GENERATED FROM PYTHON SOURCE LINES 6-11 .. 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 12-13 Load experimental atlas, we filter position to have nice display .. GENERATED FROM PYTHON SOURCE LINES 13-18 .. code-block:: Python c = TrackEddiesObservations.load_file( py_eddy_tracker_sample.get_demo_path("eddies_med_adt_allsat_dt2018/Cyclonic.zarr") ) c.position_filter(median_half_window=1, loess_half_window=5) .. GENERATED FROM PYTHON SOURCE LINES 19-20 We extract eddies in the area set below, but we ask to keep `full_path` .. GENERATED FROM PYTHON SOURCE LINES 20-24 .. code-block:: Python x0, x1, y0, y1 = 3, 4, 37, 38 area = dict(llcrnrlon=x0, llcrnrlat=y0, urcrnrlon=x1, urcrnrlat=y1) c_subset = c.extract_with_area(area, full_path=True) .. GENERATED FROM PYTHON SOURCE LINES 25-26 Plot .. GENERATED FROM PYTHON SOURCE LINES 26-44 .. code-block:: Python fig = plt.figure(figsize=(12, 5)) ax = fig.add_axes((0.05, 0.05, 0.9, 0.9)) ax.set_xlim(-1, 9) ax.set_ylim(36, 40) ax.set_aspect("equal") ax.grid() c.plot(ax, color="gray", lw=0.1, ref=-10, label="All tracks ({nb_tracks} tracks)") c_subset.plot( ax, color="red", lw=0.2, ref=-10, label="selected tracks ({nb_tracks} tracks)" ) ax.plot( (x0, x0, x1, x1, x0), (y0, y1, y1, y0, y0), color="green", lw=1.5, label="Box of selection", ) ax.legend() .. image-sg:: /python_module/08_tracking_manipulation/images/sphx_glr_pet_select_track_across_area_001.png :alt: pet select track across area :srcset: /python_module/08_tracking_manipulation/images/sphx_glr_pet_select_track_across_area_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 3.145 seconds) .. _sphx_glr_download_python_module_08_tracking_manipulation_pet_select_track_across_area.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_select_track_across_area.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: pet_select_track_across_area.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: pet_select_track_across_area.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: pet_select_track_across_area.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_