2. Software and Packages¶
GMT is a toolbox for plotting. We feed it with proper data and it draws beautiful pictures for us in return. Because GMT only does the plotting job, we usually need other tools in our workflow, such as preparing the data for GMT or editing the output files from GMT. This page lists some packages I recommend installing when using GMT.
2.1. Text editor¶
We communicate with GMT using a command-line interface, such as the UNIX system’s Shell. That is, we can write all the commands down in a single script (or batch file, whatever you call) and have it run like a Python or bash script. For PyGMT, the way to use it is really similar to writing a Python script. Many operating systems have their built-in text editor for writing a script, like Notepad in Windows. However, I highly recommend finding a better text editor crafted for programming. These fancy editors come along with many handy features like syntax highlighting, auto-indentation, basic debugging, etc. The followings are some popular choices:
2.1.1. Gedit¶
Initially designed on GNOME’s desktop (like Ubuntu) as a light-weighted text editor. It’s simple, easy to use, and has syntax highlighting. It has even released on all PC platforms.
2.1.2. Sublime Text¶
A popular and powerful code editor with lots of great functions. You can even download extra modules designed by its community, and personalize your own editor. It is available on all platforms and provides a “life-time” trial version, which means you only need to buy the license when you feel worth it.
2.1.3. Notepad++¶
Notepad++ is a light editor but equipped with the most useful functions for coding. It’s best if you are looking for a replacement for Notepad. Unfortunately, it has only supported Windows platform so far.
Besides, there are still other good editors like Vim, Nano, Kate, Crimson Editor. Feel free to pick whichever you feel the best.
2.2. Jupyter¶
The Jupyter project’s core concept is to provide a standard for open-source software and develop interactive computing interfaces for users who work with different programming languages. Jupyter has many software products, and if you plan to use PyGMT, I recommend installing Jupyter Lab because it allows you to use your web browser as an integrated interface for developing your scripts. See here for more detailed descriptions about Jupyter Lab. The PyGMT scripts provided in the following chapters are written in the Jupyter Notebook format. (Disclaimer: I am currently a team member of the Jupyter Meets the Earth project. All descriptions about Jupyter in these tutorials are my personal opinions and do not represent the Jupyter dev team. I wrote these tutorials using my off-work time.)
2.3. GDAL¶
GMT natively supports some geospatial formats such as NetCDF and plain text files. Users can also install GDAL for additional support to other common data formats, including GeoTIFF and shapefile. GDAL is short for “Geospatial Data Abstraction Library.” It is open-source software and is constantly updating. As of now, GDAL supports at least 142 raster formats and 84 vector formats. GDAL comes with handy console commands which let you browse or edit geospatial data without pain. Besides, GDAL also serves as a library that can be run as a module in many programming languages such as Python. GDAL can be installed on any platform independently or as a part of the QGIS standard installation since QGIS uses it for manipulating geospatial data. Note that if you want GMT to read more GDAL-supported file formats, you have to install GDAL before installing GMT.
2.4. Graphic interface for processing geospatial data¶
GMT is powerful because it manipulates geospatial data with a few command lines, even though you have to make a complex figure. However, there is always time you might just want to browse your data or run some simple tasks. In this case, a graphic interface of GIS for analyzing geospatial data would be your best friend.
2.4.1. QGIS¶
QGIS is popular free GIS software released in 2009. Numerous users and volunteers have joined the community to make it better. It uses Python as the console language, which makes users efficiently process data in a graphic or script-based fashion. You can also make your plugins to increase working efficiency. QGIS supports various operating systems, even including Android!
2.4.2. ArcGIS¶
ArcGIS is a well-known business GIS software designed by Esri. This name ArcGIS actually refers to a bunch of packages as Esri fine-tunes their products based on various needs, and we can choose the best package to work for different goals. Python is also the scripting language supported by ArcGIS. Unfortunately, ArcGIS is only available on Windows.
2.4.3. Google Earth¶
Strictly speaking, Google Earth is only “Globe software.” We are supposed to view geospatial data using this software instead of editing them. In Google Earth, we can only set up simple features or browse data from other sources. However, this software is still capable of many tasks. Google Earth now supports any platform, including Android, and both standard and professional versions are provided.
2.5. Image processing and editing software¶
For GMT 6, users can select the output map format, for example, vector-format PDF or image-format PNG. Nevertheless, to tweak the map just a little (e.g., adjusting resolution and image size), it is still easier to use an image processor as it saves your time from rerunning the GMT script. Here I introduce some popular tools to help expedite your task:
2.5.1. ImageMagick¶
An open-source and free package for image processing. It includes numerous commands; each of them has various options. It also supports many image or vector formats. You can run the command
convert
to easily adjust images. ImageMagick is available on several platforms and is pre-installed on Linux as one of the standard OS packages.
2.5.2. Adobe Illustrator¶
Probably the most popular software for processing vectorized images, developed by Adobe. It now provides Windows and Mac versions.
2.6. PostScript viewer¶
The default map format of GMT 6 is PDF, so normally your computer should be able to read the output map without problems. However, if you are using GMT 5 or an earlier version, the output format would be fixed to PostScript (see Basic Concepts and Terms for more details). The following list contains software that can read those PostScript (PS) files.
2.6.1. Google Docs¶
The default viewer for Google Drive and Gmail, without any installation. If you don’t want to set up anything on your computer, just simply upload your PS images to Google Drive and open then in your browser.
2.6.2. Ghostscript family¶
As free software, Ghostscript is designed for viewing or converting PS and PDF files. It is a huge family with variants on different platforms. For example, GSview runs on Windows and has a graphic interface. Ghostview and GV, on the other hand, thrive on Unix and related systems.