Previous Next Table of Contents

2. ASCII Format Data Files

ASCII format data files are plain text files which can be manipulated by many programs, including text editors, and stand-alone plotting routines. These files can be easily moved between different programs, different operating systems, and different machines. They can be sent by e-mail.

The ASCII files used by the UWXAFS data analysis programs have a minimal but well-defined layout, based on the lines of the text file. Document lines are placed at the top of the file. There can be any number of these lines, though most programs will store only the first 20 lines and ignore the rest. After the document lines, there is a line with minus signs (----) to indicate that all the document lines have been written. (If you want to get picky, the second through sixth non-blank characters in this line must be minus signs.) After this line of minus signs, there is an ignored line, which is typically used for labeling the columns of the numerical data which follow. All of these lines of text may have a number sign # in the first column. These are put there as a comment line for other programs that use text files. When read by UWXAFS programs, this leading # will not read as part of the document line.

After the ignored line for column labels comes the numerical data. Each set of data occurs on a single line. There can be between two and five columns of numbers. Columns of data are separated by one or more spaces or tab characters. The first column contains the abscissa, the second column contains the real part of the ordinate. The third through fifth column (if given) contain the imaginary part of the ordinate, the magnitude of the ordinate, and the phase of the ordinate, respectively. Listing all forms of complex data is redundant but quite useful. The UWXAFS programs will write all five columns for any complex data (as for chi(R) and chi(q)). The UWXAFS data analysis programs limit the data size to 2048 data points, which should be sufficient for all XAFS analysis.

The leading # in the first column of text lines and the general format of the ASCII format works well with the general-purpose, stand-alone graphics program gnuplot, which is freely available and works well on essentially every platform, and has a much larger user-base than any XAFS program. The UWXAFS project has no association with the gnuplot project, but we heartily recommend this program. It has its own oddities and is by no means perfect, but it does essentially everything needed for plotting simple data files, is well-documented and well-supported. It can write to a wide variety of output formats, including Postscript and nearly any terminal type. It can be run interactively or in batch mode. If you do not have it on your system, ask your system manager to install it. If you are the system manager, source code, documentation, and executables for some systems are available by anonymous ftp to ftp.dartmouth.edu. Support is provided through the usenet group comp.graphics.gnuplot.

As with the UWXAFS binary files, the ASCII files have a file type associated with them (see the next chapter for more details), though the only purpose of the file type of ASCII files is to tell how many columns to use. For ASCII files with file type xmu or chi only the first two columns are used, and the rest are ignored. All other file types (rsp and env) indicate complex data, so that all five columns are used. Examples of each of the file types are given in the following sections.

2.1 XMU files

Files with xmu File Type contain absorption data on an energy grid which does not need to be evenly spaced. The units of energy are eV. This file type is used for raw absorption data input to autobk and for the output data of the background function from autobk. The second column in xmu files contains values of absorption. The units for the data in the second column are unimportant. Raw synchrotron data of detector intensities must be converted to xmu format before being used in autobk. Any data in columns past the second will be ignored. The Cu absorption data distributed with autobk are examples of ASCII xmu data files. Here is part of one of them:

# Cu foil, 10K 
# data taken at NSLS beamline X-11A Sept 1992
# foil from 99.999% Cu rolled and annealed to ~12 microns
#----------------------------------------------------------
#     energy          xmu   
  0.8968871E+04   0.9484839E+00
  0.8969347E+04   0.9510049E+00
  0.8969909E+04   0.9537250E+00
  0.8970386E+04   0.9559226E+00
  0.8970862E+04   0.9591411E+00

2.2 CHI files

Files with chi File Type contain chi(k) data. The first column contains k-values in units of inverse Angstrom. These values should be evenly k-spaced. All UWXAFS programs will write chi files with a grid spacing of delta k = 0.05 inv. Ang., and will interpolate any input chi files onto this grid. The second column of a chi file contains the chi(k) values. It does not contain k-weighted chi(k). Any data past the second column will be ignored. The Cu chi(k) data that is output from the autobk and those distributed for input of feffit (which came from autobk) are examples of ASCII chi data files. Here is part of one of them:

