Python Alternative for Programming in Astrophysics

Documentation.

These informations are valid for the version 0.3Alpha

I supose that you have a Linux system.

Dependences

Before you install this package you need to have installed the Pygist module for the graphic, the numarray module and the GSL (Gnu Scientific Library).

You can download Pygist from the following page:

http://bonsai.ims.u-tokyo.ac.jp/~mdehoon/software/python/

You can download the Version 1.5.18 here because is the version that I use for the project. Please visit the page of Pygist anyway becase have many information on this good python module.

Note: Pygist depend on Numeric, an original vesion of numarray but incompatible with the new version (totally rewrited) download it from the souceforge project and install it too, the too packages are totally distinct.

Numarray is a very good package for make calculation with arrays in python You don't need to learn to use pygist for use the graphics tools of PAPA but you can't make without the numarray module, install this module and take a look at the documentation.

The home page of numarray is :

http://www.stsci.edu/resources/software_hardware/numarray

To install both, numarray and Numeric (Numpy) download these from the project page on Souceforge.

http://sourceforge.net/projects/numpy/

Note: Remember to install numarray with setupall.py (python setupall.py install) because it will install many usefull packages not installed in the normal installation

The GSL is a C library of numeric code, maybe, if you don't have it already installed, you can find it in some package of your Linux distribution. Anyway you can download it from this link:

http://www.gnu.org/software/gsl/

Note: Remember that you need to install the dev. package of gsl in order to compile the PAPA from souces.

Installation

First of all download the last relese from the sourceforge project page: http://sourceforge.net/projects/papa/ and extract it in a directory.

As a normal python package you can than install it with the command:

python setup.py install

If every thing goes well you will have 2 new modules in your python path: graIDL and numIDL.

Test the installation

Now that you have installed the package you can test it. At the interactive prompt of python give these commands:

>>> import numIDL as num
>>> from graIDL import gist

This is the tipical way to import the modules. The num module will now contain all the function of numarray so you don't need to import numarray and you can for example make a=num.array([1,2,3]).

If you want to make a graph with gist you have to create an instance of the class graIDL_gist, you can use for this aim the gist function:

>>> gr=gist()
>>> gr.plot([1,2,3])

You can now launch the demos of both packages. For a tutorial/demostration for graIDL type:

>>> gist.demo()

For numIDL, import the demo module:

>>> import numIDL.demo

Show the contents of the module:

>>> dir(numIDL.demo)

And run one of these functions:

interpolation(), linearfit(), polyfit(), gaussfit(), regression().

Now you can see at the source code of these function to see how thats works, to see were is the source in your system type:

print numIDL.demo.__file__

I hope you enjoy the demos, try to use these modules now for something more serious. Remember anyway that this version is an alpha version and you can find a lot of bugs. I'm sorry about that and if you want to help me, please, report the bugs.

Note on M$-Windows Operative Systems

Maybe the package work well under Windows too, because all the software can be port to this OS, but right now i never tested the package on this sistem, if you want to try, you're welcome and please report the problems and solution you will found.

Maurizio Panniello. Last update 13/2/2004
http://perso.wanadoo.es/maurix78
maurixrevolution(a)yahoo.com

Python Powered     SourceForge.net Logo

Visits since 20/2/2004:

Error!!