next up previous contents index
Next: I/O with multiple spectra Up: Spectra analysis Previous: Configuration of graphic windows

Loading and saving of spectra (I/O)

       

TV supports several functions for spectrum input and output, as there are:

tv > s read < fname['fmt] > {{ < ind > ...} | all | shown | active}  

tv > s get < fname['fmt] ... >  

tv > s write { < fname['fmt] > | < wc > } {{ < ind > ...} | all | shown | active}  

tv > s format {input | output} < fmt >  

< fname > is the name of the spectrum file. < fmt > is the format of the spectrum file (see below). < ind > ... are the buffernumbers for the spectrum. < wc > is a wildcard defined according to section 3.12.2 on page [*]. The commands to the spectrum menu are described now.

read loads the spectrum to the first defined buffer and copies it to the other buffers specified. TV displays the same buffer always in the same color. If you want to see a special spectrum in a certain color you can ensure this by using the read command.

get reads spectra, too and is the default command to the spectrum menu, meaning it can be omitted to enter it.

The difference between read and get is that read loads one spectrum into one or more buffers you have to specify manually, whereas get loads them to the next free buffers automatically selected byTV.

write saves the spectra to the defined files. It operates on all, only the shown or the active spectra or on spectra defined by the index list.

format sets the format for the input or output of spectra. input is the default value to this command. For a list of allowed formats see appendix C on page [*].

TV performs I/O operations using the mfile library[*]. If you want to read spectra not written in mfile format, it may be necessary to specify the spectrum format explicitely.

For example you want to load the spectrum prge0.0121 to buffers #0 to #3 and display them for comparison in a y-paned window (see section 4.2.1 p. [*]). You create the window with the command

tv > window create ypaned ypwindow 4

and TV prints which spectrum and cut is active in each pane:

yp-window 0: spectrum #0 active

yp-window 0: cut #0 active

yp-window 1: spectrum #1 active

yp-window 1: cut #1 active

yp-window 2: spectrum #2 active

yp-window 2: cut #2 active

yp-window 3: spectrum #3 active

yp-window 3: cut #3 active

yp-window 4: spectrum #4 active

yp-window 4: cut #4 active

If the window exists load the spectrum with the command

tv > spectrum read /home/fitz/spec/0121/prge0.0121 0 1 2 3

and TV prints to which buffer the spectrum is loaded and copies it to the other buffers.

tv> spectrum ./prge0.0121'8k.lc:2 read to #0

tv> spectrum#0 copied to #1

tv> spectrum#0 copied to #2

tv> spectrum#0 copied to #3

This results in the window shown in figure 4.2 on page [*].


  
Figure 4.2: Ypaned window with the a spectrum loaded to all four panes.
\begin{figure}
 \begin{center}
 \leavevmode
 
\epsffile {pictures/ypaned-window.ps}
 \end{center}\end{figure}

As an example for the get command we load the spectrum ge0.0121 after the above operation. TV places it to the next free buffer.

tv > spectrum /home/fitz/spec/0121/prge0.0121

tv> spectrum ./prge0.0121'8k.lc:2 read to #4

This loads the 8k spectrum which is saved in mfile format (see appendix C p. [*]) with linecompress mode 2 to buffer #4.

To force TV to use a certain format, you have to specify it either while loading a spectrum with get or read, or by setting the default format with the format command. Choosing the wrong format

tv > spectrum prge0.0121'16k.lc:2

will result in an error:

fatal: cannot read spectrum prge0.0121'16k.lc:2

vsSpectra: could not set mfile format

fatal: illegal input (spectrum) ''

Here is an example for the format command:

tv > spectrum format input 16k.lc:2

 

The maximum number of buffers is set to 16 by default and may be specified in the command line (see section 3.2 p. [*]) when TV is started.



 
next up previous contents index
Next: I/O with multiple spectra Up: Spectra analysis Previous: Configuration of graphic windows
Andreas Fitzler
7/13/2000