Ifeffit::Demeter - OO interface to paths for EXAFS data analysis using Ifeffit
This documentation refers to Ifeffit::Demeter version 0.0.1
$path_object -> new();
$path_object -> set({data => $dobject,
folder => 'example/cu/',
file => "feff000$j.dat",
label => "path $j",
s02 => 'amp',
e0 => 'enot',
delr => 'alpha*reff',
sigma2 => 'debye(temp, theta) + sigmm',
});
This subclass of the Ifeffit::Demeter class is inteded to hold information pertaining to paths using theory from feff for use in a fit.
The following are the attributes of the Path object. Attempting to access an attribute not on this list will throw and exception.
The type of argument expected in given in parentheses. Several of the
attributes take an anonymous array as the value. In each case, the
zeroth element of the annonymous array is the math expressionfor the
path and the first element is its evaluation. See the discussion
below in METHODS for a description of how these attributes
interacts with the accessor methods. See also the description of the
evaluate method for how the second element of the anonymous array
gets set.
The defaults for all path parameter math expressions is 0 except for
s02, which is 1. The *_value path parameter attributes contain
the evaluation of the path parameter after the fit is made or the path
is otherwise evaluated.
The attributes marked with [read-only] are typically not set
interactively. Instead, they will be set as a side effect of other
method calls. For example, the nleg attribute will the set after the
file attribute is set. nleg is a piece of information that is
determined from the `feffNNNN.dat' file. They are not strictly
read-only. You can set them if you want, but no care is taken to
preserve your modification from subsequent method calls.
For this Path object to be included in a fit, it is necessary that it be an attribute of a Fit object. See the Ifeffit::Demeter::Fit manpage for details.
This is the Ifeffit group name used for this path. That is, its arrays will be called group.k, group.chi, and so on. It is best if this is a reasonably short word and it must follow the conventions of a valid group name in Ifeffit. By default, this is a random, four-letter word.
This is a text string used to describe this object in a user
interface. While the group attribute should be short, this can be
more verbose. But it should be a single line, unlike the title
attibute.
This is the reference to the Feff object that this Path is a part of.
This is the reference to the Data object that this path is associated with.
This is the reference to the ScatteringPath object that this path gets
its `feffNNNN.dat' file from.
This is a string that takes the fully qualified path (in the file
system sense, not the Ifeffit sense) to the `feffNNNN.dat' file
associated with this Path object.
If the SP attribute is set, then this attribute will be set
automatically and changing it via the Path object's set method will
be forbidden.
This is the name of the `feffNNNN.dat' file associated with this
Path object.
If the SP attribute is set, then this attribute will be set
automatically.
This is the path index as required in the definition of an Ifeffit Path. It is rarely necessary to set this by hand. Indexing is typically handled by Demeter.
When this is true, this Path will be included in the next fit.
This is a flag for use by a user interface to indicate that after a fit is finished, this Path should be plotted.
For each of these (except n and id which do not take math
expressions and the array path parameters which do not evaluate to
scalars), the first item listed is the attribute which takes the math
expression. The second item listed is the evaluation of the math
expression after the fit is prefromed. The evaluation cannot be set
by hand. Instead you must change the values of GDS objects and
re-evaluate the fit using either of the fit or sum methods.
This is the path degeneracy in the definition of an Ifeffit path.
This is a number, not a math expression. Use the s02 attribute to
parameterize the amplitude of the path.
This is the amplitude term for the path.
This is the energy shift term for the path.
This is the path length correction term for the path.
This is the mean square displacement shift term for the path.
This is the imaginary energy correction term for the path.
This is the third cumulant term for the path.
This is the fourth cumulant term for the path.
This is the constant phase shift term for the path.
This is Ifeffit identification string for the path.
This takes the math expression for the infrequently used k_array
path parameter. You really need to know what you are doing to use the
array valued path parameters!
This takes the math expression for the infrequently used amp_array
path parameter. You really need to know what you are doing to use the
array valued path parameters!
This takes the math expression for the infrequently used
phase_array path parameter. You really need to know what you are
doing to use the array valued path parameters!
Where possible, these attributes will be taken from the ScatteringPath object associated with the Path.
This is the degeneracy in the `feffNNNN.dat' file associated with
this Path object.
This is the number of legs in the `feffNNNN.dat' file associated
with this Path object.
This is the effective path length in the `feffNNNN.dat' file
associated with this Path object.
This is the amplitude (i.e. ``Zabinsky curved wave importance factor'')
for the `feffNNNN.dat' file associated with this Path object.
Note that this is always 0 for paths that come from ScatteringPath objects, since the ScatteringPath objct does not, at this time, have a method for computing the ZCWIF.
This is a line of text relating to this path from the interpretation the Feff calculation.
This is a textual description of the scattering geometry associated with this path.
This is true when the path associated with this object is a colinear or nearly colinear multiple scattering path.
This is true when the path associated with this object is a single scattering path.
The Path object inherits methods from the parent class described in the the Ifeffit::Demeter manpage documentation.
Additionally the Path object provides these methods:
This method returns the Ifeffit path index for this object. It's capitalized to avoid confusion with the built-in index function.
This method returns the reference to the Data object that this Path is
associated with. This method is meant to be used with the Data
object's data method. Path and Data objects can be put into a loop
and the correct Data object can be identified for each kind of object.
foreach my $obj (@data_objects, @paths_objects) {
my $d = $obj->data;
## do something with $d
};
Note that this works because Data objects have a data method which
self-identifies.
This method returns the evaluated value of a path parameter after a fit is made or a path is otherwise evaluated.
my $val = $path_object->value("sigma2");
read_data
This is completely different from the read_data method called on a
Data object. Or, it's exactly the same, depending on your
perspective. It is not normally necessary to call read_data on a
`feffNNNN.dat' file in the course of data analysis. That file is
imported into Ifeffit as a part of the write_path method.
When read_data is called on a Path object, the Ifeffit command for
reading the `feffNNNN.dat' file as a column data file is returned.
This is useful if you ever need to examine the raw columns of the
`feffNNNN.dat' file.
$command = $path_object -> read_data;
write_path
This method returns the Ifeffit commands to import and define a Feff
path. It takes a boolean argument which tells the method whether to
also generate the Ifeffit command for converting the defined path into
Ifeffit arrays for plotting or other manipulations. That argument is
set true as part of the display method, but false when the fit is
defined.
$command = $path_object -> write_path($do_ff2chi);
These methods are useful for generating log files and other reports.
paragraph
This method returns a multiline text string reporting on the
evaluation of the Path's math expressions. This text looks very much
like the text that Ifeffit returns when you use Ifeffit's show
@group command.
print $path_object -> paragraph;
row_main
This method returns a newline-terminated line of text containing the
values of several path parameters in a format suitable for making a
table of fitting results. The path parameters included in this line
are n, s02, e0, sigma2, delr, reff, and the sum of
delr and reff.
The optional argument specifies the width of the first column, which contains the path labels.
print $path[0] -> row_main($width);
With this optional argument, you can scan the path labels before
creating the table and pre-size the first column, leading to a much
more attractive table. The default width is 10 characters. The
row_main_label, row_second, and row_second_label methods also
take this same optional argument.
row_main_label
This method returns a newline-terminated line of text suitable for the
header of the table made by repeated calls to the row_main method.
Something like this will make a nice table
print $path[0] -> row_main_label; print $path[0] -> row_main; print $path[1] -> row_main; print $path[2] -> row_main;
row_second
This method returns a newline-terminated line of text containing the
values of several path parameters in a format suitable for making a
table of fitting results. The path parameters included in this line
are ei, dphase, third, fourth.
row_second_label
This method returns a newline-terminated line of text suitable for the
header of the table made by repeated calls to the row_second
method. Something like this will make a nice table
print $path[0] -> row_second_label; print $path[0] -> row_second; print $path[1] -> row_second; print $path[2] -> row_second;
R
This method returns the sum of the reff attribute and the
evaluation of the delr path parameter. This:
print $path_object -> R, $/;
is equivalent to (and fewer keystrokes than):
($reff, $delr) = $path_object->get(qw(reff delr_value)); $R = $reff + $delr; print $R, $/;
When the reference to the Path object is used in string context, it returns the group name. So
$path_object -> set({group => 'path1',
data => $data_object,
folder => 'example/cu/',
file => "feff0001.dat",
label => "path 1",
index => 1,
});
print "This is $path_object.\n";
will print
This is path1.
Rather than
This is Ifeffit::Demeter::Path.
When the reference to the Path object is used in numerical context, it returns the path index. So
sprint("This is path number %d.\n", $path_object);
will print
This is path number 1.
(F) You have used a group name that does not follow Ifeffit's rules for group names. The group name must start with a letter. After that only letters, numbers, &, ?, _, and : are acceptable characters. The group name must be no longer than 64 characters.
Describe serialize/deserialize methods
Dump/Load
freeze/thaw
describe file format
See the Ifeffit::Demeter manpage for a description of the configuration system.
See the Ifeffit::Demeter manpage for a list of dependencies.
Automated indexing currently only works when doing a fit. If you want to plot paths before doing a fit, you will need to assign indeces by hand.
Please report problems to Bruce Ravel (bravel AT anl DOT gov)
Patches are welcome.
Bruce Ravel (bravel AT anl DOT gov)
http://cars9.uchicago.edu/~ravel/software/
Copyright (c) 2006-2007 Bruce Ravel (bravel AT anl DOT gov). All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.