Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > os > by-pkgid > 4b194777eaf705e440bb2ce282d32772 > files > 580

GMT-doc-4.5.3-3.fc14.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>8.2 Examining DEMs using variable illumination</TITLE>
<META NAME="description" CONTENT="8.2 Examining DEMs using variable illumination">
<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="node155.html">
<LINK REL="previous" HREF="node153.html">
<LINK REL="up" HREF="node152.html">
<LINK REL="next" HREF="node155.html">
</HEAD>

<BODY  bgcolor="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html4814"
  HREF="node155.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html4808"
  HREF="node152.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html4802"
  HREF="node153.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html4810"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html4812"
  HREF="node256.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html4815"
  HREF="node155.html">8.3 Orbiting a static</A>
<B> Up:</B> <A NAME="tex2html4809"
  HREF="node152.html">8. Creating GMT Animations</A>
<B> Previous:</B> <A NAME="tex2html4803"
  HREF="node153.html">8.1 Animation of the</A>
 &nbsp; <B>  <A NAME="tex2html4811"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html4813"
  HREF="node256.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->

<H1><A NAME="SECTION001620000000000000000"></A>
<A NAME="27665"></A>
<BR>
8.2 Examining DEMs using variable illumination
</H1>

<P>
Our next animation uses a gridded topography for parts of Colorado (US);
the file is distributed with the tutorial examples.  Here, we want to
use <A NAME="tex2html1516"
  HREF="../man/grdimage.html"><I><B>grdimage</B></I></A><A NAME="27725"></A> to generate a shaded-relief image sequence in
which we sweep the illumination azimuth around the entire horizon.  The
resulting animation illustrates how changing the illumination azimuth
can bring out subtle features (or artifacts) in the gridded data.  The
red arrow points in the direction of the illumination.

<P>
<BR CLEAR="ALL">
<HR>
<BR>
<PRE>#!/bin/sh
#               GMT ANIMATION 02
#
# Purpose:      Make web page with simple animated GIF of a DEM grid
# GMT progs:    gmtset, gmtmath, grdgradient, makecpt, grdimage psxy, ps2raster
# Unix progs:   awk, mkdir, rm, mv, echo, convert, cat
#
# 1. Initialization
# 1a) Assign movie parameters
. gmt_shell_functions.sh
width=3.5i
height=4.15i
dpi=72
n_frames=36
TDIR=../../tutorial
name=`basename $0 '.sh'`
# 1b) setup
del_angle=`gmtmath -Q 360 $n_frames DIV =`
makecpt -Crainbow -T500/4500/500 -Z &gt; $$.cpt
gmtset DOTS_PR_INCH $dpi
R=`gmt_get_gridregion $TDIR/us.nc`
# 2. Main loop
mkdir -p $$
frame=0
while [ $frame -lt $n_frames ]; do
        # Create file name using a name_##.tif format
        file=`gmt_set_framename $name $frame`
        angle=`gmtmath -Q $frame $del_angle MUL =`
        dir=`gmtmath -Q $angle 180 ADD =`
        grdgradient $TDIR/us.nc -A$angle -Nt2 -M -G$$.us_int.nc
        grdimage $TDIR/us.nc -I$$.us_int.nc -JM3i -P -K -C$$.cpt -B1WSne -X0.35i -Y0.3i \
        --PAPER_MEDIA=Custom_${width}x${height} --ANNOT_FONT_SIZE=+9p &gt; $$.ps
        echo 256.25 35.6 | psxy -R$R -J -O -K -Sc0.8i -Gwhite -Wthin &gt;&gt; $$.ps
        echo 256.25 35.6 $dir 0.37 | psxy -R$R -J -O -Sv0.02i/0.05i/0.05i -Gred -Wthin &gt;&gt; $$.ps
        if [ $# -eq 0 ]; then
                mv $$.ps $name.ps
                gmt_cleanup .gmt
                gmt_abort "$0: First frame plotted to $name.ps"
        fi
#       RIP to TIFF at specified dpi
        ps2raster -E$dpi -Tt $$.ps
        mv -f $$.tif $$/$file.tif
        echo "Frame $file completed"
        frame=`gmt_set_framenext $frame`
done
# 3. Create animated GIF file and HTML for web page
convert -delay 10 -loop 0 $$/*.tif $name.gif
cat &lt;&lt; END &gt; $name.html
&lt;HTML&gt;
&lt;TITLE&gt;GMT shading: A tool for feature detection&lt;/TITLE&gt;
&lt;BODY bgcolor="#ffffff"&gt;
&lt;CENTER&gt;
&lt;H1&gt;GMT shading: A tool for feature detection&lt;/H1&gt;
&lt;IMG src="$name.gif"&gt;
&lt;/CENTER&gt;
&lt;HR&gt;
We make illuminated images of topography from a section of Colorado and
vary the azimuth of the illumination (see arrow).  As the light-source sweeps around
the area over 360 degrees we notice that different features in the data
become hightlighted.  This is because the illumination is based on data
gradients and such derivatives will high-light short-wavelength signal.
Again, our animation uses Imagemagick's convert tool to make an animated GIF file
with a 0.1 second pause between the 36 frames.
&lt;HR&gt;
&lt;I&gt;$name.sh: Created by $USER on `date`&lt;/I&gt;
&lt;/BODY&gt;
&lt;/HTML&gt;
END
# 4. Clean up temporary files
gmtset DOTS_PR_INCH 300
gmt_cleanup .gmt
</PRE>
<BR CLEAR="ALL">
<HR>
<P>
As you can see, these sorts of animations are not terribly difficult to
put together, especially since our vantage point is fixed.  In the next
example we will move the ``camera'' around and must therefore deal with
how to frame perspective views.

<P>

<DIV ALIGN="CENTER"><A NAME="fig:GMT_animation_02"></A><A NAME="27731"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 8.2:</STRONG>
Animation of a DEM using variable illumination.</CAPTION>
<TR><TD>
<DIV ALIGN="CENTER"><IMG
 WIDTH="200" HEIGHT="236" ALIGN="BOTTOM" BORDER="0"
 SRC="img210.png"
 ALT="\includegraphics[scale=0.5]{scripts/anim_02}"></DIV></TD></TR>
</TABLE>
</DIV>

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

<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html4814"
  HREF="node155.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html4808"
  HREF="node152.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html4802"
  HREF="node153.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html4810"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html4812"
  HREF="node256.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html4815"
  HREF="node155.html">8.3 Orbiting a static</A>
<B> Up:</B> <A NAME="tex2html4809"
  HREF="node152.html">8. Creating GMT Animations</A>
<B> Previous:</B> <A NAME="tex2html4803"
  HREF="node153.html">8.1 Animation of the</A>
 &nbsp; <B>  <A NAME="tex2html4811"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html4813"
  HREF="node256.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>
Paul Wessel
2010-07-14
</ADDRESS>
</BODY>
</HTML>