For example, if I want to average spectra 1 through 5, I would have to do the following. Read in spectrum 1, read in spectrum 2, average them, read spectrum 3, average again, read spectrum 4, average, read 5 and average one more time.
Thus to average five spectra (131, 132, 133, 134 and 135, say) you would type:
r-g-d 131
r-g-d 132; ave
r-g-d 133; ave
r-g-d 134; ave
r-g-d 135; ave
Generally, if you have learned to put all the necessary commands on
one line you can repeat the sequence of using the `up-arrow' key and
editing the line. If you have to do it very often, it would probably
be smart to write a command file (see Section
) or an
in-line do-loop (see Section
) to do it for
you. Such a do-loop might go like this:
>> r-g-d 131 >> do i 132 133 Enter commands to do, line at a time, EOF to finish insert >> r-g-d i insert >> ave insert >>This would then average your spectra. Certainly less typing if you have a lot of spectra in sequence(s) to average. Note that having done the do-loop once creates a file called temp.spx which does the same thing as the do-loop we just made. So if you had two more groups of spectra (say, 138-143 and 145-150) to average with the preceding average, just type
@temp 138 143
@temp 145 150
to complete the set of spectra to be averaged.
Specx Cookbook Reduction of millimetre wave data