The plotting commands can be used to produce animations.
This is done by supplying an animation control table
(which has associated
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.
For instance, given the following animation control table with the name "bounds.txt", in ASCII format:
# xmax ymax 4.0 2.0 3.0 1.5 2.0 1.0 1.0 0.5then this command:
stilts plot2plane xmin=0 ymin=0 layer_1=mark in_1=gums_smc.fits x_1=ag y_1=av animate=bounds.txt afmt=asciiwould produce a 4-frame animation zooming in towards the origin.
If output is to the screen
the animation can be seen directly.
If it is to an output file
then a number of output files is written with sequence numbers,
so adding the parameter "
out=x.png" to the above command
would produce 4 files,
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
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:
convert x-*.png xmovie.gifwill produce an animated gif from the input frames.
You can create the animation control table any way you like,
but you may find the
command convenient. For instance the above table can be
written like this:
stilts tloop xmax 4 0 -1 ocmd='addcol ymax xmax*0.5' ofmt=asciiYou can pipe the output of tloop (or any other command) as the animation table on the unix command line by specifying
-" character stands for standard input). Note however that in this case you must explicitly give the file format (using the
afmtparameter) and it must be a format which STILTS is capable of streaming (VOTable is suitable; ASCII is not).
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:
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=votableThe
phiparameter 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
plot2cubeas well as
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).