#!/bin/bash
#		GMT EXAMPLE 09
#
#		$Id: job09.bash,v 1.1.1.1 2000/12/28 01:23:45 gmt Exp $
#
# Purpose:	Make wiggle plot along track from geoid deflections
# GMT progs:	pswiggle, pstext, psxy
# Unix progs:	$AWK, ls, paste, tail, rm
#
pswiggle track_*.xys -R185/250/-68/-42 -U"Example 9 in Cookbook" -K -Jm0.13i -Ba10f5 -G0 -Z2000 -W0.25p -S240/-67/500/@~m@~rad > example_09.ps
psxy -R -Jm -O -K ridge.xy -W1.75p >> example_09.ps
psxy -R -Jm -O -K -M fz.xy -W0.5pta >> example_09.ps
if [ -e tmp ]; then
	\rm -f tmp
fi
for file in track_*.xys	# Make label file
do
	tail -1 $file >> tmp
done
ls track_*.xys | $AWK -F. '{print $2}' > tracks.lis
paste tmp tracks.lis | $AWK '{print $1, $2, 10, 50, 1, 7, $4}' | pstext -R -Jm -D-0.05i/-0.05i -O >> example_09.ps
\rm -f tmp tracks.lis .gmtcommands
