2. The basics of data processing

This chapter introduces you to data import using DEMETER and provides an overview of the most basic data processing and plotting chores. At the end of this chapter, you will be able to import XAS data from a variety of sources and make attractive plots of one or more data sets in any of energy, k-space, R-space, or back-transform k-space.

The sections of this chapter deal with importing data from each of the following kinds of files.

  • ASCII data file containing columns of energy and μ(E)
  • ASCII data file containing columns of wavenumber and χ(k)
  • ASCII data file containing columns of energy and detector readings
  • ATHENA project files
  • ASCII data file containing columns of energy and detector readings for multiple channels of data
  • Data files from beamlines that cannot be imported using any of the above.

These is also a section explaining how to deal with data coming from a source that is not addressed by any of the above, for instance, data conatined in a spreadsheet file or data being genereated algorithmically by a program.

The final section provides an overview of DEMETER's plotting capabilities.

As you will see in every example to follow, a DEMETER program is just a perl program which makes extensive use of the capabilities of the DEMETER library, which is itself written in perl. A DEMETER program requires a small amount of boilerplate at the beginning. Just put the following line at the top of your perl program and you are using DEMETER:

use Demeter;

Note that the strict and warnings pragmas are imported automatically when DEMETER is imported. That is, DEMETER requires that your programs conform to these two pragmas. That is such an inherently good idea that DEMETER insists upon it. Exporting these two perl pragmata is accomplished in the same manner as for Modern::Perl (see lines 38 and 39).


DEMETER is copyright © 2009-2016 Bruce Ravel – This document is copyright © 2016 Bruce Ravel

This document is licensed under The Creative Commons Attribution-ShareAlike License.

If DEMETER and this document are useful to you, please consider supporting The Creative Commons.