next up previous contents index
Next: 7.2 Image presentations Up: 7. Cook-book Previous: 7. Cook-book   Contents   Index

7.1 The making of contour maps

We want to create two contour maps of the low order geoid using the Hammer equal area projection. Our gridded data file is called osu91a1f_16.grd and contains a global 1$^{o}$ by 1$^{o}$ gridded geoid (we will see how to make gridded files later). We would like to show one map centered on Greenwich and one centered on the dateline. Positive contours should be drawn with a solid pen and negative contours with a dashed pen. Annotations should occur for every 50 m contour level, and both contour maps should show the continents in light gray in the background. Finally, we want a rectangular frame surrounding the two maps. This is how it is done:





#!/bin/csh
#        GMT EXAMPLE 01
#
#        $Id: job01.csh,v 1.9 2004/05/26 03:25:22 pwessel Exp $
#
# Purpose:    Make two contour maps based on the data in the file osu91a1f_16.grd
# GMT progs:    gmtset grdcontour psbasemap pscoast
# Unix progs:    rm
#
gmtset GRID_CROSS_SIZE 0 ANNOT_FONT_SIZE_PRIMARY 10
psbasemap -R0/6.5/0/9 -Jx1i -B0 -P -K -U"Example 1 in Cookbook" >! example_01.ps
pscoast -Rg -JH0/6i -X0.25i -Y0.5i -O -K -Bg30 -Dc -Glightgray >> example_01.ps
grdcontour -R osu91a1f_16.grd -J -C10 -A50+s7 -Gd4i -L-1000/-1 -Wc0.25p,- -Wa0.75p,- -O -K \
   -T0.1i/0.02i >> example_01.ps
grdcontour -R osu91a1f_16.grd -J -C10 -A50+s7 -Gd4i -L-1/1000 -O -K -T0.1i/0.02i >> example_01.ps
pscoast -Rg -JH180/6i -Y4i -O -K -Bg30:."Low Order Geoid": -Dc -Glightgray >> example_01.ps
grdcontour osu91a1f_16.grd -J -C10 -A50+s7 -Gd4i -L-1000/-1 -Wc0.25p,- -Wa0.75p,- -O -K \
   -T0.1i/0.02i:-+ >> example_01.ps
grdcontour osu91a1f_16.grd -J -C10 -A50+s7 -Gd4i -L-1/1000 -O -T0.1i/0.02i:-+ >> example_01.ps
\rm -f .gmtcommands4 .gmtdefaults4





The first command draws a box surrounding the maps. This is followed by two sequences of pscoast, grdcontour, grdcontour. They differ in that the first is centered on Greenwich; the second on the dateline. We use the limit option (-L) in grdcontour to select negative contours only and plot those with a dashed pen, then positive contours only and draw with a solid pen [Default]. The -T option causes tickmarks pointing in the downhill direction to be drawn on the innermost, closed contours. For the upper panel we also added - and + to the local lows and highs. You can find this illustration as Figure 7.1.

Figure 7.1: Contour maps of gridded data.
\includegraphics[]{eps/GMT_example_01}


next up previous contents index
Next: 7.2 Image presentations Up: 7. Cook-book Previous: 7. Cook-book   Contents   Index
Paul Wessel 2006-01-01