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
|
<!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.14 Gridding of data and trend surfaces</TITLE>
<META NAME="description" CONTENT="6.14 Gridding of data and trend surfaces">
<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="node88.html">
<LINK REL="previous" HREF="node86.html">
<LINK REL="up" HREF="node73.html">
<LINK REL="next" HREF="node88.html">
</HEAD>
<BODY bgcolor="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html2248"
HREF="node88.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A>
<A NAME="tex2html2242"
HREF="node73.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A>
<A NAME="tex2html2236"
HREF="node86.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A>
<A NAME="tex2html2244"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A>
<A NAME="tex2html2246"
HREF="node149.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html2249"
HREF="node88.html">6.15 Gridding, contouring, and</A>
<B> Up:</B> <A NAME="tex2html2243"
HREF="node73.html">6. Cook-book</A>
<B> Previous:</B> <A NAME="tex2html2237"
HREF="node86.html">6.13 Plotting of vector</A>
  <B> <A NAME="tex2html2245"
HREF="node1.html">Contents</A></B>
  <B> <A NAME="tex2html2247"
HREF="node149.html">Index</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<H1><A NAME="SECTION0014140000000000000000"></A>
<A NAME="11280"></A>
<BR>
6.14 Gridding of data and trend surfaces
</H1>
<P>
This example shows how one goes from randomly spaced data
points to an evenly sampled surface. First we plot the
distribution and values of our raw data set (table 5.11
from example 12). We choose an equidistant grid and run
<A NAME="tex2html420"
HREF="../blockmean.html"><I><B>blockmean</B></I></A><A NAME="11311"></A> which preprocesses the data to avoid aliasing.
The dashed lines indicate the logical blocks used by
<A NAME="tex2html421"
HREF="../blockmean.html"><I><B>blockmean</B></I></A><A NAME="11320"></A>; all points inside a given bin will be averaged.
The logical blocks are drawn from a temporary file we make on
the fly within the shell script. The processed data is then
gridded with the <A NAME="tex2html422"
HREF="../surface.html"><I><B>surface</B></I></A><A NAME="11329"></A> program and contoured every 25
units. A most important point here is that <A NAME="tex2html423"
HREF="../blockmean.html"><I><B>blockmean</B></I></A><A NAME="11338"></A>,
<A NAME="tex2html424"
HREF="../blockmedian.html"><I><B>blockmedian</B></I></A><A NAME="11347"></A>, or <A NAME="tex2html425"
HREF="../blockmode.html"><I><B>blockmode</B></I></A><A NAME="11356"></A> should always be run
prior to running <A NAME="tex2html426"
HREF="../surface.html"><I><B>surface</B></I></A><A NAME="11365"></A>, and both of these steps must use the same
grid interval. We use <A NAME="tex2html427"
HREF="../grdtrend.html"><I><B>grdtrend</B></I></A><A NAME="11374"></A> to fit a bicubic trend
surface to the gridded data, contour it as well, and sample
both gridded files along a diagonal transect using <A NAME="tex2html428"
HREF="../grdtrack.html"><I><B>grdtrack</B></I></A><A NAME="11383"></A>.
The bottom panel compares the gridded (solid line) and bicubic
trend (dashed line) along the transect using <A NAME="tex2html429"
HREF="../psxy.html"><I><B>psxy</B></I></A><A NAME="11392"></A>
(Figure <A HREF="node87.html#fig:GMT_example_14">6.14</A>):
<P>
<P>
<BR>
<P>
<BR CLEAR="ALL">
<HR>
<BR>
<PRE>
gmtset GRID_PEN 0.25pta
psxy table_5.11 -R0/7/0/7 -JX3.06i/3.15i -B2f1WSNe -Sc0.05i -G0 -P -K -Y6.45i >! example_14.ps
$AWK '{printf "%g %s 6 0 0 5 %g\n", $1+0.08, $2, $3}' table_5.11 | pstext -R -JX -O -K -N \
>> example_14.ps
blockmean table_5.11 -R0/7/0/7 -I1 >! mean.xyz
psbasemap -R0.5/7.5/0.5/7.5 -JX -O -K -B0g1 -X3.25i >> example_14.ps
psxy -R0/7/0/7 -JX -B2f1eSNw mean.xyz -Ss0.05i -G0 -O -K >> example_14.ps
$AWK '{printf "%g %s 6 0 0 5 %g\n", $1+0.1, $2, $3}' mean.xyz | pstext -R -JX -O -K -W255o \
-C0.01i/0.01i -N >> example_14.ps
surface mean.xyz -R -I1 -Gdata.grd
grdcontour data.grd -JX -B2f1WSne -C25 -A50 -G3i/10 -S4 -O -K -X-3.25i -Y-3.55i >> example_14.ps
psxy -R -JX mean.xyz -Ss0.05i -G0 -O -K >> example_14.ps
grdtrend data.grd -N10 -Ttrend.grd
grdcontour trend.grd -JX -B2f1wSne -C25 -A50 -G3i/10 -S4 -O -K -X3.25i >> example_14.ps
project -C0/0 -E7/7 -G0.1 -Fxy >! track
psxy -R -JX track -W1pto -O -K >> example_14.ps
grdtrack track -Gdata.grd | cut -f3,4 >! data.d
grdtrack track -Gtrend.grd | cut -f3,4 >! trend.d
psxy `minmax data.d trend.d -I0.5/25` -JX6.3i/1.4i data.d -W1p -O -K -X-3.25i -Y-1.9i -B1/50WSne \
>> example_14.ps
psxy -R -JX trend.d -W0.5pta -O -U"Example 14 in Cookbook" >> example_14.ps
\rm mean.xyz track *.grd *.d .gmt*
</PRE>
<P>
<BR>
<BR>
<P>
<BR CLEAR="ALL">
<HR>
<P></P>
<DIV ALIGN="CENTER"><A NAME="fig:GMT_example_14"></A><A NAME="11451"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 6.14:</STRONG>
Gridding of data and trend surfaces</CAPTION>
<TR><TD><IMG
WIDTH="401" HEIGHT="527" BORDER="0"
SRC="img117.gif"
ALT="\begin{figure}\centering\epsfig{figure=eps/GMT_example_14.eps}\end{figure}"></TD></TR>
</TABLE>
</DIV><P></P>
<P>
<A NAME="11437"></A>
<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html2248"
HREF="node88.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A>
<A NAME="tex2html2242"
HREF="node73.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A>
<A NAME="tex2html2236"
HREF="node86.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A>
<A NAME="tex2html2244"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A>
<A NAME="tex2html2246"
HREF="node149.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html2249"
HREF="node88.html">6.15 Gridding, contouring, and</A>
<B> Up:</B> <A NAME="tex2html2243"
HREF="node73.html">6. Cook-book</A>
<B> Previous:</B> <A NAME="tex2html2237"
HREF="node86.html">6.13 Plotting of vector</A>
  <B> <A NAME="tex2html2245"
HREF="node1.html">Contents</A></B>
  <B> <A NAME="tex2html2247"
HREF="node149.html">Index</A></B>
<!--End of Navigation Panel-->
<ADDRESS>
Paul Wessel
2001-04-18
</ADDRESS>
</BODY>
</HTML>
|