Making maps with GMT and iGMT
Thorsten Becker
University of Southern California, Los Angeles CA
December 16, 2005
0
The problem
⇒ produce production quality geographic maps ⇒ flexibility → modular and script based ⇒ open-source: $ ↓, transparency ↑, portability ↑, robustness ↑ ⇒ Generic Mapping Tools (GMT) → steep learning curve ⇒ iGMT: GUI & script generator
0
GMT
⇒ written by Paul Wessel and Walter Smith (vs. 3.4.5 and 4.0 as of
12/2005)
⇒ UNIX based, C language, command line tool, GPLed ⇒ ASCII, NetCDF → projection → PS ⇒ data processing, plotting, projections, the kitchen sink ⇒ flexible, powerful, complicated
0
GMT examples on iGMT homepage
0
Running GMT
modified from GMT Cookbook example 7
#!/bin/ksh pscoast -R-50/0/-10/20 -JM9i -K -GP300/26 -Dl -W0.25p -B10 \ -U"Example 7 in Cookbook" > example_07.ps gawk ’{print $1-360.0, $2, $3*0.01}’ quakes.xym | \ psxy -R -JM -O -K -H1 -Sci -G255 -W0.25p \ >> example_07.ps psxy -R -JM -O -K -M isochron.xy -W0.75p >> example_07.ps echo "-12.5 16.5 18 0 6 5 ISC Earthquakes" | \ pstext -R -JM -O >> example_07.ps
0
Some general GMT things
→ cookbook ← ⇒ geographic region: -R0.5/15/-10/10 ⇒ projections: → -JM7 → -JH180/7 ⇒ line-styles: → -W1 → -W2/200/0/0ta ⇒ boundary annotion: → -Ba10f1 → -Ba5f1:"x":/a10f2:"y":WeSn
0
Getting data into GMT
⇒ ASCII
echo lon lat | psxy -Rw/e/s/n -JXxw/yh -Sa0.1 -P > tmp.ps
or
echo lat lon | psxy -: -Rw/e/s/n -JXxw/yw -Sa0.1 -P > tmp.ps
⇒ binary via NetCDF grd files → float precision binary files with some information → several tools for handling GRD files ( grdinfo), grdmath) → tools for import/export: xyz2grd, grd2xyz surface, nearneighbor
0
GMT problems and some solutions
⇒ remembering how -O and -K works
1. 2. 3. 4.
some-GMT-command -K > map.ps some-other-GMT-command -K -O >> map.ps yet-another-GMT-command -K -O >> map.ps some-last-GMT-command -O >> map.ps
⇒ RTFM and the GMT cookbook, or the GMT tutorial ⇒ join the GMT help list ⇒ get a working script from a friend and modify ⇒ iGMT
0
Finding GMT help faster
There is no real FAQ but check this out (from the GMT help list):
Google search of GMT help archive
0
Some GMT caveats
⇒ ∃ bugs (supp. packages, project, oblique Mercator, . . .) ⇒ not necessarily spherical (e.g. surface interpolation) ⇒ hidden parameters in .gmtdefaults file ⇒ wrong scaling (-Jx100) can paralyze your computer ⇒ non-interactive (MATLAB, g3data)
However,
⇒ large community of users, authors responsive ⇒ de-facto standard (besides low-level and black box extremists)
0
iGMT
⇒ written by Thorsten Becker and Alexander Braun (v. 1.2β) ⇒ UNIX and TclTk based, graphical user interface ⇒ handle many geoscience data sets ⇒ produce GMT scripts, teach GMT
0
Obtaining iGMT
www.seismology.harvard.edu/∼becker/igmt
0
Installing iGMT
0
Running iGMT
Solaris, HP-UX, DEC OSF, IBM AIX, IRIX, LINUX, and Mac OS X
0
Registered iGMT users
235 institutions as of 2004
0
iGMT on geosys.usc.edu
⇒ GMT is installed on all geosys and Lebowski nodes ⇒ iGMT has recently been installed as well ⇒ all geophysical data plotted by iGMT is available on the network ⇒ please contribute and use!
0
Demonstrations (or: what’s gonna go wrong today?)
⇒ GMT manuals, documentation ⇒ iGMT web site ⇒ iGMT program usage
0