Sponsoring The Perl Toolchain Summit 2025: Help make this important event another success Learn more

NAME

Lab::Moose::DataFile::Read - Read a gnuplot-style 2D data file

VERSION

version 3.920

SYNOPSIS

# Read gnuplot ASCII datafile and return each column as a 1D PDL
my @columns = read_gnuplot_format(
type => 'columns',
file => 'data.dat',
num_columns => 2,
);
# Read block structured 3D gnuplot ASCII datafile and return
# 2D PDL for each parameter (column)
my @pixel_maps = read_gnuplot_format(
type => 'maps',
file => '3d_data.dat',
num_columns => 3,
);
# Read 3D gnuplot ASCII datafile and return 3D PDL with dimensions
# [column, line, block]
my $pdl = read_gnuplot_format(
type => 'bare',
file => '3d_data.dat',
num_columns => 3,
);

Functions

read_gnuplot_format

Exported by default. Allowed parameters:
  • type

    Either 'columns', 'maps', or 'bare'.

  • file

  • fh

    Provide an open file handle instead of a filename.

  • num_columns (mandatory)

    Number of columns in the datafile. Used for a consistency check.

COPYRIGHT AND LICENSE

This software is copyright (c) 2024 by the Lab::Measurement team; in detail:

Copyright 2016 Simon Reinhardt
2017 Andreas K. Huettel, Simon Reinhardt
2018 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.