Skip to content
Zakariyya Mughal edited this page Jan 5, 2015 · 2 revisions

PDL stands for Perl Data Language. It is a numerical calculation language based on the popular and well known Perl language. It is a very powerful and at the same time fast array-oriented language. It has also graphical displaying routines which provide publication quality plots in 2D and 3D. All this provides an incredible power and flexibility. Since it is based on Perl, its syntax is well structured and has a well designed language feel to it. You can write number crunching programs in a few lines of code. Projects which traditionally require days or weeks to code in FORTRAN or C can be written very quickly and compactly with a few lines of PDL. There is also a PDL shell were you can type in your commands to test your ideas. The PDL syntax is quite similar to the C language one, which makes it easy to translate the original PDL code into C whenever we feel we need more speed, which, does not happen very often.

PDL runs on many different platforms (Windows, UNIX, Linux, OS X). And it is free!!

[Image:free.jpeg]

Create and manipulate data. PDL has many built in powerful functions which create and manipulate data. It has many more of these type of functions than any other language of its type. They are also easy to use with a clear Perl syntax.

 perldl> $x=zeroes(3,2)->xlinvals(-2,2)
 perldl> print $x
 [
  [-2  0  2]
  [-2  0  2]
 ]


 perldl> $y=pdl( [ [0,1], [2,3] ] )
 perldl> print $y
 [
  [0 1]
  [2 3]
 ]
 perldl> $inverse=inv($y)
 perldl> print $inverse
 [
  [-1.5  0.5]
  [   1    0]
 ]
 perldl> print $y x $inverse
 [
  [1 0]
  [0 1]
 ]

Read and write data. You can read almost any type of data from PDL, some formats include NetCDF, HDF5, FITS, raw binary, ASCII tables, etc...

Plotting with PDL. PDL generates publication quality plots in 2D, in gif or Postscript format. The commands to generate these graphs are very simple to use.

[Image:2D_plot_example.gif]

Analysis of 3D data. You can make 3D plots in PDL to analyze your data. You can rotate and zoom into it interactively using you mouse.

[Image:3D_plot_example.gif]

Surface and Contour plots. PDL also allows you to make contour and surface plots of 3D data.

[Image:Surface_plot.gif]

Image data processing. There are many built in functions for image processing. You can filter images, process them, Fourier transform, etc. with PDL.

[Image:Image_processing.gif]

Signal processing. You also have many functions for signal processing: Fourier transforms, eigenvectors, etc.

Create application in PDL. PDL is based on Perl so it is straight forward to create well structured applications with all the power of a number crunching language (PDL) and the versatility of a well established language (Perl). Perl is one of the languages with the highest number of add on packages for any kind of programming application you can think of (http://www.cpan.org/).

#!/usr/bin/perl -w 
use PDL;
use PDL::Graphics::PGPLOT::Window;
use PDL::GSLSF::BESSEL;
$w=pgwin('Bessel-plot.gif/gif',{Size=>3.5});
$x=zeroes(1000)->xlinvals(0,20);
$y=bessj0($x);
$w->line($x,$y,{Title=>'Bessel',XTitle=>'x',YTitle=>'y'});
$w->close;

Scientific functions. PDL has many scientific functions from Slatec, GSL, Bessel functions, etc...

[Image:Bessel.gif]

Cartography capabilities. PDL has some very powerful functions to display data on different mapping projections.

[Image:Mapping.gif]

Create GUI applications. Using the Perl/Tk extension you can create your own GUI applications in a breeze. Perl/Tk is a well known and powerful Perl language extension to crete GUI applications.

[Image:GUI.gif]

PDL compares very well with other costly numerical calculation packages. Have a look at this benchmark.

[Image:benchmark.jpeg].

Clone this wiki locally