๐ Crafting beautiful maps with PyGMT
Contents
๐ Crafting beautiful maps with PyGMTยถ
Welcome to the EGU22 PyGMT short course ๐ฅณยถ
This Jupyter book ๐ contains PyGMT tutorials for producing maps ๐บ๏ธ and doing geospatial data processing ๐
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! ๐
๐ Quickstartยถ
To run these notebooks in an interactive Jupyter session online, ๐ฑ๏ธ click on the button below to launch on regular Binder.
Alternatively, you can go to a specific tutorial page, hover over the rocket ๐ icon on the top right, and click โBinderโ.
Note
If you see an error like toomanyrequests: You have reached your pull rate limit
, you can try this Pangeo Binder link instead as a backup, though it
will require a GitHub account to work:
๐ป Running the notebooks locallyยถ
If you prefer to run the ๐งโ๐ซ tutorials with a local installation of PyGMT, then follow along! For this EGU22 short course, we recommend creating a virtual conda environment and installing the ๐ Python libraries inside.
Tip
For users comfortable with using git
, feel free to โฌ๏ธ download or
clone the repository containing the short course materials directly using
git clone https://github.com/GenericMappingTools/egu22pygmt.git
Hereโs the instructions to install the egu22pygmt
environment:
Ensure that you have the
conda
package manager installed (e.g. viaminiconda
or Anaconda). You can also usemamba
which tends to be a โก faster alternative.Make a folder called โegu22pygmtโ. This will be where you will put all the Jupyter notebooks and data files ๐๏ธ used in the short course.
Download a copy of the โenvironment.ymlโ file which contains a ๐ list of dependencies required to run the tutorials in this short course. Get it at https://github.com/GenericMappingTools/egu22pygmt/blob/main/environment.yml.
Run the following commands on the ๐งโ๐ป command-line to create the virtual environment
cd /path/to/egu22pygmt conda env create --name egu22pygmt --file environment.yml
Once the installation is completed ๐, launch Jupyter Lab as follows:
conda activate egu22pygmt 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 will take you to the Jupyter Lab page.Download the Jupyter notebook(s) you want to run (e.g. https://www.generic-mapping-tools.org/egu22pygmt/first-figure.html) using either the download button on the โ๏ธ top right (select โ.ipynbโ) or from GitHub at https://github.com/GenericMappingTools/egu22pygmt/tree/main/book. Make sure to put the *.ipynb file(s) inside of the โegu22pygmtโ folder.
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 PyGMT in another project outside of this course, please follow the official installation instructions at https://www.pygmt.org/latest/install.html