Merging data is one of the essential data processing steps. As with every thing, DEMETER tries to make merging as easy as possible:
The first argument to the merge method specifies which spectrum is merged: e means to merge μ(E), n means to merge normalized μ(E), and k means to merge χ(k).
Care is taken not to double count the caller. This is a convenience because, as shown above, you can pass an entire array which also contains the caller.
The merge method returns a new Data object.
Both of the plot types below (stddev and varience) plot ignore many setting of the Plot object in order to plot the data in the form in which it was merged. Attempting to plot the standard deviation or variance plots with a Data object that does not contain merged data will return as error.
- #!/usr/bin/perl use Demeter;
- my @common = (energy => '$1', numerator => '$2', denominator => '$3', ln => 1,);
- my $prj = Demeter::Data::Prj -> new(file=>'U_DNA.prj');
- my @data = (
- Demeter::Data -> new(file => 'examples/data/fe.060',
- name => "Fe scan 1",
- @common,
- ),
- Demeter::Data -> new(file => 'examples/data/fe.061',
- name => "Fe scan 2",
- @common,
- ),
- Demeter::Data -> new(file => 'examples/data/fe.062',
- name => "Fe scan 3",
- @common,
- ),
- );
- my $merged = $data[0] -> merge('e', @data);
- $merged -> plot('stddev');