# data  : cu 10k background by autobk
# chi: skey ASCII of cu010k.dat  using skey ASCII of chi.dat
# e0 =  8982.61; pre-edge range =[   -50.0  -200.0]; edge step = 2.257 
#---------------------------------------------------------------------
#     k              chi(k)   
   .5000000E+00   -.1540712E+00
   .5500000E+00   -.1576023E+00
   .6000000E+00   -.1621443E+00
   .6500000E+00   -.1669036E+00
   .7000000E+00   -.1723104E+00
   .7500000E+00   -.1756163E+00
   .8000000E+00   -.1719365E+00
   .8500000E+00   -.1712734E+00
   .9000000E+00   -.1738329E+00
   .9500000E+00   -.1679564E+00
   .1000000E+01   -.1598812E+00

2.3 RSP files

Files with rsp File Type contain chi(R) data. The first column contains R-values in units of Angtroms. These values will be evenly R-spaced. Though the size of the grid can vary, it will typically be delta R  = 0.031 Ang.. The second, third, fourth, and fifth columns of an rsp file contains the real, imaginary, amplitude, and phase parts of chi(R), respectively. The R-space outputs from feffit are examples of ASCII rsp data files. Here is part of one of them:

# data  : cu 10k background by autobk
# chi: skey ASCII of cu010k.dat  using skey ASCII of chi.dat
# e0 =  8982.61; pre-edge range =[   -50.0  -200.0]; edge step = 2.257 
#---------------------------------------------------------------------
#    r           real(chi(r))   imag(chi(r))   ampl(chi(r))  phase(chi(r))
  .0000000E+00   .6142655E-01   .0000000E+00   .6142655E-01   .0000000E+00
  .3067962E-01   .2903621E-01  -.5033424E-01   .5810884E-01  -.1047559E+01
  .6135923E-01  -.2831294E-01  -.4127166E-01   .5004970E-01  -.2172074E+01
  .9203885E-01  -.4082767E-01   .1267206E-01   .4274903E-01  -.3442544E+01
  .1227185E+00   .3410820E-02   .4164495E-01   .4178440E-01  -.4794109E+01
  .1533981E+00   .4358866E-01   .1037124E-01   .4480551E-01  -.6049594E+01
  .1840777E+00   .2678454E-01  -.3571878E-01   .4464575E-01  -.7210562E+01
  .2147573E+00  -.2032813E-01  -.3259343E-01   .3841307E-01  -.8411637E+01
  .2454369E+00  -.2877361E-01   .1295394E-01   .3155512E-01  -.9847800E+01
  .2761165E+00   .1427407E-01   .3249273E-01   .3548981E-01  -.1140950E+02

2.4 ENV files

Files with env File Type contain backtransformed EXAFS date chi(q). The first column contains k-values in units of inverse Angstroms. These values will be evenly k-spaced, with delta k = 0.05 inv Ang. The second, third, fourth, and fifth columns of an env file contains the real, imaginary, amplitude, and phase parts of chi(q), respectively. The backtransformed k-space outputs from feffit are examples of ASCII env data files. Here is part of one of them:

# data  : cu 10k background by autobk
# chi: skey ASCII of cu010k.dat  using skey ASCII of chi.dat
# e0 =  8982.61; pre-edge range =[   -50.0  -200.0]; edge step = 2.257 
#---------------------------------------------------------------------
#     k          real(chi(k))   imag(chi(k))   ampl(chi(k))   phase(chi(k))
   .5000000E+00   .7191563E-01  -.2600794E-01   .7647399E-01   .5936174E+01
   .5500000E+00   .6291400E-01   .1202853E-01   .6405354E-01   .6472096E+01
   .6000000E+00   .3789376E-01   .4072316E-01   .5562655E-01   .7104558E+01
   .6500000E+00   .2566442E-02   .5404260E-01   .5410350E-01   .7806528E+01
   .7000000E+00  -.3530601E-01   .4896256E-01   .6036428E-01   .8478718E+01
   .7500000E+00  -.6737898E-01   .2606567E-01   .7224505E-01   .9055658E+01
   .8000000E+00  -.8631523E-01  -.1053911E-01   .8695626E-01   .9546277E+01
   .8500000E+00  -.8719383E-01  -.5396802E-01   .1025442E+00   .9979011E+01
   .9000000E+00  -.6847088E-01  -.9584310E-01   .1177886E+00   .1037525E+02
   .9500000E+00  -.3230590E-01  -.1278652E+00   .1318832E+00   .1074810E+02
   .1000000E+01   .1581111E-01  -.1433793E+00   .1442484E+00   .1110541E+02


Previous Next Table of Contents