next up previous
Next: Temporary Storage
Up: Saving Reduced Data for later
Previous: Saving Reduced Data for later

Using Data Files

 As you can see, the stack is not a good place to keep a spectrum after you have spent time removing baselines and smoothing it. It can easily get lost in the shuffle of the stack. The safe place to keep a polished spectrum is in its own special file which you can close and re-open later when you have time.

A single file can contain any number of spectra. First you have to open a file with the open-file command. Then SPECX will ask you what you want to call the file, and a couple of other questions.

Lets say I have just removed a baseline from my spectrum and now I want to save it for later. For now I only want the one spectrum in the file, but I can put more in the file later; the file is in principle infinitely expandable. The name of the file will be stanley (under Unix the file will be called stanley.sdf; the filetype .sdf is the default). Here is the command dialog:

 >> open-file
 File name? stanley
 Data file stanley does not exist.
 Create a new file? (Y/N) [N] y
 File title? My_data
 File owner? TMW
 >>

The answers to the questions about file title and owner are not crucial. They will only appear if you make a listing of the file contents. However, do not allow spaces, dashes, or semicolons to appear in either field, or, for that matter, in the filename; otherwise the results will not be what you wanted.

Now a file stanley.sdf will appear in my directory. To get the data into the file you use write-spectrum. This puts the spectrum in the stack X register into the file. So I do the following command;

 >> write-spectrum 
 File number? (EOF to list) 1
 Filed as scan   1 of stanley
 >>

When first created the file access is set to write-only. When opened on subsequent occasions the default file access is read-only. If you want to change this use the set-file-access command:

>> set-file-access
File number? (EOF to list) 1
File access ? (R/W/RW) rw

To close a file use close-file. You can have up to eight files open at any one time. If you want to see which files are open, and what their access rights are, do;

>> list-open-files
1  s140_a2_ave                               RW  -1
2  hhhs                                      RW  -1
3  stanley                                   R   -1

To retrieve a spectrum from a file you use the command read-spectrum. The file you want to read has to be open and have read access: e.g.

>> rea-sp
File number? (EOF to list) [1] 
Scan? 2
>>



next up previous
Next: Temporary Storage
Up: Saving Reduced Data for later
Previous: Saving Reduced Data for later

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