Notice. This is an old page.

All of these extensions are currently in scipy. Only extra-scipy material is located here. Currently, that is magick.

New Multipack Home Page


 Modules to enhance Numerical Python

Here you can find links to some free software (open source) projects I have been working on. Most of the items are python-based as I have grown to love this wonderful language and its empowering Numerical extension.  The RPM's on this page are based on a python-numpy RPM which you can get from SourceForge

These extensions were developed under Linux but should work under any OS.  (Please let me know of incompatibilities you find.)
Shift-click on the links below to download the packages.  I also have some documentation for writing extension modules in C that use and interact with Numerical Python arrays and ufuncs.  It is available in gzipped PDF format or as gzipped LATEX.

If you find the material on this page useful and would like to encourage me to continue to develop these packages and make them freely available you can email me funds through PayPal (Oliphant.Travis@altavista.net) --- sign up costs nothing, in fact you get a $5 bonus for doing it, and I get a $5 referral bonus if you sign up through this link.
Make payments with PayPal - it's fast, free and secure! All of this software is free software. Contributions are strictly voluntary. PayPal is a FREE service for individuals.


RPMS (Packages for UNIX) of Numerical Python Release 15.2:

The rest of this is being moved into PyLab eventually...

Sparse matrix class for Numerical Python:

SparsePy 0.1 is a module that implements a sparse matrix class for Python. The attributes of the class are Numeric arrays and the methods are based on the included toolkits SPARSEKIT2 by Yousef Saad (in FORTRAN) and SuperLU (in C) by Xiaoye Li and Jim Demmel. Note: You need the BLAS library (in LAPACK at netlib or from your vendor) and a FORTRAN compiler to compile this package. (The binary for Linux just needs Python and NumPy).

Special Functions as ufuncs for Numerical Python:

Cephesmodule 1.3 is a module patterned after the umath module that comes with Numerical Python. It makes most of the special functions (like elliptic, and modified Bessel) from the cephes  and amos libraries available to python. The function can be evaluated (very quickly) on an arbitrary array of data and all of the broadcasting rules available for the standard functions also apply. All of the important functions in the library are implemented. See this page for a categorized, complete list and brief description of each function in the module.  Version 1.1 added the Amos library to the module so that Bessel functions can be evaluated with complex number arguments). I'm appreciative of Lorenzo Catucci who has contributed some enhancements to this module. Version 1.2 added a generalized map function called arraymap which implements the broadcasting rules of ufuncs. There is also a class that allows wrapping an arbitrary Python function with scalar inputs or outpus so that the wrapped function behaves like a ufunc (taking array arguments and returning array array arguments).

Download: (the RPM's are based on official Numeric Python RPMs from SourceForge.

Signal Processing Toolbox:

Signaltools 0.5.3  is a work in progress toolbox intended to contain most of the signal processing functionality available in other array-oriented systems like MATLAB.  Contributions of routines are welcome to this effort.  The vision is to have filter design techniques and signal/image/volume-processing procedures.  So far the included routines are fast N-D convolution and N-D correlation procedures for use when filtering big datasets with small kernels and a fast N-D order statistic filter routine. (A median filter is an example of an order-filter and is also included).  There is also a routine to filter along an arbitrary dimension of an N-D array with a rational transfer function filter (like the filter function in MATLAB) and a remez-exchange algorithm.  Recently added are an N-D median filter and an N-D wiener filter. If anyone has any general-purpose routines they would like to add (in compiled code or in Python) please let me know.

For this release I've also included the numpyio module discussed below for reading and writing large binary datasets directly into Numeric Python multiarrays.

Download:
Tarball:signaltools
i386 RPM:python-numpy-signaltools
SRPM:python-numpy-signaltools

Gaussian Quadrature:

quadrature.py is a module that allows one to perform Gaussian Quadrature (numerical integration) over a finite interval for arbitrary Python functions. It is based on another module that calculates the roots and quadrature weights for a large number of orthogonal polynomials for arbitrary order n. With the latter module, quadrature using a variety of weighting functions can be "manually" implemented. These functions depend on the cephes module and the latest MLab.py in Numerical Python.
 

Optimization Routines:

optimize.py is a module containing optimization algorithms written in pure Python. Currently it contains implementations of the Nelder-Mead simplex algorithm, the Broyden-Fletcher-Goldfarb-Shanno (BFGS) quasi-Newton algorithm, and a line-search conjugate-gradient Newton algorithm for minimizing a function of many variables.

Python wrappings of the FFTW libraries:

Fftw-numpy is a generic wrapping of the FFTW-2.1.3 C-library into Python done using SWIG. FFTW is advertised as a very fast implementation of the FFT and I believe it lives up to its billing. It has support for arbitrary N-dimensional arrays as well as fast real-to-complex FFT's.

As part of the package, I have included a module called FFT2 that can act as a drop-in replacement for FFT in NumPy (except there is no real-to-complex transform yet). There is also a benchmark script that shows that FFT2 is about 18-25% faster than fftpack (at least on pentium machines). There is also support for arbitrary multidimensional transforms (not just 2-D).

Download: (the RPM's are based on  my python-numpy distribution which can also be found at the SourceForge site)

Binary input and output in Numerical Python:

NumpyIO contains methods designed for reading and writing large blocks of binary data into Numerical Python arrays. This functionality is already available using the file manipulation functionality in Python itself and the fromstring method in the Numeric module. I didn't realize this at the time of writing the module. At any rate it was a good introduction to extending Python with NumPy and there are some benefits to the module: it doesn't require a copy of the data to be made on reading a writing (To convert from the "string" of bytes to the Numerical Python data), and you can read a large variety of datatypes from binary files into any of the Numerical Python array datatypes. There is also a handy packbits (and unpack) function included in the package that takes any NumPy array and treats it as a binary array (0 or non-zero) and packs the binary data into the bits of a NumPy array with "byte" datatype. A little esoteric but good for data compression on image and volume masks.

This package has been updated to fix some memory leaks and is now included with the signaltools package described above.

I have also created a class for reading and writing ANALYZE volume data based on this package (email me if you want it).


Thanks for stopping by. You can email me if you have any questions.


Included in the python_ring
Previous 5 Sites | Skip Previous | Previous | Next | Skip Next | Next 5 Sites | Random Site | List Sites