++ed by:
AMBA

1 PAUSE user
1 non-PAUSE user.

Andreas K. Hüttel
and 4 contributors

NAME

Lab::Moose::DataFile::Gnuplot - Text based data file.

SYNOPSIS

 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
 );

METHODS

new

Requires a 'column' attribute in addition to the Lab::Moose::DataFile requirements.

log

 $file->log(column1 => $value1, column2 => $value2, ...);
 

Log one line of data.

log_block

 $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.

log_newline

 $file->log_newline();

print "\n" to the datafile.

log_comment

 $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.