Lab::Moose::DataFile::Gnuplot - Text based data file ('Gnuplot style')
version 3.600
use Lab::Moose; my $folder = datafolder(); my $file = datafile( type => 'Gnuplot', folder => $folder, filename => 'gnuplot-file.dat', columns => [qw/gate bias current/] ); $file->log_comment(comment => "some extra comment"); $file->log_newline(); $file->log(gate => 1, bias => 2, current => 3); $block = [1, 2, 3, 4, 5, 6]; $file->log_block( prefix => {gate => 1, bias => 2}, block => $block );
Supports the following attributtes in addition to the Lab::Moose::DataFile requirements:
columns
(mandatory) arrayref of column names
precision
The numbers are formatted with a %.${precision}g format specifier. Default is 10.
%.${precision}g
$file->log(column1 => $value1, column2 => $value2, ...);
Log one line of data.
$file->log_block( prefix => {column1 => $value1, ...}, block => $block, add_newline => 0 );
Log a 1D or 2D PDL or array ref. The first dimension runs over the datafile rows. You can add prefix columns, which will be the same for each line in the block. E.g. when using a spectrum analyzer inside a voltage sweep, one would log the returned PDL prefixed with the sweep voltage.
$file->log_newline();
print "\n" to the datafile.
$file->log_comment(comment => $string);
log a comment string, which will be prefixed with '#'. If $string contains newline characters, several lines of comments will be written.
$string
This software is copyright (c) 2017 by the Lab::Measurement team; in detail:
Copyright 2016 Simon Reinhardt 2017 Andreas K. Huettel, Simon Reinhardt
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Lab::Measurement, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lab::Measurement
CPAN shell
perl -MCPAN -e shell install Lab::Measurement
For more information on module installation, please visit the detailed CPAN module installation guide.