For she, after inventing the grain in the island of Sicily, was the first to gather, prepare, preserve it, and the first to instruct mankind how to sow it.
DEMETER is a set of programmer's tools encompassing all the functionality of ATHENA and ARTEMIS. It is a very-high-level, pure-Perl interface to IFEFFIT. It is not, itself, a software product --- rather it is the tool from which software products can be built. DEMETER was first conceived as the intial phase of a rewrite of ARTEMIS, but quickly evolved into something much more useful than that. The intent is that DEMETER will be the IFEFFIT interface library for things like:
- full-featured GUIs like ATHENA and ARTEMIS
- the analytic portion of a high-throughput system
- a `feffit.inp' interpetter
- the backend to specialty EXAFS analysis programs such as Shelly Kelly's mkfit or ideosyncratic approaches to data analysis such as that described in Physical Review B, 73, p. 184121 (2006).
- Download and use instructions
-
Use the anonymous SVN server at cars9.uchicago.edu to check out the current version of DEMETER. This, of course, requires that you have a working copy of the Subversion version control software on your computer and that you know how to use it to check out code.
svn co http://cars9.uchicago.edu/svn/demeter/You can also browse DEMETER's Subverison repository from your web browser using the svn web portal http://cars9.uchicago.edu/svn/demeter/. At this time, only Bruce has privilege to write to the repository. If you would like to contribute code, documentation, or examples, let Bruce know.I have not yet written build and installation scripts. For now, you need to point your perl programs at the location where you checked DEMETER out from the repository. Use the -I switch to find the DEMETER modules. Use something like this in the first line of your program
#!/usr/bin/perl -I/home/bruce/codes/demeter/There are a number of example scripts using DEMETER in the `examples/' directory.
- CPAN requirements
-
Several modules must be downloaded from CPAN and installed for Demeter to work. The currrent list is in the `Bundle/DemeterBunlde.pm' file. The easiest way to install these requirements is to use the CPAN utility. From the main directory of the DEMETER distribution, do the following:
shell~> perl -MCPAN -e shell cpan> install Bundle::DemeterBundle
This will take a while. Answer yes to all the questions about following dependencies. - Document pages
-
Here are links to the html-ified pod documentation for the components of the DEMETER system. Note that the links in the document pages pointing to other document pages point incorrectly. This is an unfortunate feature of the tool used to convert the pod pages to html. Eventually, I'll write a post-processor to fix those problems.
Coming eventually actual content on the Plot document page, a quick-start quide to using Demeter, and some Emacs tools for automating object creation and setting attributes. For now, just follow the examples and hopefully things will make sense.
- Demeter
- The base class for the DEMETER system.
D
o
c
u
m
e
n
t
p
a
g
e
s
- Demeter::Plot
- The Plot object, which is used to control how plots are made.
- Demeter::Data
- The Data object, which is used to contain all parameters and methods for manipulating, processing, and analyzing XAS data.
- Demeter::Data::Mu
- Methods for Data objects containing mu(E) data
- Demeter::Data::E0
- Methods for aligning and calibrating mu(E) data
- Demeter::Data::Process
- Methods for basic mu(E) data processing
- Demeter::Feff
- The Feff object, which is used to run Feff and organize its output
- Demeter::ScatteringPath
- The ScatteringPath object, which is used by the Feff object's path finder method.
- Demeter::Feff::Sanity
- Sanity checks on Feff calculations, inherited by Feff.pm
- Demeter::Path
- The Path object, which is used to define and manipulate scattering paths and their associated path parameters math expressions.
- Demeter::GDS
- The Guess/Def/Set parameter object, which is used to define, organize, and evaluate the parameters used in a fit.
- Demeter::Fit
- The Fit object, which is a collection of Data, Path, and GDS objects deining an EXAFS fit.
- Demeter::Fit::Sanity
- Sanity checks on fitting models, inherited by Fit.pm
- Demeter::Dispose
- Methods for interacting with IFEFFIT. This class is inherited by all other classes in the DEMETER system.
- Demeter::Config
- Methods for configuring DEMETER applications.
- Demeter::Project
- Methods for saving and reading DEMETER project files.
- Demeter::Tools
- Utility class methods
- Example script
-
Here is a short example of using the DEMETER system to import and plot some data. This example is in the distribution, in the `examples/' directory. Note that, once the Plot and Data objects are defined, it takes exactly one method call to make a plot. The data import, and normalization, background removal, and Fourier transform are all done behind the scenes. Cool!
#!/usr/bin/perl -I/home/bruce/codes/demeter/ ## This is a fairly simple example of using Demeter to process ## some mu(E) data and make a nice plot. use warnings; use strict; use Ifeffit::Demeter; Ifeffit::Demeter->set_mode({ifeffit=>1, buffer=>0, screen=>1,}); my $plot_features = Ifeffit::Demeter::Plot -> new(); my $dobject = Ifeffit::Demeter::Data -> new({group => 'data0'}); $dobject -> set({is_xmu => 1, file => "fe.060.xmu", fft_kmax => 3, fft_kmin => 14, label => 'My iron data', bkg_spl2 => 18, bkg_nor2 => 1800, }); ## decide how to plot the data $plot_features->set({e_mu => 1, e_bkg => 1, e_norm => 0, e_pre => 1, e_post => 1, kweight => 2, r_pl => 'm', 'q_pl' => 'r', }); $dobject->set({bkg_flatten=>1}); $dobject->plot('kq'); # E k R q ## note that reading the data file, the background removal, and ## Fourier transform comes along for the ride when you ask for a ## plot -- that is, each of the following methods are called ## as needed behind the scenes: # $dobject->read_data; # $dobject->autobk; # $dobject->fft; # $dobject->bft; ## cool, huh? #### writing output column data files $dobject->save('norm', "fe.dat"); # xmu norm chi r q fit
- More examples
-
This table shows the plots generated by several of the example scripts in the SVN repository. Compare these plots with the scripts to see how much can be done in a very small number of lines of code using DEMETER. Click on the thumbnails to see the full size plots.
This image is the output of the the example shown above.
This example shows a comparison between two iron foils at different temperatures.
This example shows a fit to the first three shells of a copper foil. Note that most of the script is devoted to setting up the details of the data, paths, and iftting parameters. In fact, the perl source code for doing so looks a lot like the contents of `feffit.inp' file. This example also shows in interesting use of the y_offset Data attribute to make a stacked plot.
This example builds on the previous example. This is a multiple data set fit to copper foil at two temperatures. The plot shows the data and fit from both data sets simultaneously.
This example shows a fit to 5 data sets of various silver-gold alloys. The last part of the script demonstrates a bit of simple interactivity allowing the user to select the data set to plot along with its fit and the paths used in the fit.


![[Created by XEmacs!]](http://cars9.uchicago.edu/~ravel/images/z_logo_xemacs.jpg)
![[Created with the Template Toolkit!]](http://cars9.uchicago.edu/~ravel/images/TT.gif)




