[Spice_discussion] Python Interface

Reid, Michael R. Mike.Reid at jhuapl.edu
Wed Dec 16 10:22:49 PST 2009

Hi Michael,

I agree with you. Python is an excellent language for many of the kinds of applications in which one might use SPICE. I use Python extensively.

It is possible to import cspice functions into Python programs using SWIG (http://www.swig.org/) and the Python distutils. Basically, you bind the SPICE functions into a shared object and effectively extend the language. I've done it successfully with individual SPICE functions on a Linux system. I haven't tried it on other platforms.

A true Python interface to SPICE as you suggest would be far better, but SWIG does work. Since NAIF apparently doesn't have the funding to create a true Python interface right now, SWIG might provide you with a workable, albeit somewhat cumbersome, way to use SPICE from within Python.

Good luck with this,

Mike Reid

-----Original Message-----
From: spice_discussion-bounces at naif.jpl.nasa.gov [mailto:spice_discussion-bounces at naif.jpl.nasa.gov] On Behalf Of K.-Michael Aye
Sent: Wednesday, December 16, 2009 8:05 AM
To: spice_discussion at naif.jpl.nasa.gov
Subject: [Spice_discussion] Python Interface

Dear all,

I would like to renew my call for a Python interface for SPICE, and I think, this time, I even have very good arguments! ;)

The available software libraries for doing scientific data analysis with Python are quite complete, I would say.
The libraries numpy and scipy (http://www.scipy.org/) bring fast-processable multi-dimensional data arrays (numpy) and a huge set of scientific libraries (scipy) for
	* Astronomy
	* Artificial intelligence & machine learning
	* Bayesian Statistics
	* Biology (including Neuroscience)
	* Dynamical systems
	* Economics and Econometrics
	* Electromagnetics
	* Geosciences
	* Molecular modeling
	* Signal processing
	* Symbolic math, number theory, etc.

Via the GDAL library (a translator library for raster geospatial data formats), I have access to basically all data formats that can be worked with in a GIS-way, e.g. currently I am working with gigabyte-sized HiRISE data cubes, that have been produced with the ISIS environment.

Additionally, the super-easy to use Visual Python library (http://vpython.org/) makes it very easy, for example, to visualize the progress of a simulation environment, or to design a maybe complex geological (or optical) situation in a planetary observation, that then can be looked at, interactively, from all sides to understand the available data.

So, with all these free and openly available tools to work with Python on solar system science data, there is now only one little, but important thing missing, and that is SPICE. 
Imagine how easy it would be, to render 3-D results out of SPICE into an interactive controllable 3-D scene with VPython? Any complex set of reference systems of scientific instruments could be built into VPython to help for operation and observation planning.

Additionally, the combinatorial ways of GIS processing make this way of planetary data processing increasingly popular. The addition of SPICE calculations as another dimension into a GIS data cube would only benefit these kind of analyses.

I don't have anything against Java personally, but I strongly doubt, that it has such a good position in terms of what SPICE is made for: "to assist in planning and interpreting scientific observations from space-based instruments."
Therefore, I quite don't see, how it makes sense to give the same amount of attention to a Java and a Python interface to SPICE by an understaffed NAIF team. 

What's your and the readers' opinion, don't I sound convincing? ;)

Best regards, happy holidays and a happy new year!

I was shocked, by the way, by Charles' message that his funding was cut or not extended. Charles, I don't know if that would help you, but maybe I can make some noise in the European labs about your situation? Maybe we could put together a letter of appreciation of the European planetary scientists working with SPICE? Let me know, if you would appreciate these kind of activities or not.)

Spice_discussion mailing list
Spice_discussion at naif.jpl.nasa.gov

More information about the Spice_discussion mailing list