没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐

The Generic Mapping Tools
Version 4.4.0
A Map-making Tutorial
by
P
˚
al (Paul) Wessel
School of Ocean and Earth Science and Technology
University of Hawai’i at M
¯
anoa
and
Walter H. F. Smith
Laboratory for Satellite Altimetry
NOAA/NESDIS
Feb 2009
Generic Mapping Tools Graphics

Contents
Front page i
Contents ii
INTRODUCTION 1
GMT overview: History, philosophy, and usage . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Historical highlights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Philosophy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Why is GMT so popular? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
GMT installation considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1 SESSION ONE 2
1.1 Tutorial setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 The GMT environment: What happens when you run GMT? . . . . . . . . . . . . . . . . 2
1.2.1 Input data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.2 Job Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.3 Output data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 The UNIX Environment: Entry Level Knowledge . . . . . . . . . . . . . . . . . . . . . . 4
1.3.1 Redirection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3.2 Piping (|) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3.3 Standard error (stderr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3.4 File name expansion or “wild cards” . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Laboratory Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4.1 Linear projection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4.2 Logarithmic projection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4.3 Mercator projection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4.4 Albers projection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4.5 Orthographic projection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4.6 Eckert IV and VI projection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2 SESSION TWO 8
2.1 General Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1.1 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.1.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.1.3 More exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2 Plotting text strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3 SESSION THREE 14
3.1 Contouring gridded data sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14
3.1.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2 Gridding of arbitrarily spaced data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2.1 Nearest neighbor gridding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2.2 Gridding with Splines in Tension . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2.3 Preprocessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
ii

4 SESSION FOUR 18
4.1 Cpt files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.1.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.2 Illumination and intensities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.3 Color images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.3.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.4 Multi-dimensional maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.4.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.5 Perspective views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.5.1 Mesh-plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.5.2 Color-coded view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5 References 23
Index 24
iii

1
INTRODUCTION
The purpose of this tutorial is to introduce new users to GMT, outline the GMT environment, and enable
you to make several forms of graphics without having to know too much about UNIX and UNIX tools. We
will not be able to cover all aspects of GMT nor will we necessarily cover the selected topics in sufficient
detail. Nevertheless, it is hoped that the exposure will prompt the users to improve their GMT and UNIX
skills after completion of this short tutorial.
GMT overview: History, philosophy, and usage
Historical highlights
The GMT system was initiated in late 1987 at Lamont-Doherty Earth Observatory, Columbia University
by graduate students Paul Wessel and Walter H. F. Smith. Version 1 was officially introduced to Lamont
scientists in July 1988. GMT 1 migrated by word of mouth (and tape) to other institutions in the United
States, UK, Japan, and France and attracted a small following. Paul took a Post-doctoral position at SOEST
in December 1989 and continued the GMT development. Version 2.0 was released with an article in EOS,
October 1991, and quickly spread worldwide. We obtained NSF-funding for GMT version 3.0 in 1993
which was released with another article in EOS on August 15, 1995. Significantly improved versions (3.1-
3.3, 3.3.1–6), 3.4, 3.4.1–5, and 4.0–3.1 were released between November 1998 and May 2008, culminating
in the Feb 2009 introduction of 4.4.0. GMT now is used by ∼15,000 users worldwide in a broad range of
disciplines.
Philosophy
GMT follows the UNIX philosophy in which complex tasks are broken down into smaller and more man-
ageable components. Individual GMT modules are small, easy to maintain, and can be used as any other
UNIX tool. GMT is written in the ANSI C programming language (very portable), is POSIX compliant,
and is independent of hardware constraints (e.g., memory). GMT was deliberately written for command-
line usage, not a windows environment, in order to maximize flexibility. We standardized early on to use
PostScript output instead of other graphics formats. Apart from the built-in support for coastlines, GMT
completely decouples data retrieval from the main GMT programs. GMT uses architecture-independent
file formats.
Why is GMT so popular?
The price is right! Also, GMT offers unlimited flexibility since it can be called from the command line,
inside scripts, and from user programs. GMT has attracted many users because of its high quality PostScript
output. GMT easily installs on almost any computer.
GMT installation considerations
GMT has been installed on machines ranging from super-computers to lap-top PCs. GMT only contains
some 100,000 lines of code and has modest space/memory requirements. Minimum requirements are
• The netCDF library 3.4 or higher (free from www.unidata.edu).
• A C Compiler (free from www.gnu.org).
• About 100 Mb disk space (70 Mb additional for full- and high-resolution coast-lines).
• About 32 Mb memory.
In addition, we recommend access to a PostScript printer or equivalent (e.g., ghostscript ), PostScript
previewer (e.g., ghostview), any flavor of the UNIX operating system, and more disk space and memory.

2
1. SESSION ONE
1.1 Tutorial setup
1. We assume that GMT has been properly and fully installed and that the GMT executables are in your
executable path described in the GMT README file.
2. All GMT man pages, documentation, and example scripts are available from the GMT documentation
web page. It is assumed these pages have been installed locally at your site; if not they are always
available from the main GMT home page
1
.
3. We recommend you create a sub-directory called tutorial, cd into that directory, and copy all the tutorial
files directly there with “cp -r $GMTHOME/tutorial/
*
. ”.
4. As we discuss GMT principles it may be a good idea to consult the GMT Technical Reference and
Cookbook for more detailed explanations.
5. The tutorial uses the supplemental GMT program grdraster to extract subsets of global gridded data
sets. For your convenience we also supply the subsets in the event you do not wish to install grdraster
and the public data sets it can read. Thus, run the grdraster commands if you have made the installa-
tion or ignore them if you have not.
6. For all but the simplest GMT jobs it is recommended that you place all the GMT (and UNIX) commands
in a shell script file and make it executable. To ensure that UNIX recognizes your script as a shell script
it is a good habit always to start the script with the line #!/bin/sh or #!/bin/csh, depending on the shell
you prefer to use. All the examples in this tutorial assumes you are running the bourne shell, sh ; if you
are using something different then you are on your own.
7. Making a script executable is accomplished using the chmod command, e.g., the script figure 1.sh is
made executable with “chmod +x figure 1.sh”.
8. To view a PostScript file (e.g., map.ps) on a UNIX workstation we use ghostview map.ps. On some
systems there will be similar commands, like imagetool and pageview on Sun workstations. In this text
we will refer to ghostview; please substitute the relevant PostScript previewer on your system.
9. Please cd into the directory tutorial. We are now ready to start.
1.2 The GMT environment: What happens when you run GMT?
To get a good grasp on GMT one must understand what is going on “under the hood”. Figure 1.1 illustrates
the relationships you need to be aware of at run-time.
1.2.1 Input data
A GMT program may or may not take input files. Three different types of input are recognized (more
details can be found in Appendix B in the Technical Reference):
1. Data tables. These are “spreadsheet” tables with a fixed number of columns and unlimited number of
rows. We distinguish between two groups:
• ASCII (Preferred unless files are huge)
– Single segment [Default]
– Multi-segment with internal header records (–M)
1
http://gmt.soest.hawaii.edu
剩余27页未读,继续阅读





zhpliu
- 粉丝: 0
- 资源: 7

上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助

会员权益专享
最新资源
- main.cpp
- 基于matlab驾驶员疲劳检测系统设计(matlab源码+GUI界面+perclos计数+论文目录指导)
- 建筑施工安全管理及其评价研究_张立明.caj
- 不错的毕业设计、课程设计、练手c++语言项目:情人节的红玫瑰.rar
- 不错的毕业设计、课程设计、练手c++语言项目:青蛙过河小游戏.rar
- 不错的毕业设计、课程设计、练手c++语言项目:拼图游戏.rar
- 不错的毕业设计、课程设计、练手c++语言项目:链表HuffmanTree.rar
- scratch编程作品代码科克里森林 滚屏RPG
- 不错的毕业设计、课程设计、练手c++语言项目:力学相关的流体.rar
- 不错的毕业设计、课程设计、练手c++语言项目:军旗游戏.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制

评论0