PDL::IO::HDF5::Dataset - PDL::IO::HDF5 Helper Object representing HDF5 datasets.
This is a helper-object used by PDL::IO::HDF5 to interface with HDF5 format's dataset objects. Information on the HDF5 Format can be found at the NCSA's web site at http://hdf.ncsa.uiuc.edu/ .
See PDL::IO::HDF5
ID number given to the dataset by the HDF5 library
Name of the dataset.
Ref to parent object (group) that owns this dateset.
Ref to the PDL::IO::HDF5 object that owns this object.
####---------------------------------------------------------
PDL::IO::HDF5::Dataset Constructor - creates new object
Usage:
This object will usually be created using the calling format detailed in the SYNOPSIS. The following syntax is used by the PDL::IO::HDF5 object to build the object.
$a = new PDL::IO::HDF5:Dataset( name => $name, parent => $parent, fileObj => $fileObj); Args: $name Name of the dataset $parent Parent Object that owns this dataset $fileObj PDL::HDF object that owns this dateset.
PDL::IO::HDF5::Dataset Destructor - Closes the dataset object
No Usage. Automatically called
Write data to the HDF5 dataset
$dataset->set($pdl); # Write the array data in the dataset
Get data from a HDF5 dataset to a PDL
$pdl = $dataset->get; # Read the Array from the HDF5 dataset, create a PDL from it # and put in $pdl
The mapping of HDF5 datatypes in the file to PDL datatypes in memory will be according to the following table.
HDF5 File Type PDL Type ------------------------ ----------------- PDL::IO::HDF5::H5T_C_S1() => PDL::Char Object (Special Case for Char Strings) PDL::IO::HDF5::H5T_STD_I8BE() => $PDL::Types::PDL_B PDL::IO::HDF5::H5T_STD_I8LE() => $PDL::Types::PDL_B, PDL::IO::HDF5::H5T_STD_I16BE() => $PDL::Types::PDL_S, PDL::IO::HDF5::H5T_STD_I16LE() => $PDL::Types::PDL_S, PDL::IO::HDF5::H5T_STD_I32BE() => $PDL::Types::PDL_L, PDL::IO::HDF5::H5T_STD_I32LE() => $PDL::Types::PDL_L, PDL::IO::HDF5::H5T_IEEE_F32BE()=> $PDL::Types::PDL_F, PDL::IO::HDF5::H5T_IEEE_F32LE()=> $PDL::Types::PDL_F, PDL::IO::HDF5::H5T_IEEE_F64BE()=> $PDL::Types::PDL_D, PDL::IO::HDF5::H5T_IEEE_F64LE()=> $PDL::Types::PDL_D
For HDF5 File types not in this table, this method will attempt to map it to the default PDL type PDL_D.
Get the dims for a HDF5 dataset. For example, a 3 x 4 array would return a perl array (3,4);
@pdl = $dataset->dims; # Get an array of dims.
Set the value of an attribute(s)
Currently the only attribute types supported are null-terminated strings.
$dataset->attrSet( 'attr1' => 'attr1Value', 'attr2' => 'attr2 value', . . . );
Returns undef on failure, 1 on success.
Delete attribute(s)
$dataset->attrDel( 'attr1', 'attr2', . . . );
Get a list of all attribute names associated with a dataset
@attrs = $dataset->attrs;
Get the value of an attribute(s)
my @attrs = $dataset->attrGet( 'attr1', 'attr2');
Returns the HDF5 library ID for this object
my $ID = $dataSetObj->IDget;
Returns the HDF5 Dataset Name for this object.
my $name = $datasetObj->nameGet;
To install PDL::IO::HDF5::Group, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PDL::IO::HDF5::Group
CPAN shell
perl -MCPAN -e shell install PDL::IO::HDF5::Group
For more information on module installation, please visit the detailed CPAN module installation guide.