Mastering Geospatial Visualizations with GMT/PyGMT#

Welcome to the AGU24 GMT/ PyGMT workshop πŸ₯³! This Jupyter book πŸ“– contains tutorials for making maps πŸ—ΊοΈ and animations 🎦

πŸ“š Overview of tutorials#

Tutorial 1 - First figure πŸš€ and Subplots / layout

by Jing-Hui Tong

./tut01_firstfigure.html
Tutorial 2 - Integration with the scientific Python ecosystem 🐍: pandas and GeoPandas (tabular data πŸ—’οΈ)

by Yvonne FrΓΆhlich

./tut02_spe_pd_gpd.html
Tutorial 3 - Integration with the scientific Python ecosystem 🐍: Xarray (gridded data 🌐)

by Max Jones

./tut03_spe_xarray.html
Tutorial 4 - Geophysics (Seismology) 🌎🌏🌍

by Jing-Hui Tong and Yvonne FrΓΆhlich

./tut04_geophysics.html
Tutorial 5 - 3-D Topography (Planetary / Antarctic maps) πŸ”οΈ

by Wei Ji Leong and André Belém

./tut05_topography.html
Tutorial 6 - Animations with GMT 🎦

by Federico Esteban

./tut06_animation.html

Each tutorial is rendered on this website for easy viewing πŸ‘€, but they are all Jupyter notebooks designed to be ran interactively πŸ’«. See the instructions below on how you can start running the tutorials in no time! πŸš€

🌠 Setting up your environment#

To run these notebooks in an interactive Jupyter session online, πŸ–±οΈ click on the button below to launch on regular Binder.

Binder

Alternatively, you can go to a specific tutorial page, hover over the rocket πŸš€ icon on the top right, and click β€˜Binder’.

πŸ’» Creating a local environment for running tutorials#

If you prefer to run the πŸ§‘β€πŸ« tutorials with a local installation of GMT/PyGMT, then follow along! For this AGU24 workshop, we recommend creating a virtual conda environment and installing the C and 🐍 Python libraries inside.

Attention

If you are running this on Windows, we recommend installing a bash emulator (e.g. Git for Windows) so that you can run the command-line instructions below. A bash prompt is also a pre-requisite for the final animation tutorial that assumes a bash scripting environment.

Tip

For users comfortable with using git, feel free to ⬇️ download or clone the repository containing the workshop materials directly using git clone https://github.com/GenericMappingTools/agu24workshop.git

Here’s the instructions to install the agu24workshop environment:

  1. Ensure that you have the conda package manager installed (e.g. via miniconda or Anaconda). You can also use mamba which tends to be a ⚑ faster alternative.

  2. Make a folder called β€˜agu24workshop’. This will be where you will put all the Jupyter notebooks and data files πŸ—ƒοΈ used in the workshop.

  3. Download a copy of the β€˜environment.yml’ file which contains a πŸ“„ list of dependencies required to run the tutorials in this workshop. Get it at GenericMappingTools/agu24workshop.

  4. Run the following commands on the πŸ§‘β€πŸ’» command-line to create the virtual environment

    cd /path/to/agu24workshop
    conda env create --name agu24workshop --file environment.yml
    
  5. Once the installation is completed 🏁, launch Jupyter Lab as follows:

    conda activate agu24workshop
    jupyter lab
    

    This should open up a page in your default browser. If not, you can click and open the πŸ”— link that says http://localhost:8888/lab?token=... in your command-line terminal and this will take you to the Jupyter Lab page.

  6. Download the Jupyter notebook(s) you want to run (e.g. https://www.generic-mapping-tools.org/agu24workshop/tut01_firstfigure.html) using either the download button on the ↗️ top right (select β€˜.ipynb’) or from GitHub at GenericMappingTools/agu24workshop. Make sure to put the *.ipynb file(s) inside of the β€˜agu24workshop’ folder.

  7. Open the Jupyter notebook in the left-pane file browser, e.g. by πŸ–±οΈ double-clicking on first-figure.ipynb. You are now ready to run through the course materials πŸŽ‰!

Note

If you’re intending to use GMT/PyGMT in another project outside of this course, please follow the official installation instructions at: