next up previous contents index
Next: Buffer operations Up: Loading and saving of Previous: I/O with multiple spectra

ls-file-mechanism

    In order to perform an operation on a group of spectra that you want to load, write their names in a so called ls-file. You can generate an ls-file from within TV, for example for the spectra from the last section, with the command:

tv > % ``ls prge[012345].* > spc-file''

That is where it got its name from. The syntax for the ls-file command is:

tv > s ls < operation > < option >

All operations listed in table 4.1 on page [*] are possible:


 
Table 4.1: Allowed operations for the ls-file command.
add Add several spectra to a specified buffer.
commandget Load spectra and execute command file for each spectrum loaded.
get Load several spectra.
subtract Subtract several spectra from a specified buffer.
 

Note that, if there is a position calibration for all spectra involved in the ls-file operation, it will be applied before the operations add and subtract. If you want the uncalibrated spectra to be added or subtracted you have to unload the calibration for at least one spectrum.

To access the spectra listed in the ls-file, all operations mentioned above have the options listed in table 4.2 on page [*].


 
Table 4.2: Options to the ls-file operations to define which files will be operated.
ls-file Open an ls-file.
+ Take the next spectrum in the list.
++ Take all following spectra up to the end of file.
- Take the previous spectrum in the list.
-- Take all previous spectra.
line-index Take spectrum at line-index.
 

To use the ls-file in TV it must be opened first with:

tv > spectrum ls-file open spc-file

To list the contents of an ls-file you can use:

tv > spectrum ls-file list [ < filename > ] [+ | ++ | - | -- | < index > ]

The pointer is set to the next file if a file is listed. If another ls-file is open than the one given by < filename > , the old one will be closed and the new one opened, but if no ls-file is opened, an error occurs. The list command without arguments shows the index of the next file.

To set the pointer in the ls-file to position < number > enter:

tv > spectrum ls-file position < number >

In order to load all spectra from the current file position to the end of the ls-file, use the command:

tv > spectrum ls-file get ++

You may close the ls-file with:

tv > spectrum ls-file close

As an example we load the spectra from the last section. Imagine that no ls-file is opened,so we have to open the file spc-file first with the command:

tv > spectrum ls-file open spc-file

Now you can load the spectra with the command:

tv > spectrum ls-file get ++

Of course not more spectra can be loaded then buffers are available.

For the syntax of all ls-file commands see section 6.8.10 on page [*]. A list of hotkeys for ls-file operations is shown in table 4.3 on page [*].


 
Table 4.3: Hotkeys for ls-file operations.
Key TV-commands Function
l+ tv > spectrum delete all; Deletes all spectra and reads
  tv > spectrum ls-file get ++; according to the ls-file rules (see section 6.8.10)
l- tv > spectrum delete all; Deletes all spectra and reads
  tv > spectrum ls-file get -; according to the ls-file rules (see section 6.8.10)
lg tv > edit; Asks for spectra to be loaded
  tv > spectrum ls-file get; and reads according to the ls-file rules (see section 6.8.10)
lo tv > edit; Queries an ls-file name
  tv > spectrum ls-file open; and opens it
 



next up previous contents index
Next: Buffer operations Up: Loading and saving of Previous: I/O with multiple spectra
Andreas Fitzler
7/13/2000