PDL::IO (3)
Leading comments
Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) Standard preamble: ========================================================================
NAME
PDL::IO - An overview of the modules in the PDL::IO namespace.SYNOPSIS
# At your system shell, type: perldoc PDL::IO
DESCRIPTION
- *
-
Perlish or Text-Based
A few
IOmodules provide Perl-inspired capabilities. These are PDL::IO::Dumper and PDL::IO::Storable. PDL::IO::Misc provides simpler routines for dealing with delimited files, though its capabilities are limited to tabular or at most 3-d data sets. - *
-
Raw Format
PDLhas two modules that store their data in a raw binary format; they are PDL::IO::FastRaw and PDL::IO::FlexRaw. They are fast but the files they produce will not be readable across different architectures. These two modules are so similar that they could probably be combined.
- *
-
Data Browsing
At the moment, only PDL::IO::Browser provides data browsing functionality.
- *
-
Image Handling
PDLhas a handful of modules that will load images into piddles for you. They include PDL::IO::Dicom,PDL::IO::FITS, PDL::IO::GD,PDL::IO::Pic, and PDL::IO::Pnm. However,PDL::IO::FITSshould also be considered something of a general data format.
- *
-
Disk Caching
Both PDL::IO::FastRaw and PDL::IO::FlexRaw provide for direct piddle-to-disk mapping, but they use
PDL's underlying mmap functionality to do it, and that doesn't work for Windows. However, users of all operating systems can still use PDL::DiskCache, which can use any desiredIOread/write functionality (though you may have to write a small wrapper function). - *
-
General Data Storage Formats
PDLhas a number of modules that interface general data storage libraries. They includePDL::IO::HDFandPDL::IO::NDF(the latter is now a separateCPANmodule). There is aPDL::IO::IDL,though at the moment it is not distributed withPDL.PDL::IO::FITSis something of a general data format, since piddle data can be stored to aFITSfile without loss. PDL::IO::FlexRaw and PDL::IO::FastRaw read and write data identical C's low-level "write" function and PDL::IO::FlexRaw can work withFORTRAN 77 UNFORMATTEDfiles. FlexRaw and Storable provide general data storage capabilities. Finally,PDLcan read Grib (weather-data) files using theCPANmodule PDL::IO::Grib.
- *
-
Making Movies
You can make an
MPEGanimation using PDL::IO::Pic's wmpeg function.
Here's a brief summary of all of the modules, in alphabetical order.
PDL::DiskCache
The DiskCache module allows you to tie a Perl array to a collection of files on your disk, which will be loaded into and out of memory as piddles. Although the module defaults to working withIf you find yourself writing scripts to procss many data files, especially if that data processing is not necessarily in sequential order, you should consider using PDL::DiskCache. To read more, check the PDL::DiskCache documentation.
PDL::IO::Browser
The Browser module provides a text-based data browser for 2D data sets.It uses the
PDL::IO::Browser is not installed by default because it gives trouble on Mac
To see if the module is installed on your machine (and to get more information about PDL::IO::Browser), follow this link or type at the system prompt:
perldoc PDL::IO::Browser
If you want to get more information about PDL::IO::Browser and it's not installed on your system, I'm afraid you'll have to pick out the pod from the source file, which can be found online at <pdl.git.sourceforge.net/git/gitweb.cgi?p=pdl/pdl;a=blob_plain;f=IO/Browser/browser.pd;hb=HEAD>.
PDL::IO::Dicom
PDL::IO::Dumper
Provides functionality similar to Data::Dumper for piddles. Data::Dumper stringifies a data structure, creating a string that can be "eval"ed to reproduce the original data structure. It's also usually suitable for printing, to visualize the structure.To read more, check the PDL::IO::Dumper documentation. See also PDL::IO::Storable for a more comprehensive structured data solution.
PDL::IO::FastRaw
Very simple module for quickly writing, reading, and memory-mapping piddles to/from disk. It is fast to learn and fast to use, though you may be frustrated by its lack of options. To quote from the original``The binary files are in general
This creates two files for every piddle saved - one that stores the raw data and another that stores the header file, which indicates the dimensions of the data stored in the raw file. Even if you save 1000 different piddles with the exact same dimensions, you will still need to write out a header file for each one. You cannot store multiple piddles in one file.
Note that at the time of writing, memory-mapping is not possible on Windows.
For more details, see PDL::IO::FastRaw. For a more flexible raw
PDL::IO::FITS
Allows basic reading and writing of This module may or may not be installed on your machine. To get more information, check online at <pdl.sourceforge.net/PDLdocs/IO/FITS.html>. To see if the module is installed on your machine, follow this link or type at the system prompt:
perldoc PDL::IO::FITS
PDL::IO::FlexRaw
Somewhat smarter module (compared to FastRaw) for reading, writing, and memory mapping piddles to disk. In addition to everything that FastRaw can do, FlexRaw can also store multiple piddles in a single file, take user-specified headers (so you can use one header file for multiple files that have identical structure), and read compressed data. However, FlexRaw cannot memory-map compressed data, and just as with FastRaw, the format will not work across multiple architectures.FlexRaw and FastRaw produce identical raw files and have essentially identical performance. Use whichever module seems to be more comfortable. I would generally recommend using FlexRaw over FastRaw, but the differences are minor for most uses.
Note that at the time of writing, memory-mapping is not possible on Windows.
For more details on FlexRaw, see PDL::IO::FlexRaw.
PDL::IO::GD
In addition to reading and writing .png and .jpeg files,
This module provides
PDL::IO::Grib
APDL::IO::HDF, PDL::IO::HDF5
Provides an interface to You should look into the
PDL::IO::IDL
Once upon a time, PDL::IO::Misc
Provides mostly text-basedAlternative text-based modules support higher dimensions, such as PDL::IO::Dumper and PDL::IO::Storable. Check the PDL::IO::Misc documentation for more details.
PDL::IO::NDF
Starlink developed a file format for N-Dimensional data Files,
which it cleverly dubbed PDL::IO::Pic
Provides reading/writing of images to/from piddles, as well as creatingPDL::IO::Pnm
Provides methods for reading and writing pnm files (of which pbm is but one). Check the PDL::IO::Pnm documentation for more details. Also check out the previous module andPDL::IO::Storable
Implements the relevant methods to be able to store and retrieve piddles via Storable. True, you can use many methods to save a single piddle. In contrast, this module is particularly useful if you need to save a complex Perl structure that contain piddles, such as an array of hashes, each of which contains piddles.Check the PDL::IO::Storable documentation for more details. See also PDL::IO::Dumper for an alternative stringifier.