Demeter

Description Perl tools for X-ray Absorption Spectroscopy
Demeter > Perl Modules > Demeter::Data::MultiChannel
Source

NAME

Demeter::Data::MultiChannel - Efficiantly read multiple data channels from a single file

VERSION

This documentation refers to Demeter version 0.9.26.

DESCRIPTION

This object provides a way to read multiple channels of data from a single column data file that uses the data processing backend (Ifeffit/Larch) as efficiently as possible.

  my $mc = Demeter::Data::MultiChannel->new(file => $file,
                                            energy => '$1');
  my $data1 = $mc->make_data(numerator   => '$3',
                             denominator => '$2',
                             ln          => 0,
                             name        => 'MED Channel 1');
  my $data2 = $mc->make_data(numerator   => '$4',
                             denominator => '$2',
                             ln          => 0,
                             name        => 'MED Channel 2');
  $_->plot('E') foreach ($data1, $data2);

    ## later on...

  $mc -> discard;

The data file containing multiple channels of data is imported by the Data::MultiChannel object. Normal Data objects are created using the make_data method. The advantage of this over simply re-importing the data file for each Data object is that backend arrays for the raw data columns are only created once, greatly reducing the amount of array wrangling that the backend must perform.

This method was written for the mutichannel ioniziation chambers discussed in (give reference). This class would also be useful for generating fuorescence data groups from each individual channel of an energy dispersive detector.

This object inherits from Demeter::Data although most data processing capabilities of the Data object are disabled in a simple way. Many of the array handling methods described in Demeter::Data::Arrays are useful when dealing with Data::MultiChannel objects.

METHODS

make_data

This returns a Data object. When a Data::MultiChannel object is created, you must specify the file and energy attributes, both of which are inherited from the Data object. The energy attribute is required so that the raw data arrays can be properly sorted. The energy array is then pushed onto all Data objects make using make_data.

The make_data certainly requires that the numerator, denominator, and ln attributes are set so that mu(E) data can be generated from the columns of the data file. All other Data attributes specified in the make_data method call will be passed along to the data object.

discard

This method destroys the Data::MultiChannel object and also removes all its associated arrays from the backend. It is hard to make all that happen automatically and at the proper time, so it is a good idea to explicitly do this when you are finished with a Data::MultiChannel object.

CONFIGURATION

There are no configuration options for this class.

See Demeter::Config for a description of Demeter's configuration system.

DEPENDENCIES

Demeter's dependencies are in the Build.PL file.

BUGS AND LIMITATIONS

Please report problems to the Ifeffit Mailing List (http://cars9.uchicago.edu/mailman/listinfo/ifeffit/)

Patches are welcome.

AUTHOR

Bruce Ravel, http://bruceravel.github.io/home

http://bruceravel.github.io/demeter/

LICENCE AND COPYRIGHT

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.