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
|
<!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.15 Gridding, contouring, and masking of unconstrained areas</TITLE>
<META NAME="description" CONTENT="6.15 Gridding, contouring, and masking of unconstrained areas">
<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="node89.html">
<LINK REL="previous" HREF="node87.html">
<LINK REL="up" HREF="node73.html">
<LINK REL="next" HREF="node89.html">
</HEAD>
<BODY bgcolor="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html2262"
HREF="node89.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A>
<A NAME="tex2html2256"
HREF="node73.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A>
<A NAME="tex2html2250"
HREF="node87.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A>
<A NAME="tex2html2258"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A>
<A NAME="tex2html2260"
HREF="node149.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html2263"
HREF="node89.html">6.16 Gridding of data,</A>
<B> Up:</B> <A NAME="tex2html2257"
HREF="node73.html">6. Cook-book</A>
<B> Previous:</B> <A NAME="tex2html2251"
HREF="node87.html">6.14 Gridding of data</A>
  <B> <A NAME="tex2html2259"
HREF="node1.html">Contents</A></B>
  <B> <A NAME="tex2html2261"
HREF="node149.html">Index</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<H1><A NAME="SECTION0014150000000000000000"></A>
<A NAME="11439"></A>
<BR>
6.15 Gridding, contouring, and masking of unconstrained areas
</H1>
<P>
This example (Figure <A HREF="node88.html#fig:GMT_example_15">6.15</A>) demonstrates
some off the different ways one
can use to grid data in <A NAME="tex2html431"
HREF="http://www.soest.hawaii.edu/gmt"><B>GMT</B></A>, and how to deal with unconstrained
areas. We first convert a large ASCII file to binary with
<A NAME="tex2html432"
HREF="../gmtconvert.html"><I><B>gmtconvert</B></I></A><A NAME="11459"></A> since the binary file will read and process
much faster. Our lower left plot illustrates the results of
gridding using a nearest neighbor technique (<A NAME="tex2html433"
HREF="../nearneighbor.html"><I><B>nearneighbor</B></I></A><A NAME="11468"></A>)
which is a local method: No output is given where there are no data.
Next (lower right), we use a minimum curvature technique
(<A NAME="tex2html434"
HREF="../surface.html"><I><B>surface</B></I></A><A NAME="11477"></A>) which is a global method. Hence, the contours
cover the entire map allthough the data are only available for
portions of the area (indicated by the gray areas plotted using
<A NAME="tex2html435"
HREF="../psmask.html"><I><B>psmask</B></I></A><A NAME="11486"></A>). The top left scenario illustrates how we can
create a clip path (using <A NAME="tex2html436"
HREF="../psmask.html"><I><B>psmask</B></I></A><A NAME="11495"></A>) based on the data coverage
to eliminate contours outside the constrained area.
Finally (top right) we simply employ <A NAME="tex2html437"
HREF="../pscoast.html"><I><B>pscoast</B></I></A><A NAME="11504"></A> to overlay
gray landmasses to cover up the unwanted contours, and end by
plotting a star at the deepest point on the map with <A NAME="tex2html438"
HREF="../psxy.html"><I><B>psxy</B></I></A><A NAME="11513"></A>.
This point was extracted from the gridded files using <A NAME="tex2html439"
HREF="../grdinfo.html"><I><B>grdinfo</B></I></A><A NAME="11522"></A>.
<P>
<P>
<BR>
<P>
<BR CLEAR="ALL">
<HR>
<BR>
<PRE>
gmtconvert ship.xyz -bo >! ship.b
set region = `minmax ship.b -I1 -bi3`
nearneighbor $region -I10m -S40k -Gship.grd ship.b -bi3
set info = `grdinfo -C -M ship.grd`
grdcontour ship.grd -JM3i -P -B2WSne -C250 -A1000 -G2i -K -U"Example 15 in Cookbook" >! example_15.ps
blockmedian $region -I10m ship.b -bi3 -bo >! ship_10m.b
surface $region -I10m ship_10m.b -Gship.grd -bi3
psmask $region -I10m ship.b -JM -O -K -T -G220 -bi3 -X3.6i >> example_15.ps
grdcontour ship.grd -JM -B2WSne -C250 -L-8000/0 -A1000 -G2i -O -K >> example_15.ps
psmask $region -I10m ship_10m.b -bi3 -JM -B2WSne -O -K -X-3.6i -Y3.75i >> example_15.ps
grdcontour ship.grd -JM -C250 -A1000 -L-8000/0 -G2i -O -K >> example_15.ps
psmask -C -O -K >> example_15.ps
grdclip ship.grd -Sa-1/NaN -Gship_clipped.grd
grdcontour ship_clipped.grd -JM -B2WSne -C250 -A1000 -L-8000/0 -G2i -O -K -X3.6i >> example_15.ps
pscoast $region -JM -O -K -G150 -W0.25p >> example_15.ps
echo $info[12] $info[13] | psxy -R -JM -O -K -Sa0.15i -W1p >> example_15.ps
echo "-0.3 3.6 24 0 1 CB Gridding with missing data" | pstext -R0/3/0/4 -Jx1i -O -N >> example_15.ps
\rm -f ship.b ship_10m.b ship.grd ship_clipped.grd
</PRE>
<P>
<BR>
<BR>
<P>
<BR CLEAR="ALL">
<HR>
<P></P>
<DIV ALIGN="CENTER"><A NAME="fig:GMT_example_15"></A><A NAME="11592"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 6.15:</STRONG>
Gridding, contouring, and masking of data</CAPTION>
<TR><TD><IMG
WIDTH="407" HEIGHT="453" BORDER="0"
SRC="img118.gif"
ALT="\begin{figure}\centering\epsfig{figure=eps/GMT_example_15.eps}\end{figure}"></TD></TR>
</TABLE>
</DIV><P></P>
<P>
<A NAME="11563"></A>
<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html2262"
HREF="node89.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A>
<A NAME="tex2html2256"
HREF="node73.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A>
<A NAME="tex2html2250"
HREF="node87.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A>
<A NAME="tex2html2258"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A>
<A NAME="tex2html2260"
HREF="node149.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html2263"
HREF="node89.html">6.16 Gridding of data,</A>
<B> Up:</B> <A NAME="tex2html2257"
HREF="node73.html">6. Cook-book</A>
<B> Previous:</B> <A NAME="tex2html2251"
HREF="node87.html">6.14 Gridding of data</A>
  <B> <A NAME="tex2html2259"
HREF="node1.html">Contents</A></B>
  <B> <A NAME="tex2html2261"
HREF="node149.html">Index</A></B>
<!--End of Navigation Panel-->
<ADDRESS>
Paul Wessel
2001-04-18
</ADDRESS>
</BODY>
</HTML>
|