Sophie

Sophie

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

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.4 Flying over topography</TITLE>
<META NAME="description" CONTENT="8.4 Flying over topography">
<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="previous" HREF="node155.html">
<LINK REL="up" HREF="node152.html">
<LINK REL="next" HREF="node157.html">
</HEAD>

<BODY  bgcolor="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html4840"
  HREF="node157.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html4834"
  HREF="node152.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html4830"
  HREF="node155.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html4836"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html4838"
  HREF="node256.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html4841"
  HREF="node157.html">9. Mailing lists, updates,</A>
<B> Up:</B> <A NAME="tex2html4835"
  HREF="node152.html">8. Creating GMT Animations</A>
<B> Previous:</B> <A NAME="tex2html4831"
  HREF="node155.html">8.3 Orbiting a static</A>
 &nbsp; <B>  <A NAME="tex2html4837"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html4839"
  HREF="node256.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->

<H1><A NAME="SECTION001640000000000000000"></A>
<A NAME="27680"></A>
<BR>
8.4 Flying over topography
</H1>

<P>
Our next animation simulates what an imaginary satellite might see as it passes
in a great circle from New York to Miami at an altitude of 160 km.
We use the general perspective view projection with <A NAME="tex2html1521"
  HREF="../man/grdimage.html"><I><B>grdimage</B></I></A><A NAME="27748"></A> and
use <A NAME="tex2html1522"
  HREF="../man/project.html"><I><B>project</B></I></A><A NAME="27753"></A> to create a great circle path between the two cities,
sampled every 5 km.  The main part of the script will make the DVD-quality frames from
different view points, draw the path on the ground, and add frame numbers to
each frame.  As this animation generates 355 frames we can use 3rd party tools
to turn the image sequence into a MPEG-4 movie<A NAME="tex2html1519"
  HREF="footnode.html#foot27683"><SUP>8.2</SUP></A>. Note: At the moment, <A NAME="tex2html1523"
  HREF="../man/grdview.html"><I><B>grdview</B></I></A><A NAME="27758"></A> cannot
use general perspective view projection to allow ``fly-through'' animations like
Fledermaus; we expect to add this functionality in a future version.

<P>
<BR CLEAR="ALL">
<HR>
<BR>
<PRE>#!/bin/sh
#               GMT ANIMATION 04
#
# Purpose:      Make DVD-res Quicktime movie of NY to Miami flight
# GMT progs:    gmtset, gmtmath, psbasemap, pstext, psxy, ps2raster
# Unix progs:   awk, mkdir, rm, mv, echo, qt_export, cat
#
# 1. Initialization
# 1a) Assign movie parameters
. gmt_shell_functions.sh
REGION=-Rg
altitude=160.0
tilt=55
azimuth=210
twist=0
Width=36.0
Height=34.0
px=7.2
py=4.8
dpi=100
name=`basename $0 '.sh'`

# Set up flight path
project -C-73.8333/40.75 -E-80.133/25.75 -G5 -Q &gt; $$.path.d
frame=0
mkdir -p frames
grdgradient USEast_Coast.nc -A90 -Nt1 -G$$_int.nc
makecpt -Cglobe -Z &gt; $$.cpt
while read lon lat dist; do
        file=`gmt_set_framename $name $frame`
        ID=`echo $frame | awk '{printf "%4.4d\n", $1}'`
        grdimage -JG${lon}/${lat}/${altitude}/${azimuth}/${tilt}/${twist}/${Width}/${Height}/7i+ \
                $REGION -P -Y0.1i -X0.1i USEast_Coast.nc -I$$_int.nc -C$$.cpt \
                --PAPER_MEDIA=Custom_${px}ix${py}i -K &gt; $$.ps
        psxy -R -J -O -K -W1p $$.path.d &gt;&gt; $$.ps
        echo 0 4.6 14 0 1 TL $ID | pstext -R0/$px/0/$py -Jx1i -O &gt;&gt; $$.ps
        if [ $# -eq 0 ]; then
                mv $$.ps $name.ps
                gmt_cleanup .gmt
                gmt_abort "$0: First frame plotted to $name.ps"
        fi
        ps2raster $$.ps -Tt -E$dpi
        mv $$.tif frames/$file.tif
        echo "Frame $file completed"
        frame=`gmt_set_framenext $frame`
done &lt; $$.path.d
if [ $# -eq 1 ]; then
        echo "anim_04.sh: Made $frame frames at 480x720 pixels placed in subdirectory frames"
#       qt_export $$/anim_0_123456.tiff --video=h263,24,100, ${name}_movie.m4v
fi
# 4. Clean up temporary files
gmtset DOTS_PR_INCH 300
gmt_cleanup .gmt
</PRE>
<BR CLEAR="ALL">
<HR>
<P>

<DIV ALIGN="CENTER"><A NAME="fig:GMT_animation_04"></A><A NAME="27764"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 8.4:</STRONG>
Flying over topography.</CAPTION>
<TR><TD>
<DIV ALIGN="CENTER"><IMG
 WIDTH="403" HEIGHT="265" ALIGN="BOTTOM" BORDER="0"
 SRC="img212.png"
 ALT="\includegraphics[scale=0.5]{scripts/anim_04}"></DIV></TD></TR>
</TABLE>
</DIV>

<P>
<A NAME="27688"></A>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html4840"
  HREF="node157.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html4834"
  HREF="node152.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html4830"
  HREF="node155.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html4836"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html4838"
  HREF="node256.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html4841"
  HREF="node157.html">9. Mailing lists, updates,</A>
<B> Up:</B> <A NAME="tex2html4835"
  HREF="node152.html">8. Creating GMT Animations</A>
<B> Previous:</B> <A NAME="tex2html4831"
  HREF="node155.html">8.3 Orbiting a static</A>
 &nbsp; <B>  <A NAME="tex2html4837"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html4839"
  HREF="node256.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>
Paul Wessel
2010-07-14
</ADDRESS>
</BODY>
</HTML>