next up previous
Next: Repetitive Operations
Up: Writing Your Own Command Files
Previous: Writing Your Own Command Files

The Basics

 Here's a simple example of a command file. I want SPECX to read observation number 137, das-merge it, smooth the data over a 5 point average, and plot it. First, here are the commands that one would give in SPECX:

$\gt\!\gt$ r-g-d 137
$\gt\!\gt$ das-merge\\n\
$\gt\!\gt$ sm-sp 5
$\gt\!\gt$ n

These lines would be faithfully reproduced in a command procedure. You would type, say:

$ pico in a separate xterm window and you will be in the pico editor. The latter is simple because there are rather few commands and the basic ones are always displayed at the bottom of the editing window. If you have an aversion to the complexity of emacs this may be the one to use. Now just type the same one line entries as you would inside SPECX. When you are done type Control-o and you will be prompted for the file name you want to write out (a.spx, say, remembering that all SPECX command files are of filetype .spx) Now the file a.spx has been created. To use it, I get back into SPECX either by clicking back on your SPECX window.

Then, back inside SPECX type

@a

The @ tells SPECX to start running a command file. Notice you do not use the suffix .spx in the command.

This was a very silly command file so let's write one that is a little more useful.



next up previous
Next: Repetitive Operations
Up: Writing Your Own Command Files
Previous: Writing Your Own Command Files

Specx Cookbook Reduction of millimetre wave data
Starlink Cookbook 8
Henry Matthews, Tim Jenness
1st March 1997
E-mail:ussc@star.rl.ac.uk

Copyright © 2005 Council for the Central Laboratory of the Research Councils