Research Projects
Classes GEOS 293/393 Hawaii Field Course GEOS 436/636 Beyond the Mouse GEOS 602 Geophysical Fields GEOS 620 Geodynamics GEOS 655 Tectonic Geodesy GEOS 692 Geophys. Seminar
Current & Past Students
Student Opportunities
Curriculum Vitae
Recent Publications
Info for Surveyors
Personal Info

Climb higher, beyond the mouse...

Beyond the Mouse LAB 10: GMT 2

November 14, 16

Instructor: Jeff Freymueller

x7286 Elvey 413B jfreymueller@alaska.edu

TA: Shanshan Li

Last Updated: November 7, 2017

Due: Tuesday Nov 22 before class

Reclaim your data! We follow up on GMT and introduce you to some of the tools that are beyond just mapping / plotting your data. GMT comes with a plethora of tools for data processing and analysis. This example focuses on one of those, for making a contour map.

Pre-lab reading

Read Smith and Wessel (1990) on the procedure for fitting splines in tension. Original link is http://cosmos.hwr.arizona.edu/Technical/Smith-Wessel-1990.pdf.

Exercise 1

Here are script and data from the lecture: 10_gmt2_example.tar.gz, 10_gmt2_example.zip. Play with the example. Try some different filtering options, and other plotting options. Turn in one script and plot and explain what you changed relative to the default script.

Exercise 2

Now we will make a contour map. The map will contour uplift rates from a model of Glacial Isostatic Adjustment (GIA). Making a contour map is a fairly common thing, and this data set serves as a good example. There are three main steps to making a contour map, and this exercise will walk you through the steps:

  1. Organize the data into regular blocks (blockmean or blockmedian).
  2. Fit a gridded surface to the data (surface).
  3. Plot a basemap and draw contours (pscontour).

First, download the file Hu2013.uplift.txt,. This is your date file. It has four columns: longitude, latitude, uplift rate (mm per year), and a weight value. The 4th value is used as a weight for the data in the averaging process. Because these are all model computations, the weights are the same for all data.

The first step is to run blockmean or blockmedian (you can choose, and maybe try both) to organize the data into a more uniform grid. The data file contains the model values at a regular grid of points plus the model values at irregularly sampled GPS site locations. This step makes the data more uniform, which helps in the surface fitting. In addition to the filename, you will need to specify some switches on the command:

Redirect the output to a file. You will use this as the input for the next step. You can also use a pipe.

Now run surface to make a grid file with the gridded fit to the data. You will need to give it the file name and several switches on the command line.

Finally, make your map, You will call pscoast to make a basemap, and then use grdcontour to draw the contours. Here you have a lot of freedom. The lines of code below are one way to draw them (you will need to change the input .grd file name and the output file name to match your script). The first line plots all contours for zero and positive values using red lines (-L selects which range of contours to draw). It plots a contour line every 1 mm/yr (-C1), and every other contour line is a major contour that is thicker and labeled (-Gd2i). The -W switches define the line thickness and color for the minor (-Wc) and major (-Wa) contours. The second and third lines draw contours from -1 to -2 and less than -2, respectively. I used three calls instead of two so that the zero contour would end up being drawn only once.

gmt grdcontour ${base}.grd -S -R -J -L0/40 -Gd2i -C1 -A2s12 -Wc3,255/0/0 -Wa6,255/0/0 -V -O -K -P >> $PS_OUT
gmt grdcontour ${base}.grd -S -R -J -L-2/-1 -Gd2i -C1 -A2s12 -Wc3,0/0/255 -Wa3,0/0/255 -V -K -O -P >> $PS_OUT
gmt grdcontour ${base}.grd -S -R -J -L-40/-2 -Gd2i -C1 -A2s12 -Wc3,0/0/255 -Wa6,0/0/255 -V -O -P >> $PS_OUT

Once you have a working script, play around with some of the values and see how the contour map changes. Make a second version of the contour map in which you add symbols to show where the data values come from (use psxy to draw those symbols). Now assess your map. Are there areas where the contours seem unreasonable, or where countours are drawn that are not really constrained by the data? Turn in versions of the countour map with and without the data loctions plotted.

For extra credit, you can make another map that compares the input data and the gridded version of the data set. You can use the program grdtrack to compute values from the grid file that you have already created. After you have those values, you could either make a figure that compares the input and gridded data values plotted as vectors (using psvelo), or take the difference between the input and gridded values and plot a histogram of these with pshistogram. Doing either of these will require using awk to do some reformatting of files, or for the mathematical manipulations.

Dr. Jeffrey T. Freymueller
Professor of Geophysics
Geophysical Institute
University of Alaska, Fairbanks
Fairbanks, AK 99775-7320

jfreymueller -at- alaska.edu
Phone 907-474-7286
Fax 907-474-7290
Office 413B Elvey