GPlates

Easily install and use Generic Mapping Tools (GMT) on Mac OS X

There has been a long hiatus in my posts due to the time pressures of completing a PhD. So I hope to post somewhat more frequently with some tips and tricks that I have come across that might be useful to others.

One of the most important tools I have used in my studies, and my work, has been Generic Mapping Tools (GMT). GMT is a collection of open-source applications for plotting, processing and analyzing data – in geosciences, but also more generally. Essentially, if you use MS Excel (or similar) and like the idea of automating your data processing and plotting (without relying on somewhat dubious Macros), then GMT is something you should consider. If you use ArcGIS, QGIS or any other GIS tool, then GMT could be a partial or complete replacement for the plotting component of your work, or at least a great complementary tool. With GMT it becomes easy to create a workflow that will produce clean and “publication-quality” plots, that is easy to modify and share. GMT is also a community tool – with development led by Pål (Paul) Wessel, Walter H.F. Smith, Remko Scharroo, Joaquim F. Luis and Florian Wobbe (thanks guys!), and you can get all the information you need from the GMT website. You can also read an EoS article describing GMT, as well as watch video podcasts describing GMT through iTunes University.

Installing GMT used to be more complicated, but the development team has made it much easier to get started quickly. There’s a number of suggested ways of installing GMT, everything from compiling the latest code available from SVN, to pre-compiled binaries. From my experience, installing and using GMT is generally much easier on Unix-like systems (Mac OS X, Linux, etc.) than Windows. If you are on Windows, it may be easier to install Linux in a Virtual Machine than using Cygwin – but I would love to hear your experience in running GMT in Windows.

I have successfully compiled GMT from source, but it can be time-consuming to get all the dependencies – and so the workflow below, using package managers, is what I would recommend for Mac OS X users. Similar package managers exist for Linux. Let me know if you have a better way!

System setup

Users with a clean install of Mac OS X will need to install XCode and XCode command line tools. First, go to the App Store, and download and install XCode. Once it is ready (it can take a long time!), open XCode and accept any user agreement. In the Terminal type in xcode-select --install. Accept the XCode command line tools end-user license by typing sudo xcodebuild --license and following the instructions in the Terminal. You will only have to do this once.

Installing GMT4 and GMT5

The latest version of GMT is GMT5, but I recommend also having GMT4 on your system for backwards compatibility. The package manager I use is Macports (although Fink and Brew also likely have GMT). Package managers allow you to easily install software that might have complex dependencies. In this case, GMT depends on GDAL, GhostScript, NetCDF, GSHHG shorelines, and so on – which can be tedious to obtain and compile individually. The steps below will do everything in one go. To start, download and install Macports.

  1. Launch the Terminal
  2. Type in “sudo port selfupdate” to get Macports updated to the latest version
  3. To install the latest version of GMT4 with all necessary bundles (including netCDF, gdal, ghostscript, gshhg, etc.) type in “sudo port install gmt4”
  4. To install the latest version of GMT5 with all necessary bundles (including netCDF, gdal, ghostscript, gshhg, etc.) type in “sudo port install gmt5”.

Steps 3 to 4 can take some time (so make sure you have some time, and your laptop connected to mains power), but the whole process is automated. When you want to use GMT4, well just type in “psxy …”, “ps2raster …”, etc. When you want to use GMT5, type in “gmt psxy …”, “gmt ps2raster …”, etc., which allows you to use both GMT4 and GMT5 without using GMTSWITCH.

You will likely need to update your PATH variable. If you cannot launch GMT then you may need to add the default directory “/opt/local/lib/gmt4/bin/” and “/opt/local/lib/gmt4/bin/” to the PATH variable within “.bash_profile” or “.bashrc”. This link explains how to change the PATH variable using the Terminal.

Upgrading to new versions of GMT

Upgrading GMT using Macports is easy. In the Terminal, first run “sudo port selfupdate”. To upgrade all of your installed ports, type in “sudo port upgrade outdated”. If you want to just upgrade gmt, type in “sudo port upgrade gmt5”. For more info on common commands in Macports, check out this link.

Warning on netCDF

For those of you upgrading from GMT4 to GMT5, beware that the version of netCDF has changed. In GMT 4.5.8 or earlier, the default netCDF version was 3.x.x, while since GMT 4.5.8 the netCDF version was 4.x.x, meaning that the default type of GMT netCDF grids created has significantly changed. If you make a grid using a recent version of GMT4 (i.e. GMT 4.5.11) or GMT5, then that grid by default cannot be plotted or used by someone who is still working with GMT 4.5.8 or older. If you make grids that use the recent versions of netCDF, you can easily convert them to the “classic” and compatible grids, by running the following command:

