Description | Perl tools for X-ray Absorption Spectroscopy |
Demeter::FSPath - Path for a quick first shell fit
This documentation refers to Demeter version 0.9.26.
Build a single scattering path of a given length for use in a quick first shell fit.
my $fspath = Demeter::FSPath->new(abs => $absorber_element,
scat => $scatterer_element,
edge => $edge,
distance => 2.0,
data => $data_object,
workspace => "/path/to/work/space",
);
##
## later...
##
my $fit = Demeter::Fit->new(data => [$data_object],
paths => [$fspath],
gds => $fspath->gds);
Once defined, the FSpath object behaves exactly like a normal Path oject. For instance, plotting:
$fspath -> plot('R');
This object is rather like an SSPath except that it is not built from an existing Feff object. The purpose of this object is to streamline a simple first shell fit by requiring only the element symbols of an absorber/scatterer pair and their approximate distance apart. The generation of a Feff object, including the Feff calculation will be handled automatically. Once made, this can be treated like a normal Path object, which it extends (in the Moose sense).
To further simplify a first shell fit, the FSPath also autogenerates a set of four GDS parameters, which get stored in the gds
attribute. The s02
, e0
, delr
, and sigma2
attributes which are inherited from the Path object get set appropriately. There are flags for optionally including 3rd or 4th cumulants in the fit.
The FSPath object can be used in a fit along with ordinary Path objects. Like with an Demeter::SSPath object, just include the FSPath object in the list of paths when setting up a Demeter::Fit object. The one caveat is that you have to explicitly include the automatically generated guess parameters in the Fit object's GDS list. This is most easily done using the gds
method of the FSPath object, as explained below. There is no way provided (and this is an intentional design decision) for the Fit object to regognize a FSPath object and automaticalluy include its associated GDS objects in the fit.
Note that this object does nothing to examine or modify the attributes of its associated Data object. You need to set Fourier transform and fitting ranges appropriately for a fit using an FSPath object. One way of doing this is to read from an Athena project file that has those parameters sets appropriately. The other, of course, is to manipulate the Data object in your script.
As with any Moose object, the attribute names are the name of the accessor methods. FSPath extends Path, so it has all of Path's attributes.
Along with the standard attributes of any Demeter object (name
, plottable
, data
, and so on), an FSPath has the following:
abs
The element symbol, name, or number of the absorbing atom.
scat
The element symbol, name, or number of the scattering atom.
edge
The edge at which to make the Feff calculation.
distance
The separation in Angstroms between the absorber and scatterer.
workspace
You must supply a space on disk for the Feff calculation to use. None is assumed and not providing a workspace will result in an error and exit.
use_third
and use_fourth
These are boolean flags which tell the FSPath object whether to define and use third and/or fourth cumulant parameters in the fit. For instance:
$fspath -> use_third(1);
or
$fspath -> set(use_third=>1, use_fourth=>1);
gds
This contains a reference to the list of 4 (or 5 or 6, depending on whether 3rd and 4th cumulants are used) GDS parameters which were autogenerated as part of the FSPath object. This is intended for use in defining a Fit object:
my $fit = Demeter::Fit->new(data => [$data],
paths => [$fspath],
gds => $fspath->gds);
parameter
This is a convenience methods for accessing the GDS objects that get auto-generated by the FSPath object. It returns the specified GDS object.
my $amp_gds = $fspath->parameter('s02');
my $e0_gds = $fspath->parameter('e0');
my $delr_gds = $fspath->parameter('delr');
my $sigma2_gds = $fspath->parameter('sigma2');
my $third_gds = $fspath->parameter('third');
my $fourth_gds = $fspath->parameter('fourth');
unset_parameters
This clears the autogenerated path parameters, setting them all literally to 0, except for s02
, which is set literally to 1.
This is useful in a situation where you wish to use the quick first shell scattering path in some other context than the quick first shell fit shown in the Synopsis above. An example might be to use the path as the basis of a histogram (see Demeter::ScatteringPath::Histogram). In that case you might do something like:
my ($rx, $ry, $rz) = $fspath -> sp -> histogram_gamma(1.8, 3.0, 0.1);
Good question ...
See Demeter::Config for a description of the configuration system. There is an fspath group that can be adjusted to modify the default behavior of the FSPath object.
Demeter's dependencies are in the Build.PL file.
n
and label
don't get reset correctly
Serialization
Warn about weird absorber/edge combinations
Please report problems to the Ifeffit Mailing List (http://cars9.uchicago.edu/mailman/listinfo/ifeffit/)
Patches are welcome.
Bruce Ravel, http://bruceravel.github.io/home
http://bruceravel.github.io/demeter/
Copyright (c) 2006-2018 Bruce Ravel (http://bruceravel.github.io/home). All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlgpl.
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.