Integrating the Generic Mapping Tools with the Scientific Python Ecosystem

Leonardo Uieda, Paul Wessel

Info

About

The poster presented at the meeting.

This is the third presentation I gave about my work on GMT/Python (see my Scipy2017 talk and my AGU2017 poster). This is by far the nicest poster I have ever designed. It showcases the new support for gmt.Figure.grdimage, the built-in Earth relief datasets in GMT6, and plotting vectors with gmt.Figure.plot. I wanted to have a more sophisticated showcase of grdimage but I ran into some bugs before the conference and wasn't able to finish it in time. Still, I'm amazed at how few lines of code are required to make the figure in the poster. The more I get to know GMT, the more I'm impressed by how much thought and attention was, and still is, poured into it.

I used the fonts Roboto Mono for code, Roboto for headings, and Barlow for other text. All can be downloaded from Google Fonts. The poster was made using Inkscape. The QR codes were generated using qrencode:

qrencode -t EPS -o qrcode.eps URL

Abstract

The Generic Mapping Tools (GMT) are used throughout the geosciences to processes spatial data and create publication quality data visualizations, such as contour maps, earthquake focal mechanism solutions, and animations. The software is programmed in the C language and is accessed through a command-line interface. Recent versions of GMT also provide an Application Programming Interface (API) that allows access to the core functionality from other programming languages, potentially expanding the reach of GMT far beyond the current user base. A GMT toolbox for Matlab using the API has already been released, and an experimental interface from the Julia language is being developed. We are building a software library to interface GMT with the Python programming language. Popularity of Python has grown steadily in the Earth Sciences due to its simplicity and powerful set of scientific libraries. However, there is still great need for the geospatial processing and mapping capabilities of GMT. The GMT/Python library integrates with the scientific Python ecosystem through the support of common Python data types: numpy "ndarrays" and Pandas "DataFrames" for tabular data and xarray "Datasets" for grids. We have also implemented support for the Jupyter notebooks, a web-based interactive computing environment (an example is available at try.gmtpython.xyz. These features will help make GMT more accessible to students and professional geoscientists who lack an extensive background in Unix tools and shell scripting. GMT/Python is an open-source project in early stages of development. The current focus is on the implementation of a robust set of core routines that implement the bridge between Python and GMT. Later, we will expand the library to cover the entire functionality of GMT. A first release is predicted for the late 2018. The latest documentation and source code can be accessed through the website www.gmtpython.xyz.