Sunsort spectra

Saving spectra

Probably the most important thing you can do after analysing data is to save your spectra for later perusal. This is a fairly simple operation.

Saving spectra with the GUI

All the controls for this operation are on Sunsort's main window.

This is very simple. Enter the name of the directory you want to save the spectra to in the Save to field. Then, select the menu button marked Save from the choice listed, select whether you want to save all spectra and variables (if in doubt pick this one), just the variables (not useful if you're trying to save the spectra), just the windows (useful if you've just spent ages drawing windows) or just a selected group of spectra.

In all except the last case, Sunsort will proceed to save what you have requested. If the directory already exists, Sunsort will warn you and give you the option of continuing the save (which may overwrite spectra already in the directory) or aborting the operation (so you can, presumably, choose another directory name).

If you have told Sunsort that you want to save a selected group of spectra, then a window will appear with a list of all the spectra in it. You can then select the ones you want and tell Sunsort to Perform the save.

By default, Sunsort saves spectra in SDB format. You may wish to use XY format if you're going to read the spectra with a stand alone program which doesn't understand SDB format. EG format is a Eurogam compatible format which you may use if you wish. Both SDB and EG formats are compact. XY format is very verbose and will make output files an order of magnitude bigger than the other two formats.

Saving spectra from the command line or a batch file

You save spectra from the command line (or from a batch file) with the save command. The syntax is:
      save what directory format [overwrite]
    
What is one of all, windows, variables or selected. Format is one of sdb, xy or eg. Overwrite is an optional argument which should be present and set to 1 if the directory already exists and you want to give Sunsort permission to overwrite the contents.

If you ask to save selected spectra, then Sunsort will prompt you for a list. You should then enter a series of lines that start with either 1d or 2d and are followed by a space separated list of spectrum numbers. When you have finished, enter a blank line.

Here are some examples:

      save all cc-59 sdb 1
      save selected bigfiles xy 1
      1d 1 5 6 7 12
      1d 32 54
      2d 17 4
      1d 158 201
      
      save windows co-wins sdb
    

Loading spectra

Having saved your spectra, you will want to load them back later. Again this is very simple.

Loading spectra with the GUI

This is very simple, and uses almost the same procedure as for saving spectra with the GUI.

All the controls for this operation are on Sunsort's main window.

Make sure that the Format setting is the same as when the spectra were saved, then simply enter the directory the spectra are in into the Load from field and select the appropriate load option from the Load menu.

As when saving spectra, if you ask Sunsort to just load selected spectra then a second window will appear with a list of all the files in the directory. Select the ones you want to load. Note that Sunsort can uncompress compressed or gzipped spectra files. Just select the file name with the .Z or .gz extension and Sunsort will work it out.

If instead of the loaded spectra replacing the spectra in memory you want them to be added together (useful if you want to combine data from several runs), then tick the box marked Add in on load.

Loading spectra at the command line or from a batch file

You load spectra from the command line (or from a batch file) with the load command. It has the syntax:
      load what directory format [add]
    
What is one of all, windows, variables or selected. Format is one of sdb, xy or eg. add is an optional argument which should be present and set to 1 if you want Sunsort to add the data into the spectra in memory instead of replacing them.

If you ask to load selected spectra then Sunsort will ask you to supply the filenames to load from. You can enter several filenames on one line separated by spaces. You can enter several lines of filenames. Finish the list with a blank line. For compressed or gzipped files, include the .Z or .gz at the end of the filename.

Tip: If you can't remember the filenames, then type ls directory_name at the command line before typing the load command.

Here's are some examples:

      load all cc-59 sdb
      load selected bigfiles xy
      etotg4_1d_400
      AHIT_2d_1 etotg4_1d_400

      load windows co-wins sdb
    

Viewing and clearing spectra

Viewing and clearing spectra with the GUI

To view spectra with the GUI use Sunsort's spectra window. All the buttons are described on the page describing the window.

Viewing and clearing spectra from the command line

You can display spectra with the display1d, display2d, and overlay1d commands. Each command is followed by a list of the spectrum number(s) to display. Display2d can only be followed by one spectrum number, the others can be followed by up to four.

The command displayaction can be used to set the action to be performed when the command display1d is executed. It defaults to display but mstick and pkfind may also be specified to auto run the matchstick fitting and peak finding routines in the 1d viewer.

The command clear can be used to clear spectra. clear all will clear all spectra except windows. clear 1d will clear all 1d spectra. clear 2d will clear all 2d spectra except windows. Both clear 1d and clear 2d can be followed by a list of spectrum numbers, in which case they will restrict their activities to just those spectra. If clear 2d is followed by a spectrum list that includes windows, then those windows will be cleared.


Steven M. Singer
Last modified: Wed Sep 29 19:07:35 BST 1999