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

Repetitive Operations

  You will recall that when you want to remove a linear baseline from a spectrum or do a similar operation, you had to tell SPECX what region(s) to use from the spectrum. This would hinder automatic operations severely since you would have to sit at the terminal and use the cursor to tell SPECX what regions to use. The way out of this is to always use non-interactive mode:

>> set-interactive
Interactive plotting? (Y/N) [Y] N

Now SPECX can carry out things like remove-linear-baselines without plotting the spectra on the screen, and asking lots of questions first. The advantage is when you want to use the same regions for removing baselines, or a similar operation like find-spectrum-statistics in several spectra. For instance, I want to use the regions from -40 to -20 km/s and from 20 to 40km/s for removing a linear baseline from several spectra, put them into a file called gooddata.sdf and have it repeat the command until I'm done. I would write the following command file, which I'll call rlb.spx:

r-g-d\?\ 
r-l-b\-40 -20\20 40\ 
wr-sp\1\

The ? in the first line will prompt me for a scan number every time I run the command file. I have specified the linear baseline fit regions between the backslashes, which indicate where responses are be expected to anticipated questions from the SPECX command. I put the data in file number 1 with the wr-sp command, which is gooddata.sdf (I'm assuming you had no other open files). To run the command file type

$\gt\!\gt$ @rlb

and SPECX will ask which scan you want to read (because of the ?). Alternatively, you could type, say,

$\gt\!\gt$ @rlb 137

and the file will process scan 137, without any further ado.



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

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