Description | Perl tools for X-ray Absorption Spectroscopy |
Demeter::VPath - Virtual paths for EXAFS visualization
This documentation refers to Demeter version 0.9.26.
Build a virtual path from several real paths.
my $vpath = Demeter::VPath->new(name => "my virtual path");
$vpath -> include($path1, $path3, $path12);
$vpath -> plot('R');
A fit can involve a lot of paths. It is often useful to make a plot showing your data and its fit along with some of the paths that went into the fit. In a fit with lots of small paths, one might want to convey a sense of how several small paths affect the fit in aggregate. A plot showing each individual path will be messy and won't actually convey the point.
The VPath object is tool for addressing this. A VPath, or "virtual path", is a sum of two or more paths which is Fourier transformed and plotted as a single object. This cleans up your plot and more directly conveys the effect of the constituent paths on the fit.
This object carries a sufficiently low-overhead that you can safely destroy one and recreate it with a different list of paths. That will usually be easier than managing the content of the paths
atrtibute (although you can certainly do so, if you prefer).
The VPath can also be saved to a column data file using the normal save
and save_many
methods.
Along with the standard attributes of a Demeter object (name
, plottable
, data
, and so on), a VPath has the following:
paths
This is the sole user-servicable attribute specific to this class. Its accessor returns the list of Path objects making up this VPath.
my @list_of_paths = $vpath -> paths;
See the include method for how to set this attribute properly.
You should set the name
attribute to something useful. By default, the name will be "virtual path". The data
attribute is set to be the same as the first Path in the list of paths contributing to the VPath.
The methods push_paths
, pop_paths
, shift_paths
, unshift_paths
, and clear_paths
are defined to operate on this list. But they should be used with caution. The inlcude
and clear
methods below are wrappers around these which perform additional chores necessary for the correct operation of the VPath object.
include
Use this method to put one or more Path objects in the VPath's list of paths:
$vpath -> include($some_path);
or
$vpath -> include(@a_bunch_of_paths);
While you could, in principle, use the paths
attribute accessor and its service methods to set the list of paths, this method performs the additional chore of correctly setting the data
attribute.
clear
This method empties out the path list and unsets the data attribute without destroying the VPath object.
$vpath -> clear;
## @{ $vpath->paths } is now ();
first
Return the first path in the VPath's path list;
$first_one = $vpath -> first;
This is used in the prep_vpath
template.
Good question ...
See Demeter::Config for a description of the configuration system.
Demeter's dependencies are in the Build.PL file.
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.