File: node91.html

package info (click to toggle)
gmt-doc 3.4-1.1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,756 kB
  • ctags: 1,800
  • sloc: makefile: 30
file content (216 lines) | stat: -rw-r--r-- 7,323 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<!--Converted with LaTeX2HTML 99.2beta8 (1.46)
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>6.18 Volumes and Spatial Selections</TITLE>
<META NAME="description" CONTENT="6.18 Volumes and Spatial Selections">
<META NAME="keywords" CONTENT="GMT_Docs">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="LaTeX2HTML v99.2beta8">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="GMT_Docs.css">

<LINK REL="next" HREF="node92.html">
<LINK REL="previous" HREF="node90.html">
<LINK REL="up" HREF="node73.html">
<LINK REL="next" HREF="node92.html">
</HEAD>

<BODY  bgcolor="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html2304"
  HREF="node92.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A> 
<A NAME="tex2html2298"
  HREF="node73.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A> 
<A NAME="tex2html2292"
  HREF="node90.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A> 
<A NAME="tex2html2300"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A> 
<A NAME="tex2html2302"
  HREF="node149.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.gif"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html2305"
  HREF="node92.html">6.19 Color patterns on</A>
<B> Up:</B> <A NAME="tex2html2299"
  HREF="node73.html">6. Cook-book</A>
<B> Previous:</B> <A NAME="tex2html2293"
  HREF="node90.html">6.17 Images clipped by</A>
 &nbsp <B>  <A NAME="tex2html2301"
  HREF="node1.html">Contents</A></B> 
 &nbsp <B>  <A NAME="tex2html2303"
  HREF="node149.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->

<H1><A NAME="SECTION0014180000000000000000"></A>
<A NAME="11898"></A>
<BR>
6.18 Volumes and Spatial Selections
</H1>

<P>
To demonstrate potential usage of the new programs
<A NAME="tex2html465"
  HREF="../grdvolume.html"><I><B>grdvolume</B></I></A><A NAME="11913"></A> and <A NAME="tex2html466"
  HREF="../gmtselect.html"><I><B>gmtselect</B></I></A><A NAME="11922"></A> we extract a subset
of the Sandwell &amp; Smith altimetric gravity field<A NAME="tex2html463"

HREF="footnode.html#foot11901"><SUP>6.3</SUP></A>
for the northern Pacific and decide to isolate all seamounts that
(1) exceed 50 mGal in amplitude and (2) are within 200 km
of the Pratt seamount.  We do this by dumping the 50 mGal
contours to disk, then making a simple <I>$AWK</I><A NAME="11930"></A> script
<U>center.awk</U> that returns the mean location of the points
making up each closed polygon, and then pass these locations
to <A NAME="tex2html467"
  HREF="../gmtselect.html"><I><B>gmtselect</B></I></A><A NAME="11937"></A> which retains only the points within 200
km of Pratt.  We then mask out all the data outside this
radius and use <A NAME="tex2html468"
  HREF="../grdvolume.html"><I><B>grdvolume</B></I></A><A NAME="11946"></A> to determine the combined
area and volumes of the chosen seamounts.

<P>

<P>

<BR>

<P>
<BR CLEAR="ALL">
<HR>
<BR>
<PRE>
gmtset ELLIPSOID Sphere
echo "-142.65    56.25" &gt;! pratt.d
makecpt -Crainbow -T-60/60/10 -Z &gt;! grav.cpt
grdgradient AK_gulf_grav.grd -Nt1 -A45 -GAK_gulf_grav_i.grd
grdimage AK_gulf_grav.grd -IAK_gulf_grav_i.grd -JM5.5i -Cgrav.cpt -B2f1 -P -K -X1.5i -Y5.85i &gt;! example_18.ps
pscoast -R-149/-135/52.5/58 -JM -O -K -Di -G160 -W0.25p &gt;&gt; example_18.ps
psscale -D2.75i/-0.4i/4i/0.15ih -Cgrav.cpt -B20f10/:mGal: -O -K &gt;&gt; example_18.ps
$AWK '{print $1, $2, 12, 0, 1, "LB", "Pratt"}' pratt.d | pstext -R -JM -O -K -D0.1i/0.1i \
   &gt;&gt; example_18.ps
