PDL is an extension of Perl for numeric/scientific data processing. It was originally developed by astrophysicists as a free alternative to packages like IDL and Matlab. It's quite fast and memory-efficient, and very powerful. I've found it to be most useful in cases where you have to mix data-processing with the strengths of Perl (anything involving list & hash-operations, regular expressions and/or text-parsing or output). Its main drawback however is that it has a rather steep learning-curve, because the documentation is quite fragmented and not always clear. Therefore I've collected some useful links and examples.
Introduction material
- The PDL Book, bundled with the latest release of PDL
- Book "Beginning PDL" (PDF)
- The Perl Monks PDL Quick Reference Guide maintains an extensive list of resources, examples and frequently asked questions
Reference material
- A list of PDL modules and functions in the online-book "PDL -- Scientific Programming in Perl"
- PDL cheat sheet at Lino Ramirez' blog on Intelligent Data Analysis
- PDL "cribsheet" at Art Davis' excellent site. (While you're at it, check out his cribsheets on mathematics and essential Windows-software as well!)
Official site
Add-ons
- PDL-Stats, a set of statistical tools for PDL. Includes functions for basic statistics, probability distributions, linear regression, GLM, K-means clustering and time-series analysis.
- PDL-NetCDF, an interface that allows data in NetCDF files to be accessed as piddles. Very useful for reading and writing large vectors and multi-dimensional grids.
Installing PDL
- In Ubuntu, you can simply install the
pdl
package using Synaptic. - In RPM/yum-based systems, install the package
perl-PDL
. - If you don't have root/sudo access, you can get PDL from
CPAN and install
it in a local directory. From the documentation:\
PDL depends on a number of other Perl modules for feature complete operation. These modules are generally available at the CPAN. The easiest way to resolve these dependencies is to use the CPAN module to install PDL. Installation should be as simple as cpan install PDL # if the cpan script is in your path or if you don't have the cpan script try perl -MCPAN -e shell cpan> install PDL NOTE: if this is your first time running the cpan shell, you'll be prompted to configure the running environment.
Some examples of using PDL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|