“nccopy -k 1 $in_grid $out_grid -V”

The ‘nccopy’ application gets installed with GMT5, and is part of the netCDF bundle.

Final thoughts

GMT has been a critical piece of infrastructure for a lot of my work over the years, and will surely remain very important into the future. The frequent updates and a vibrant user community will ensure GMT remains relevant to a wide range of science data processing and plotting requirements. To close, here is a sample animation that I made using a combination of GPlates (plate tectonic reconstructions), GMT (plotting) and FFMPEG (for stitching frames into an animation – also available via Macports).

 

Education, Geology, Geophysics, GPlates

Developments in Plate Tectonics

On 4 September 2012 I will be giving a video conference presentation to Australian high schools using the Electroboard smartboard system on “Developments in Plate Tectonics”. This will be largely aimed at a general audience, with minimal assumptions about the tectonics background knowledge. I will post the PDF of the presentation and accompanying notes in the following days. For now, I have attached a PDF of the introduction and the suggested class activities.

Overview

The theory of Plate Tectonics is the unifying idea that explains the evolution of our planet’s surface and subsurface – everything from the motion of continents through geological time to the development of an atmosphere and oceans that have nurtured and sustained life on Earth. The theory itself was formally described in the 1960s, and there have been rapid advances in our understanding of the Earth system to include the dynamic interactions between the planet’s surface and the Nickel-Iron core. Australian scientists and students are leading much of this research and there are many opportunities for future generations of students to leave their mark on a very young and evolving inter-disciplinary theory. In particular, growing use of supercomputer simulations have allowed us to better understand the Earth’s interior and describe the motion of tectonic plates as the surface manifestation of convective flow in the Earth’s mantle – a layer of rock nearly 3,000 km thick beneath the surface that behaves like a fluid over geological time. We are only now beginning to piece together the puzzle that links the different layers in Earth’s hot interior to the driving mechanisms of vigorous convection in the outer core that gives rise to the magnetic field, shielding life on our planet from the damaging solar, and drives mantle circulation and plate tectonics.

The core of our planet exceeds temperature of 6 000°C, which is hotter than the surface of the sun. As the surface of the planet is only an average of 16°C, the huge temperature difference drives a powerful yet complex convective system and heat exchange that churns solid rock and makes it behave like putty, resulting in the motion of continents and the volcanic activity we observe at plate boundaries. This volcanic activity was a primary force in removing gas and water from the Earth’s interior to produce an atmosphere and hydrosphere – so far the only planet capable of sustaining life. As a result, most scientists will agree that plate tectonics is a major contributor and precursor to life – and if evidence of past plate tectonic activity is found on Mars, then there is a very real chance that Mars also once supported biological systems. Early indications show that Mars was once very much like the Earth, having resided in the Goldilocks Zone in the solar system – an orbit around that sun that would allow for water to exist in all three phases of gas, solid, and most importantly, in a liquid state.

This ELECTROBOARD session will describe the recent developments in our understanding of the plate-mantle system on Earth, and how geoscientists are incorporating technologies from medical science (CAT scans) to astronomy (satellite gravimetry) in order to uncover the secrets of our planet’s past. Geoscience in Australia is at the frontier of addressing the two biggest problems facing the survival of the human species – that is, energy scarcity and climate change. In many ways these issues go hand in hand, and the use of alternative energy sources instead of fossil fuels has the potential to address the energy needs of a growing human population and mitigate at least some of the severe effects of human-induced climate change. Geoscience helps us find the optimal locations for wind and solar power stations, while also helping pinpoint potential sources of geothermal power.

Students will be introduced to concepts in plate tectonics and geosciences, and how we use open-source and free software technology, GPlates, developed by Australian scientists to reconstruct the past 600 million year evolution of our continents. GPlates is a free, easy-to-use application that comes with detailed documentation and free sample data that can be installed on any Linux, Windows or Mac computer and used for class activities that can help students understand the geological evolution of our planet, changing sea levels and climate and the evolution and explosion of life in the last 542 million years.

ELECTROBOARD Sessions:

Students – 2-3pm, Wednesday 4 September 2012

Teachers – 3:30-4pm, Wednesday 4 September 2012

For more information and free teaching material, contact Sabin on sabin.zahirovic@sydney.edu.au. To download GPlates, visit www.gplates.org and visit www.earthbyte.org for our research updates.

Geology, Geophysics, GPlates

Why some large earthquakes do not genereate tsunamis