$AWK '{print $1, $2, 0, 200, 200}' pratt.d | psxy -R -JM -O -K -SE -W0.25p &gt;&gt; example_18.ps
grdcontour AK_gulf_grav.grd -JM -C20 -B2f1WSEn -O -K -Y-4.85i -U/-1.25i/-0.75i/"Example 18 in Cookbook" \
   &gt;&gt; example_18.ps
grdcontour AK_gulf_grav.grd -JM -C10 -L49/51 -O -K -Dsm -Wc0.75p/0/255/0 &gt;&gt; example_18.ps
pscoast -R -JM -O -K -Di -G160 -W0.25p &gt;&gt; example_18.ps
$AWK '{print $1, $2, 0, 200, 200}' pratt.d | psxy -R -JM -O -K -SE -W0.25p &gt;&gt; example_18.ps
\rm -f sm_*[0-9].xyz    # Only consider closed contours
cat &lt;&lt; EOF &gt;! center.awk
BEGIN {
    x = 0
    y = 0
    n = 0
}
{
    x += \$1
    y += \$2
    n++
}
END {
    print x/n, y/n
}
EOF
\rm -f centers.d
foreach file (sm_*.xyz)
    $AWK -f center.awk $file &gt;&gt;! centers.d
end
gmtselect -R -JM -C200/pratt.d centers.d &gt;! $$
psxy $$ -R -JM -O -K -SC0.04i -G255/0/0 -W0.25p &gt;&gt; example_18.ps
psxy -R -JM -O -K -ST0.1i -G255/255/0 -W0.25p pratt.d &gt;&gt; example_18.ps
grdmath -R -I2m -F -142.65 56.25 GDIST = mask.grd
grdclip mask.grd -Sa200/NaN -Sb200/1 -Gmask.grd
grdmath AK_gulf_grav.grd mask.grd MUL = tmp.grd
set info = `grdvolume tmp.grd -C50 -Sk`
psxy -R -JM -A -O -K -L -W0.75p -G255 &lt;&lt; EOF &gt;&gt; example_18.ps
-148.5 52.75
-140.5    52.75
-140.5    53.75
-148.5    53.75
EOF
pstext -R -JM -O &lt;&lt; EOF &gt;&gt; example_18.ps
-148 53.08 14 0 1 LM Areas: $info[2] km@+2@+
-148 53.42 14 0 1 LM Volumes: $info[3] mGal\264km@+2@+
EOF
\rm -f $$ grav.cpt sm_*.xyz *_i.grd tmp.grd mask.grd pratt.d center* .gmt*
</PRE>

<P>
<BR>

<BR>

<P>
<BR CLEAR="ALL">
<HR>
<P>
Our illustration is presented in Figure&nbsp;<A HREF="node91.html#fig:GMT_example_18">6.18</A>.

<P>

<P></P>
<DIV ALIGN="CENTER"><A NAME="fig:GMT_example_18"></A><A NAME="12001"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 6.18:</STRONG>
Volumes and geo-spatial selections</CAPTION>
<TR><TD><IMG
 WIDTH="365" HEIGHT="531" BORDER="0"
 SRC="img124.gif"
 ALT="\begin{figure}\centering\epsfig{figure=eps/GMT_example_18.eps}\end{figure}"></TD></TR>
</TABLE>
</DIV><P></P>

<P>
<A NAME="11990"></A>

<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html2304"
  HREF="node92.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A> 
<A NAME="tex2html2298"
  HREF="node73.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A> 
<A NAME="tex2html2292"
  HREF="node90.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A> 
<A NAME="tex2html2300"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A> 
<A NAME="tex2html2302"
  HREF="node149.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.gif"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html2305"
  HREF="node92.html">6.19 Color patterns on</A>
<B> Up:</B> <A NAME="tex2html2299"
  HREF="node73.html">6. Cook-book</A>
<B> Previous:</B> <A NAME="tex2html2293"
  HREF="node90.html">6.17 Images clipped by</A>
 &nbsp <B>  <A NAME="tex2html2301"
  HREF="node1.html">Contents</A></B> 
 &nbsp <B>  <A NAME="tex2html2303"
  HREF="node149.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>
Paul Wessel
2001-04-18
</ADDRESS>
</BODY>
</HTML>