Description | Perl tools for X-ray Absorption Spectroscopy |
Demeter::Data::Arrays - Data array methods for Demeter
This documentation refers to Demeter version 0.9.26.
put
This method is used to make a new Data object from two arrays containing the energy and xmu data.
$new_data = Demeter::Data -> put(\@energy, \@xmu);
The new Data object if returned. In every way, this is like any Data object that comes from a file. The use would be for converting some complex data format, e.g. a spreadsheet, into one or more Data objects. This method could also be used in a filetype plugin.
You can specify additional arguments like the new
or set
methods of the Data object:
$new_data = Demeter::Data -> put(\@energy, \@xmu, @args);
This second form must be used to make chi(k) data from arrays:
$new_data = Demeter::Data -> put(\@energy, \@chi, datatype=>'chi');
Note that the put
method sets the datatype to 'xmu', so to make chi(k) data you must explicitly specify it.
get_array
Read an array from the data processing backend (Ifeffit/Larch). The argument is the Ifeffit array suffix of the array to import.
@array = $dataobject->get_array("xmu");
ref_array
Get a reference to an array from the data processing backend (Ifeffit/Larch). The argument is the Ifeffit array suffix of the array to import.
$ref_to_array = $dataobject->ref_array("xmu");
put_xmu
Push an array onto a backend array representing the xmu data associated with the Data object. The purpose of this is to modify the mu(E) data for a Data object in place. An example would be to apply a dead time correction without creating a new group to contain the corrected data.
$dataobject -> put_xmu(\@xmu_array);
floor_ceil
Return a two element list containing the smallest and largest values of an array in the data processing backend (Ifeffit/Larch).
($min, $max) = $dataobject->floor_ceil("xmu");
yofx
Return the y value corresponding to a given x-value. This is found by interpolation from the specified array.
$y = $dataobject->yofx("xmu", q{}, $x);
The second argument (q{}
in this example) is used to specify a part of a fit, i.e. bkg
or res
.
iofx
Return the index of the value just lower than a given x-value. This is found by simple comparison with the values in the specified array.
$i = $dataobject->iofx($space, $x);
This is intended to probe the x-axis of a data space, so the first argument must be one of energy
, k
, R
, or q
).
points
This method is used extensively by the gnuplot plotting template set to generate temporary files for plotting with Gnuplot. See any of those plotting templates for examples of how this is used.
Demeter's dependencies are in the Build.PL file.
Moose is the basis of Demeter. This module is implemented as a role and used by the Demeter::Data object. I feel obliged to admit that I am using Moose roles in the most trivial fashion here. This is mostly an organization tool to keep modules small and methods organized by common functionality.
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.