[PYTHON MATRIX-SIG] NASA Research Announcement - Astrophysics Data Program

Johann Hibschman johann@physics.berkeley.edu
Thu, 6 Mar 1997 14:00:24 -0800 (PST)

On Thu, 6 Mar 1997, Paul Barrett wrote:

> Well, if you have read this far, the purpose of this message is to see
> who else in the Python community might be interested in collaborating
> on such a proposal and to request from the Python community any
> comments that they might have about our proposal.

If you want to get astronomers interested in python, you may want 
to wrap the PGPLOT libraries.  Someone just asked about that on 
comp.lang.python, and it started me thinking about how hard a task that 
would be.

All that has to be done, really, is to find a good way to pass variables
by reference through SWIG and to find a way to connect NumPy arrays to
SWIG pointers.  I have a feeling that I'm just missing something that lets
me pass variables by reference to SWIG, and just last night I coded a
quick function to take an array and return the SWIG string pointer
representation of its data.  However, for some reason the C-linking part
of SWIG on my workstation is not working now; I think I tweaked it so
heavily to get C++ to work that I broke something. 

In any case, it's something that's easily doable.  I've run out of 
disposable time for now, but I'll eventually get something that works.  
Once you get the C routines running, it is then trivial to write python 
code to give them a nice user interface.

On the down side, PGPLOT is still tied to FORTRAN, so it would be nice 
to encourage people to move to something else.  But, then again, having 
PGPLOT available in an easy form would encourage people to try the python 
system in the first place.  So, clearly, the answer is to get PGPLOT 
working to sucker people in, but then stop supporting it to get them to 
switch.  ;-)

Just free-associating...

- Johann

Johann Hibschman            | Grad student in Physics, lurking in Astronomy,
johann@physics.berkeley.edu | Probing Pulsar Pair Plasma Production Processes

MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org