NAME
Astro::STSDAS::Table::Simple - simple interface to STSDAS format tables
SYNOPSIS
use Astro::STSDAS::Table::Simple qw( read_table );
$data = read_table( $file, { Input => 'Binary',
Output => 'RowHash' } );
DESCRIPTION
Astro::STSDAS::Table::Simple provides a very simple interface to STSDAS format tables.
Functions
- read_table
-
$data = read_table( $file, \%options );
This slurps an entire table into memory. The options hash is used to indicate what type of input table it is (either binary or text) and how to structure the output. Options are specified as keys in the hash. For example:
$data = read_table( $file, { Input => 'Binary', Output => 'RowHash' } );
- Input
-
The input file type. It is either
Binary
orText
. Currently onlyBinary
is supported. - Output
-
This can take one of the following values:
- RowHash
-
The data are returned as a reference to an array containing hashrefs, one per row. The hash keys are the column names.
For example, to access the value of column
time
in row 3,$data->[2]{time}
- RowArray
-
The data are returned as a reference to an array containing arrayrefs, one per row.
$data->[3][9]
- ColHash
-
The data are returned as a reference to a hash, one element per column. The keys are the column names, and the values are arrayrefs containing the data for the columns.
For example, to access the value of column
time
in row 3,$data->{time}[2]
- ColArray
-
The data are returned as a reference to an array, one element per column. The array elements are arrayrefs containing the data for the columns.
$data->[9][3]
In all cases, vector elements are returned as references to arrays containing the vectors.
LICENSE
This software is released under the GNU General Public License. You may find a copy at
http://www.fsf.org/copyleft/gpl.html
AUTHOR
Diab Jerius ( djerius@cpan.org )