.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/caribbean-bathymetry.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_caribbean-bathymetry.py: Bathymetry single-beam surveys of the Caribbean ----------------------------------------------- This dataset is a compilation of several public domain single-beam bathymetry surveys of the ocean in the Caribbean. The data display a wide range of tectonic activity, uneven distribution, and even clear systematic errors in some of the survey lines. **Original source:** `NOAA NCEI `__ .. GENERATED FROM PYTHON SOURCE LINES 20-25 .. code-block:: default import pandas as pd import pygmt import ensaio .. GENERATED FROM PYTHON SOURCE LINES 26-27 Download and cache the data and return the path to it on disk .. GENERATED FROM PYTHON SOURCE LINES 27-30 .. code-block:: default fname = ensaio.fetch_caribbean_bathymetry(version=1) print(fname) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none /home/runner/work/_temp/cache/ensaio/v1/caribbean-bathymetry.csv.xz .. GENERATED FROM PYTHON SOURCE LINES 31-32 Load the CSV formatted data with pandas .. GENERATED FROM PYTHON SOURCE LINES 32-35 .. code-block:: default data = pd.read_csv(fname) data .. raw:: html
survey_id latitude longitude depth_m
0 FM0501 23.13070 -87.99680 75
1 FM0501 23.11940 -87.98640 75
2 FM0501 23.10810 -87.97610 73
3 FM0501 23.09670 -87.96580 73
4 FM0501 23.08540 -87.95540 73
... ... ... ... ...
1938090 EW0003 9.92284 -84.72557 20
1938091 EW0003 9.92282 -84.72565 20
1938092 EW0003 9.92283 -84.72570 20
1938093 EW0003 9.92284 -84.72574 21
1938094 EW0003 9.92286 -84.72576 20

1938095 rows × 4 columns



.. GENERATED FROM PYTHON SOURCE LINES 36-37 Make a PyGMT map with the data points colored by the depth. .. GENERATED FROM PYTHON SOURCE LINES 37-55 .. code-block:: default fig = pygmt.Figure() fig.basemap( region=[ data.longitude.min(), data.longitude.max(), data.latitude.min(), data.latitude.max(), ], projection="M15c", frame=True, ) pygmt.makecpt(cmap="viridis", series=[data.depth_m.min(), data.depth_m.max()]) fig.plot( x=data.longitude, y=data.latitude, color=data.depth_m, cmap=True, style="c0.02c" ) fig.colorbar(frame='af+l"bathymetric depth [m]"') fig.coast(land="#666666") fig.show() .. image-sg:: /gallery/images/sphx_glr_caribbean-bathymetry_001.png :alt: caribbean bathymetry :srcset: /gallery/images/sphx_glr_caribbean-bathymetry_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 55.271 seconds) .. _sphx_glr_download_gallery_caribbean-bathymetry.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: caribbean-bathymetry.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: caribbean-bathymetry.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_