Archive for February 2007

PDL Cheat Sheet

February 20, 2007
PDL 2.4.3 cheat sheet v2 by Lino Ramirez, Lino.M.Ramirez (at) gmail.com
NOTE:
Piddles are stored in (column, row) order

STARTING & QUITTING THE SHELL       GETTING HELP
perldl    exit    quit              help 'func'    ? 'func'
                                    apropos 'func' ?? 'func'
SHELL CONFIGURATION FILES           sig 'func'
$HOME/.perldlrc                     usage 'func'
PDL/default.perldlrc                demo
local.perldlrc
                              USING AUTOLOADER
WRITING PERL SCRIPTS          use PDL::AutoLoader;
use PDL;                      # environment variable PDLLIB defines
                              # the search path for AUTOLOADER module
CREATING PIDDLES
new       pdl        topdl          TYPE CONVERSIONS
null      zeroes     ones           ushort    float    long  convert
identity  random     grandom        byte      double   short
randsym   sequence
xvals     yvals     zvals           FILE I/O
xlinvals  ylinvals  zlinvals        fits    wfits  rcols  wcols  rcube
rvals     axisvals  allaxisvals     rpic    wpic   rim    wim    rgrep

OPERATORS                           COPYING PIDDLES
+    -    *    /    **    >    <    $pnew = pdl( $pold );
>=   <=   ==   !=   <<    >>   &    $pnew = $pold->copy;
|    ^    +=   -=   *=    /=   %=
**=  >>=  <<=  &=   |=    ^=        EXTRACTING INFORMATION
<=>  !    %    ++   --              slice dice dice_axis diagonal

ADDITIONAL OPERATORS                LOCATING INFORMATION
.=    assignation                   index  index2d   indexND    where
x     matrix multiplication         which  whichND   which_both

GETTING PIDDLES' PROPERTIES         MODIFYING PIDDLES
? vars    PDL->px    info           list      listindices      one2nd
dims      getdim     getndim        set       clip   rotate    xchg
howbig    nelem      at             reshape   mv     reorder   dummy
                                    transpose clump  splitdim
COMBINING PIDDLES
append   glue   cat   dog           ELEMENTARY MATH FUNCTIONS
                                    abs  acos  acosh asin asinh
VECTOR FUNCTIONS                    atan atan2 atanh cos  cosh
inner    outer    uniq              sin  sinh  tan   tanh sqrt
in       setops   norm              ceil floor rint  exp  log log10

DATA ANALYSIS                       SPECIALIZED MATH FUNCTIONS
stats   statsover   qsort           bessj0  bessjn  bessy0  bessyn
sum     sumover     cumusumover     erf     erfc    erfi    intover
max     maximum     maximum_ind     lags    lgamma  pcoef   simplex
avg     average     qsorti          fibonacci
min     minimum     minimum_ind
minmax  minmaximum  median          DATA INTERPOLATION
medover oddmedian   oddmedover      fitgauss1d  fitgauss1dr  fitpoly1d
prod    prodover    cumuprodover    interpol    interpolate  ninterpol
hist    histogram   histogram2d     interpND    lmfit
and     and2        andover         polfit      pvalue       polycoef
or      or2         orover          polyfit     polyvalue

MATRIX OPERATIONS                   IMAGE PROCESSING
inv  matinv eigens_sym  eigens      cquant rgbtogr rot2d med2d conv2d
svd  eigsys determinant det simq    warp2d rebin   convolveND

TWO-DIMENSIONAL PLOTTING            THREE-DIMENSIONAL PLOTTING
use PDL::Graphics::PGPLOT;          use PDL::Graphics::TriD;
dev  env  line  points  errb  bin   imag3d imag3d_ns imagrgb points3d
cont ctab vect  poly    imag        line3d lattice3d mesh3d grabpic3d
circle  ellipse    rectangle text   keeptwiddling3d  nokeeptwiddlin3d
legend  draw_wedge release   hold   twiddle3d  hold3d  release3d

FOURIER TRANSFORM FUNCTIONS         COMPLEX NUMBERS FUNCTIONS
use PDL::FFT;                       Cabs Carg Cp2r Cr2p i2C r2C
fft  fftnd  realfft realifft
ifft ifftnd cdiv    cmul            MISCELANEOUS FUNCTIONS
kernctr  fftconvolve                inplace  trace  thread
                                    band bandover bitnot bor borover
PDL MODULE DEPENDENCIES             all   any   isempty  zcheck
Perl 5.6.1+ (5.8.x recommended)
ExtUtils::MakeMaker (latest version)    LINKS
C-compiler   Fortran compiler           pdl.perl.org
PGPLOT libraries & C-binding (PGPLOT)   perlmonks.org
OpenGL or Mesa  (TriD)                  search.cpan.org/dist/PDL/
netpbm package (PDL::IO::Pic)           pdl.sourceforge.net/PDLdocs/
Advertisements

Open season for researchers

February 14, 2007

I found a nice article on Open Access that was published in the Guardian.

From the article, we have that:

“Ours is the best of businesses: we get our raw material for free and our customers pay us a year in advance,” joked the publisher of an academic journal to a university researcher.

Perhaps not for much longer. Momentum is growing for publicly funded published academic research to be available free on the internet. So-called “open access” would mean anyone could view an article in a scholarly journal shortly after it was published.

The Complete Article

Cheers,

Lino

Getting Started with PDL

February 13, 2007

Early this month, I wrote an introduction to the Perl Data Language (PDL). Here is the Introduction:

Imagine you, Just Another Perl Hacker, were assigned to this new project that involves heavy numerical computation. Most of your peers recommend you to use C or C++. Some others recommend you the language of the Snake -sorry I forgot the name ;-). What can you do if you really want to keep using Perl? Using PDL is the answer. The Perl Data Language (PDL) is a package that gives Perl the ability to compactly store and speedily manipulate the large N-dimensional data sets that are common in scientific and other data intensive programming tasks. To achieve such a great performance, PDL uses C (and sometimes Fortran) to efficiently handle multidimensional data sets. For the rest of the tutorial, I will assume you have a working copy of PDL already installed. Once you have PDL installed, you can use it in Perl scripts by simply declaring: use PDL;. If you have not yet installed PDL, I will recommend you to have a look at the Appendix for some of the pre-requisites for having PDL installed without problems. And if you get into troubles, I recommend you to ask in one of the PDL mailing lists or here at the Monastery. Now, we are ready to start.

 

The full tutorial is available at PerlMonks.

 

Cheers,

Lino.