next up previous contents index
Next: 3.1.1 Exercises Up: 3. SESSION THREE Previous: 3. SESSION THREE   Contents   Index

3.1 Contouring gridded data sets

GMT comes with several utilities that can create gridded data sets; we will discuss two such programs later this session. First, we will assume that we already have gridded data sets. In the supplemental GMT archive there is a program that serves as a data extractor from several public domain global gridded data sets. Among these data are ETOPO5, crustal ages, gravity and geoid, and DEM for the continental US. Here, we will use grdraster to extract a GMT-ready grid that we will next use for contouring:

grdraster 1 -R-66/-60/30/35 -Gbermuda.grd -V

We first use the GMT program grdinfo to see what's in this file:

 
grdinfo bermuda.grd

The file contains bathymetry for the Bermuda region and has depth values from -5475 to -89 meters. We want to make a contour map of this data; this is a job for grdcontour. As with previous plot commands we need to set up the map projection with -J. Here, however, we do not have to specify the region since that is by default assumed to be the extent of the grid file. To generate any plot we will in addition need to supply information about which contours to draw. Unfortunately, grdcontour is a complicated program with too many options. We put a positive spin on this situation by touting its flexibility. Here are the most useful options:


Table 3.1: The most useful options in grdcontour.
Option Purpose
-Aannot_int Annotation interval
-Ccont_int Contour interval
-Ggap Sets distance between contour annotations
-Llow/high Only draw contours within the low to high range
-Nunit Append unit to contour annotations
-Qcut Do not draw contours with fewer than cut points
-Ssmooth Resample contours every x_inc/smooth increment
-T[+$\vert$-][gap/length][:LH] Draw tick-marks in downhill direction for innermost closed contours
Add tick spacing and length, and characters to plot at the center of closed contours.
-W[a$\vert$c]pen Set contour and annotation pens
-Zfactor[/offset] [Subtract offset] and multiply data by factor prior to processing


We will first make a plain contour map using 1 km as annotation interval and 250 m as contour interval. We choose a 7-inch-wide Mercator plot and annotate the borders every 2$^{o}$:

 
grdcontour bermuda.grd -JM7i -C250 -A1000 -P -B2 | ghostview -



Subsections
next up previous contents index
Next: 3.1.1 Exercises Up: 3. SESSION THREE Previous: 3. SESSION THREE   Contents   Index
Paul Wessel 2006-05-31