/usr/share/doc/stilts/sun256/animate.html is in stilts-doc 3.1.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="sun-style.css">
<title>Animation</title>
</head>
<body>
<hr>
<a href="PlotType.html">Next</a> <a href="plot2-layer-params.html">Previous</a> <a href="TypedPlot2Task.html">Up</a> <a href="index.html">Contents</a> <br> <b>Next: </b><a href="PlotType.html">Surface Types</a><br>
<b>Up: </b><a href="TypedPlot2Task.html">Plot Parameters</a><br>
<b>Previous: </b><a href="plot2-layer-params.html">Layer Parameters</a><br>
<hr>
<h4><a name="animate">8.1.3 Animation</a></h4>
<p>The plotting commands can be used to produce animations.
This is done by supplying an <em>animation control table</em>
using the <code>animate</code> parameter
(which has associated <code>afmt</code> and <code>acmd</code> parameters
for specifying its file format and applying filters).
One output image is produced for each row of the control table.
The columns of the table have names which correspond to plot command
parameters, and for each row, the basic plot command is executed
with the parameters on the command line supplied or replaced by
those from the table.
This is most commonly used for providing a movie of the kind of
navigation you can do interactively with the mouse,
but other applications are possible.
</p>
<p>For instance, given the following animation control table
with the name "bounds.txt", in ASCII format:
<pre>
# xmax ymax
4.0 2.0
3.0 1.5
2.0 1.0
1.0 0.5
</pre>
then this command:
<pre>
stilts plot2plane xmin=0 ymin=0
layer_1=mark in_1=gums_smc.fits x_1=ag y_1=av
animate=bounds.txt afmt=ascii
</pre>
would produce a 4-frame animation zooming in towards the origin.
</p>
<p>If output is to the screen
(<code>omode=<a href="paintmode-swing.html">swing</a></code>)
the animation can be seen directly.
If it is to an output file
(<code>omode=<a href="paintmode-out.html">out</a></code>)
then a number of output files is written with sequence numbers,
so adding the parameter "<code>out=x.png</code>" to the above command
would produce 4 files,
<code>x-1.png</code>,
<code>x-2.png</code>,
<code>x-3.png</code> and
<code>x-4.png</code>.
Padding zeros are used to keep the files in alphanumeric sequence,
so for instance in a 500-frame animation the first one would be named
<code>x-001.png</code>.
STILTS does not actually turn these files into a single animated output file,
but you can use other tools to do this, for instance using ImageMagick:
<pre>
convert x-*.png xmovie.gif
</pre>
will produce an animated gif from the input frames.
</p>
<p>You can create the animation control table any way you like,
but you may find the <code><a href="tloop.html">tloop</a></code>
command convenient. For instance the above table can be
written like this:
<pre>
stilts tloop xmax 4 0 -1 ocmd='addcol ymax xmax*0.5' ofmt=ascii
</pre>
You can pipe the output of tloop (or any other command)
as the animation table on the unix command line by specifying
<code>animate=-</code> (the "<code>-</code>" character stands for
standard input). Note however that in this case you
must explicitly give the file format (using the <code>afmt</code> parameter)
and it must be a format which STILTS is capable of streaming
(VOTable is suitable; ASCII is not).
</p>
<p>A common requirement is to produce an animation of rotating a 3-d plot.
Here's an example of how to do it from a unix shell:
<pre>
stilts tloop phi 15 375 2 ofmt=votable \
| stilts plot2sphere layer_1=mark in_1=hip_main.fits lon_1=radeg lat_1=dedeg r_1=plx \
animate=- afmt=votable
</pre>
The <code>phi</code> parameter controls the angle from which the
3D plot is viewed, and here it is incremented by 2 degrees
for each frame.
The same thing would work for <code>plot2cube</code>
as well as <code>plot2sphere</code>.
</p>
<p>Note that producing animations in this way is usually much more
efficient than writing a shell script which invokes STILTS multiple times.
The plot commands also employ multi-threading when animating to
output files, so should make efficient use of multi-core machines
(though currently animations to the screen are not multi-threaded).
</p>
<hr><a href="PlotType.html">Next</a> <a href="plot2-layer-params.html">Previous</a> <a href="TypedPlot2Task.html">Up</a> <a href="index.html">Contents</a> <br> <b>Next: </b><a href="PlotType.html">Surface Types</a><br>
<b>Up: </b><a href="TypedPlot2Task.html">Plot Parameters</a><br>
<b>Previous: </b><a href="plot2-layer-params.html">Layer Parameters</a><br>
<hr><i>STILTS - Starlink Tables Infrastructure Library Tool Set<br>Starlink User Note256<br>STILTS web page:
<a href="http://www.starlink.ac.uk/stilts/">http://www.starlink.ac.uk/stilts/</a><br>Author email:
<a href="mailto:m.b.taylor@bristol.ac.uk">m.b.taylor@bristol.ac.uk</a><br>Mailing list:
<a href="mailto:topcat-user@jiscmail.ac.uk">topcat-user@jiscmail.ac.uk</a><br></i></body>
</html>
|