Professional Documents
Culture Documents
GMT SUCOGG Lecture5 Dietmar
GMT SUCOGG Lecture5 Dietmar
GMT SUCOGG Lecture5 Dietmar
–W[fill][o|O|c|C[pen]] Paint text box; draw outline by appending o (also see –C)
1
pstext text line input and setup
x y size angle font justify text
x y is map coordinates
size is font size in points
angle is inclination of text baseline w.r.t. horizontal
font is font name or number (see –L)
justify relates (x, y) to a point on the text string
text
2
Exercise 12
3
Exercise 12 cont ...
x y size angle font justify text
Code Effect
@;r/g/b; Change font color, @;; resets it
@:size: Change font size, @:: resets it
@_ Turn underline on or off
6
Afternoon Exercise 1a
7
Afternoon Exercise 1b
8
Afternoon Exercise 1 cont ...
9
Shell programming
ksh serves several purposes
Accepts commands, checks syntax, expands file
names, redirects i/o.
Allows for customization of environment
Offers job control (&, CTRL-Z, bg, fg)
Provides script programming
The combination of GMT, UNIX tools, and
ksh allow for wide flexibility in attacking
problems
10
ksh variables
To assign variables, use
var=value
var must begin with a letter, may contain
numbers and underscores, but not $, &.
e.g., size2_big=14
e.g., inputfile=quakes.d
14
Examples of awk commands
To print only records which contain
“Australia” in the third column:
awk ‘{if ($3 == “Australia”) print $1,
$2, $3, $4}’ $infile > $outfile
15
Smithsonian Volcano Catalog
We will be using data from the Smithsonian
Volcano Catalog (http://
www.volcano.si.edu/gvp/world/
summinfo.cfm)
16
Map Exercise 13
Plotting the GVP data
We will write a script that
1. Makes a global Hammer projection map
with blue oceans and light brown
continents
2. Plots volcanoes as red triangles
17
1. Plotting the background
Basic pscoast job, no further instructions
needed!
18
Reformatting the data
Lucky for you, we have already formatted
the volcano dataset -
volcanoes_processed.dat
19
Pacific Seamount Catalog
You have a file in your tutorial directory called:
Pacific_ages.d
20
Afternoon Exercise 2
Make Mercator map of Hawaii-Emperor area
Extract records for Hawaii-Emperor only
[seamounts_pac.d]
Plot dated seamounts/islands using color-coded
triangles [psxy –C]
Color-code triangles based on age [makecpt]
Plot volcanoes using a different symbol [psxy]
Plot the number of samples in the title [wc]
Place your color table beneath the map [psscale]
21
22
Map exercise 11
23
Map exercise 11 cont ...
24
Example: Seismicity map
We want to plot the epicenters of
earthquakes over a background Mercator
coastline map. We will use data from the
tutorial directory we just copied over (data
set quakes.ngdc and color table
quakes.cpt). In particular, our map should
have circles whose:
size scale with earthquake magnitude
color reflect hypocenter depth.
25
quakes.ngdc
Historical tsunamigenic earthquakes from NGDC
Plain ASCII data table with 3 header records:
26
Converting quakes.ngdc
27
Assigning quake colors
Typical seismicity color scheme is:
Red for shallow quakes (0-100 km)
Green for middle depths (100-300 km)
Blue for deep quakes (> 300 km)
28
Map exercise 12
Task: Write a script that plots historical seismicity on
top of a Mercator geographic map as specified
above. Pick contrasting colors for your map. Add a
map scale (–L).
29
Map exercise 12 cont ....
30
31
Advanced exercise
32