Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 5764c67416561ab82b35afcf9c650e17 > files > 559

GMT-doc-4.5.2-1.fc13.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<!--Converted with LaTeX2HTML 2002-2-1 (1.71)
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>7.15 Gridding, contouring, and masking of unconstrained areas</TITLE>
<META NAME="description" CONTENT="7.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 NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

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

<LINK REL="next" HREF="node136.html">
<LINK REL="previous" HREF="node134.html">
<LINK REL="up" HREF="node120.html">
<LINK REL="next" HREF="node136.html">
</HEAD>

<BODY  bgcolor="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html4512"
  HREF="node136.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html4506"
  HREF="node120.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html4500"
  HREF="node134.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html4508"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html4510"
  HREF="node255.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html4513"
  HREF="node136.html">7.16 Gridding of data,</A>
<B> Up:</B> <A NAME="tex2html4507"
  HREF="node120.html">7. Creating GMT Graphics</A>
<B> Previous:</B> <A NAME="tex2html4501"
  HREF="node134.html">7.14 Gridding of data</A>
 &nbsp; <B>  <A NAME="tex2html4509"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html4511"
  HREF="node255.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->

<H1><A NAME="SECTION0015150000000000000000"></A>
<A NAME="sec:example_15"></A><A NAME="23898"></A>
<BR>
7.15 Gridding, contouring, and masking of unconstrained areas
</H1>

<P>
This example (Figure&nbsp;<A HREF="#fig:GMT_example_15">7.15</A>) demonstrates
some off the different ways one
can use to grid data in <A NAME="tex2html1375"
  HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A>, and how to deal with unconstrained
areas.  We first convert a large ASCII file to binary with
<A NAME="tex2html1376"
  HREF="../man/gmtconvert.html"><I><B>gmtconvert</B></I></A><A NAME="24634"></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="tex2html1377"
  HREF="../man/nearneighbor.html"><I><B>nearneighbor</B></I></A><A NAME="24639"></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="tex2html1378"
  HREF="../man/surface.html"><I><B>surface</B></I></A><A NAME="24644"></A>) which is a global method.  Hence, the contours
cover the entire map although the data are only available for
portions of the area (indicated by the gray areas plotted using
<A NAME="tex2html1379"
  HREF="../man/psmask.html"><I><B>psmask</B></I></A><A NAME="24649"></A>).  The top left scenario illustrates how we can
create a clip path (using <A NAME="tex2html1380"
  HREF="../man/psmask.html"><I><B>psmask</B></I></A><A NAME="24654"></A>) based on the data coverage
to eliminate contours outside the constrained area.
Finally (top right) we simply employ <A NAME="tex2html1381"
  HREF="../man/pscoast.html"><I><B>pscoast</B></I></A><A NAME="24659"></A> to overlay
gray land masses to cover up the unwanted contours, and end by
plotting a star at the deepest point on the map with <A NAME="tex2html1382"
  HREF="../man/psxy.html"><I><B>psxy</B></I></A><A NAME="24664"></A>.
This point was extracted from the grid files using <A NAME="tex2html1383"
  HREF="../man/grdinfo.html"><I><B>grdinfo</B></I></A><A NAME="24669"></A>.

<P>
<BR CLEAR="ALL">
<HR>
<BR>
<PRE>#!/bin/sh
#               GMT EXAMPLE 15
#
# Purpose:      Gridding and clipping when data are missing
# GMT progs:    blockmedian, gmtconvert, grdclip, grdcontour, grdinfo, minmax
# GMT progs:    nearneighbor, pscoast, psmask, pstext, surface
# Unix progs:   awk, echo, rm
#
ps=example_15.ps
gmtconvert ship.xyz -bo &gt; ship.b
#
region=`minmax ship.b -I1 -bi3`
nearneighbor $region -I10m -S40k -Gship.grd ship.b -bi3
info=`grdinfo -C -M ship.grd`
grdcontour ship.grd -JM3i -P -B2WSne -C250 -A1000 -G2i -K -U"Example 15 in Cookbook" &gt; $ps
#
blockmedian $region -I10m ship.b -bi3 -bo &gt; ship_10m.b
surface $region -I10m ship_10m.b -Gship.grd -bi3
psmask $region -I10m ship.b -J -O -K -T -Glightgray -bi3 -X3.6i &gt;&gt; $ps
grdcontour ship.grd -J -B2WSne -C250 -L-8000/0 -A1000 -G2i -O -K &gt;&gt; $ps
#
psmask $region -I10m ship_10m.b -bi3 -J -B2WSne -O -K -X-3.6i -Y3.75i &gt;&gt; $ps
grdcontour ship.grd -J -C250 -A1000 -L-8000/0 -G2i -O -K &gt;&gt; $ps
psmask -C -O -K &gt;&gt; $ps
#
grdclip ship.grd -Sa-1/NaN -Gship_clipped.grd
grdcontour ship_clipped.grd -J -B2WSne -C250 -A1000 -L-8000/0 -G2i -O -K -X3.6i &gt;&gt; $ps
pscoast $region -J -O -K -Ggray -Wthinnest &gt;&gt; $ps
echo $info | awk '{print $12,$13}' | psxy -R -J -O -K -Sa0.15i -Wthick &gt;&gt; $ps
echo "-0.3 3.6 24 0 1 CB Gridding with missing data" | pstext -R0/3/0/4 -Jx1i -O -N &gt;&gt; $ps
rm -f ship.b ship_10m.b ship.grd ship_clipped.grd .gmt*
</PRE>
<BR CLEAR="ALL">
<HR>
<DIV ALIGN="CENTER"><A NAME="fig:GMT_example_15"></A><A NAME="24675"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 7.15:</STRONG>
Gridding, contouring, and masking of data.</CAPTION>
<TR><TD>
<DIV ALIGN="CENTER"><IMG
 WIDTH="491" HEIGHT="545" ALIGN="BOTTOM" BORDER="0"
 SRC="img174.png"
 ALT="\includegraphics[scale=0.6]{scripts/example_15}"></DIV></TD></TR>
</TABLE>
</DIV>

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

<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html4512"
  HREF="node136.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html4506"
  HREF="node120.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html4500"
  HREF="node134.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html4508"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html4510"
  HREF="node255.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html4513"
  HREF="node136.html">7.16 Gridding of data,</A>
<B> Up:</B> <A NAME="tex2html4507"
  HREF="node120.html">7. Creating GMT Graphics</A>
<B> Previous:</B> <A NAME="tex2html4501"
  HREF="node134.html">7.14 Gridding of data</A>
 &nbsp; <B>  <A NAME="tex2html4509"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html4511"
  HREF="node255.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>
Paul Wessel
2010-01-14
</ADDRESS>
</BODY>
</HTML>