A few days ago (11 April 2012) many of us were alerted to a magnitude 8.6 earthquake in the Indian Ocean south of Sumatra. However, even with such a significant force, the earthquake did not produce a tsunami. The USGS Earthquake website is a fantastic resource, and detailed technical earthquake information is available only minutes after the event. In this case, the technical page related to the earthquake showed that the earthquake was largely a strike-slip motion – where the blocks on either side of the fault move past each other horizontally, rather than displacing the water column vertically as would occur in a reverse or normal fault (see Wikipedia for more info).

If you click on the “Technical” tab on the USGS earthquake site, then you will be provided with a table and a seismic focal mechanism (moment tensor), more commonly know as a “beachball”. The moment tensor here is a classic example of strike-slip motion that would generally not produce a tsunami. The motion is either along a fault oriented N-NE, or S-NW. However, we know that the tectonic fabric in the Indian Ocean is largely oriented N-NE, highlighted by the gravity anomalies and fracture zone geometries.

Moment tensor for Sumatran earthquake
Moment tensor for Sumatran earthquake (USGS)

Another interesting feature of this earthquake and its aftershocks is that they are generally distributed within the Indo-Australian plate. This region is undergoing transtensional deformation as India’s motion continues generally north while Australia’s plate velocities are slightly north-east, causing this part of the plate to buckle even with the immense strength of oceanic lithosphere. Many suggest, including the model of Peter Bird, that this region of diffuse deformation delineates a separate tectonic plate called the Capricorn Plate. The analysis of plate deformation and strain rates by Kreemer et al. (2003) also clearly outlines this region as being under significant strain.

Gravity anomalies and fracture zones (left) highlight the north-south trends in the seafloor fabric, and strain rates (right) highlight the diffuse deformation within the Indo-Australian plate.

You can download and use the gravity anomaly and strain rate grids in GPlates. They are simple JPG files that you import as a raster into GPlates.

Gravity Anomalies
Strain Rate

If you use these files. make sure you attribute the original source of the data:

Fracture Zones – MATTHEWS, K. J., MÜLLER, R. D., WESSEL, P. & WHITTAKER, J. M. 2011. The tectonic fabric of the ocean basins. Journal of Geophysical Research, 116, B12109.

Gravity Anomalies – SANDWELL, D. & SMITH, W. 1997. Marine gravity anomaly from Geosat and ERS 1 satellite altimetry. Journal of Geophysical Research, 102, 10-10.

Strain Rate – KREEMER, C., HOLT, W. & HAINES, A. 2003. An integrated global model of present-day plate motions and plate boundary deformation. Geophysical Journal International, 154, 8-34.

Sabin Zahirovic

14 April 2012

GPlates

Introductory post… India plate motion in GPlates

The idea to start up a blog has been floating around for a while now, and I have finally committed to posting an entry. The first entry is an animation (and snapshots) of plate reconstructions in GPlates (v 1.2) depicting the evolution of the Indo-Australian plates in the context of Gondwana breakup from Cretaceous times.

The animation begins at 200 Ma and is based on a recently-published model by Seton et al. (2012) that you can read about here, and you can download the model for use in GPlates from the EarthByte resources page. The plate reconstructions are global and can be interactive manipulated in GPlates, and  can be exported as a series of snapshots (JPG, PNG, BMP) or as other files (Scalable Vector Graphics, ESRI Shapefiles, GMT xy/OGR formats, etc.). The reconstructions show plate boundaries which are dynamic – resulting from polygon topologies resolved at each timestep dynamically from the intersection of individual plate boundaries, a process that is described by Gurnis et al. (2012). Present-day coastlines and topography are reconstructed to give a reference and largely because paleobathymetry/paleotopography models are very uncertain. Plate velocities are also plotted, showing India’s northward advance was very fast compared to the velocities of surrounding plates. Recent research (i.e. van Hinsbern et al. 2012) has suggested that the acceleration of India northward resulted from the combined northward slab pull from Tethyan subduction, but also the northward “plume push” forces derived from the arrival of the Reunion Plume head to the base of Indian/African lithosphere.

The animation itself is more precisely based on the preferred scenario from my first published paper in G-Cubed (Zahirovic et al. 2012) that tests alternative India-Eurasia convergence scenarios using geodynamic models (implemented using GPlates and CitcomS). This preferred scenario has a large back-arc along southern Eurasia, much like the present-day west Pacific, with India first colliding with the associated island arc at ~60 Ma, followed by continent-continent collision and suturing at ~40 Ma.

I am publishing this stuff in a blog largely because I have been meaning to start uploading educational material and other things I find interesting in (geo-) science news for a long time now. It’s also a great opportunity to showcase some of the stuff we do, and the cool software/data we work with.

Sabin Zahirovic

13 April 2012