next up previous contents index
Next: 6. Using the image Up: html Previous: 4. spec   Contents   Index


5. Data analysis with spectra

Spectra is a beamline control and data analysis program written by Thorsten Kracht from Hamburger Synchrotronstrahlungslabor at Deutsches Elektronensynchrotron. It is widely used at Institute for Scattering Methods for data analysis because it uses the fio standart for data files defined at Hamburger Synchrotronstrahlungslabor. Therefore, to keep the compatibility with data taken at Hamburger Synchrotronstrahlungslabor it was decided to implement Spectra as the standart data analysis program at the 6ID-D Side Station.

Spectra is installed on all unix mashines belonging to the sidestation. It is not recommended to use it directly on the beamline computer. For use together with data created at the 6ID-D Side Station there are the idduser accounts at For use together with data created at the 6ID-B Main Station there are the useraccounts user at idbuser at

Spectra is only running when a X-connection is available for graphics output. To start spectra enter the command spectra in any terminal window.

5.1 Getting spectra to run properly

Figure 5.1: Example for a typical spectra picture of a data set. Here scan align04_856.fio is shown, a 2$ \vartheta$ scan of a Si powder sample measured at 100 keV. The detector signal is shown in the lower left corner, the monitor signal and the ring current in the upper left corner and the sample temperature and for example a fluorescence measurement on the right. In addition information about the scan in general, the peak in the detector window and averages of the other for data sets displayed are shown.

When Spectra is invoked it automatically reads the file spectra_ini.gra from the actual directory. If this file is not present it tries to read the spectra_ini.gra file from the home directory of the user. In all of the above mentioned accounts a spectra_ini.gra file is present in the home directory. Normally no changes to the spectra_ini.gra file are necessary.

spectra_ini.gra calls a file named set_names.gra which has to be present in the directory from which Spectra was started. In this file it is defined which information of the scans is plotted and what the filenames to look for are.

To get spectra running this file has to be adopted to your setup of spec. The first block in this file contains definitions which enables the macro to access the data files created during the beamtime.

= [[ $ \sim$ .data]] Gives the directory where the fio files are copied from the beamline computer. Please use exactly this notation, $ \sim$ marks the home directory of the user so in this example it links to /home/idduser/data/ if idduser is the username. Relative links are not permitted.
filename = "align04_"
A filename is assigned. Thus files named align04_xxx.fio will be analysed where xxx is replaced by scan_number which is only initialised in set_names.gra and can hold any integer number.
get_zone = ""
If a fio file is not present in the directory given by store_zone Spectra tries to copy it from the directory given in get_zone. Here the format is user@computer:directory/, the usual format for the scp command.
In addition five more symbols have to be defined:
detector = det
monitor = mon
current = cur
countera = coa
temperature = DegK_sample
This way the user can chose wich information is displayed in which window. The symbols have to have the exact names given in this example, than the name of a column out of the spec data sets is assigned, for example det. If the symbol is not defined nothing will be displayed except a column with the same name exists in the spec data sets. Once these definitions are made at the beginning of a beamtime normally no changes are necessary any more.

5.2 Commands usefull for data analysis

Spectra is a very powerfull programm with lots of possibilities to treat data. But it takes some time to get used to its commands. This short manual is in no way intended to replace the Spectra manual which can be found on the Hamburger Synchrotronstrahlungslabor web pages. In this section four commands will be explained which allow even users without any experience to display and print their data to be able to check the progress of their measurements during the experiment.

single xxx
displays the scan with number xxx as seen in figure 5.1. If no number is given the scan following the last scan displayed will be shown (single_plot_6idb.gra).
multi xxx
multi searches the hard disk for the highest scan number and than waits for the next arriving scan. Once this scan arrives it is displayed and multi waits for the next scan. The program can be aborted by hitting the space key. It is only necessary to supply a number xxx if there are already several thousand scans on the hard disk and you do not want the program wasting time with finding the last number. If xxx is supplied the search starts with xxx (auto_plot_6idb.gra).
the actual content of the graphic window of Spectra is send to the beamline printer (plotit.gra).
Shows the actual configuration which was done in set_names.gra as described in section 5.1. This command also shows the status of two more variables: yeslaser and nolaser. The choice of names has historical reasons. If the variable yeslaser is defined (just assign any number at the commandline, for example yeslaser=42) every scan displayed by single or multi will automatically be printed on the beamline printer. If nolaser is not defined (to revoke a definition type nolaser=         at the command line), a postscript file will be created for each scan with the same name and in the same directory of the fio files with extension ``.ps'' (settings_spec.gra).
This gives a short help and shows some variables (hilfe_spec.gra).
This command should not be called by users. This is the macro which displays the scans and it is called by single and multi (after_spec.gra).
All these commands are symbols which are defined in spectra_ini.gra. You can not make changes directly to these programs because on the computers for data analysis they are stored in the directory /home/hupfeld/common/. You have to copy these macros to a directory of your choice and modify them there. All you have to do afterwords is to change the symbol definitions in spectra_ini.gra so that they are now pointing to your directory. Please do not change the spectra_ini.gra file in the home directory. Copy it to your directory and make the changes there. If you start Spectra from your own directory with a spectra_ini.gra file present the one in the home directory will not be read. Same rule applies for the set_names.gra file.

next up previous contents index
Next: 6. Using the image Up: html Previous: 4. spec   Contents   Index
Dirk Hupfeld 2001-12-20