Fwd: [Spice_discussion] Re: Spice_discussion Digest, Vol 39, Issue 2

K.-Michael Aye kmichael.aye at googlemail.com
Thu Dec 17 12:24:15 PST 2009


The SWIG stuff sounds promising,
but I agree with Tom that to avoid doubling
the exact same efforts, I would suggest to 
create a mini open source project for a
SWIG python wrapper to SPICE (if the NAIF
team has nothing against it?)
In which case I volunteer to set a project
up at the usual suspects (googlecode,
sourceforge) and invite anyone who wants 
to help to send me a private email. I certainly
could need some input from people who 
have already a working wrapper, I would/could 
work on a wrapper for Mac and Linux.

But I am also interested in how Adrian makes
'proper' Java calls to SPICE. Are you directly 
talking to the libraries somehow or are you
executing SPICE via system calls and then
catch the output for further processing (e.g.
for the mentioned exceptions)?
 
Michael


Sent from my iPhone
> 
> On 17.12.2009, at 08:54, Adrian Challinor <adrian.challinor at osiris.co.uk> wrote:
> 
>> Greetings 
>> 
>> SWIG will indeed do a job for you. However, it will simply create wrappers of the C code for Python. Note that the C code itself is a conversion of the original FORTRAN code in which SPICE was designed. Hence, you are essentially calling SPICE from PYTHON using Fortran conventions. 
>> 
>> I am doing much the same in JAVA, but instead of simply writing wrappers, I am building proper JAVA calls, using object orientated conventions. For example, SPICE errors are raised as JAVA Exceptions. It takes more time, but then I don't need all the SPICE function calls ! 
>> 
>> It should be possible to do a simpler job for PYTHON. 
>> 
>> 
>> Now waiting for a more powerful CPU from Father Christmas !
>> 
>> Adrian 
>> 
>> spice_discussion-request at naif.jpl.nasa.gov wrote:
>>> 
>>> Send Spice_discussion mailing list submissions to
>>> 	spice_discussion at naif.jpl.nasa.gov
>>> 
>>> To subscribe or unsubscribe via the World Wide Web, visit
>>> 	http://naif.jpl.nasa.gov/mailman/listinfo/spice_discussion
>>> or, via email, send a message with subject or body 'help' to
>>> 	spice_discussion-request at naif.jpl.nasa.gov
>>> 
>>> You can reach the person managing the list at
>>> 	spice_discussion-owner at naif.jpl.nasa.gov
>>> 
>>> When replying, please edit your Subject line so it is more specific
>>> than "Re: Contents of Spice_discussion digest..."
>>> 
>>> 
>>> Today's Topics:
>>> 
>>>    1. Python Interface (K.-Michael Aye)
>>>    2. Re: Python Interface (Bridgman, William T.)
>>>    3. Re: Python Interface (Acton, Charles H (343N))
>>>    4. Re: Python Interface (Bridgman, William T.)
>>>    5. RE: Python Interface (Reid, Michael R.)
>>> 
>>> 
>>> ----------------------------------------------------------------------
>>> 
>>> Message: 1
>>> Date: Wed, 16 Dec 2009 14:05:11 +0100
>>> From: "K.-Michael Aye" <kmichael.aye at googlemail.com>
>>> Subject: [Spice_discussion] Python Interface
>>> To: spice_discussion at naif.jpl.nasa.gov
>>> Message-ID: <2BC0B9AF-D78D-49F9-8380-06676A6EC91F at googlemail.com>
>>> Content-Type: text/plain; charset=windows-1252
>>> 
>>> 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!
>>> Michael
>>> 
>>> PS.:
>>> 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.)
>>>  
>>> 
>>> 
>>> 
>>> 
>>> ------------------------------
>>> 
>>> Message: 2
>>> Date: Wed, 16 Dec 2009 11:26:39 -0500
>>> From: "Bridgman, William T." <William.T.Bridgman at nasa.gov>
>>> Subject: Re: [Spice_discussion] Python Interface
>>> To: <spice_discussion at naif.jpl.nasa.gov>
>>> Message-ID: <7C73B940-EE49-4418-9EC4-7F3FB86E9D70 at nasa.gov>
>>> Content-Type: text/plain; charset="WINDOWS-1252"; format=flowed;
>>> 	delsp=yes
>>> 
>>> I have have been attempting to build a lightweight Python wrapper for  
>>> SPICE using SWIG.
>>> 
>>> I've got an interface file that seems to work but the compiler  
>>> settings have been elusive for building under MacOS X 10.5.  I had one  
>>> complete build that segfaults when I attempt to load the module.
>>> 
>>> I too am using this with a rendering system, using cgkit & RenderMan  
>>> (see http://svs.gsfc.nasa.gov/Gallery/NASAsHeliophysicsGallery.html, http://cgkit.sourceforge.net/users.html) 
>>> .
>>> 
>>> For other packages (CCMCs Derived, Tachyon renderer, etc.), I've  
>>> usually generated a minimal interface and then written a higher- 
>>> level .py file to design a more friendly interface.  I suspect one can  
>>> eventually integrate that into the .i file to build it directly in SWIG.
>>> 
>>> If anyone on the list is a little more familiar with SWIG and/or  
>>> compiler options, we might be able to collaborate on getting at least  
>>> a minimal wrapper to work.  Would that be useful?
>>> 
>>> Tom
>>> 
>>> 
>>> On Dec 16, 2009, at 8:05 AM, K.-Michael Aye wrote:
>>> 
>>>   
>>>> 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!
>>>> Michael
>>>> 
>>>> PS.:
>>>> 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
>>>> http://naif.jpl.nasa.gov/mailman/listinfo/spice_discussion
>>>>     
>>> 
>>> --
>>> Dr. William T."Tom" Bridgman               Scientific Visualization  
>>> Studio
>>> Global Science & Technology, Inc.          NASA/Goddard Space Flight  
>>> Center
>>> Email: William.T.Bridgman at nasa.gov         Code 610.3
>>> Phone: 301-286-1346                        Greenbelt, MD 20771
>>> FAX:   301-286-1634                        http://svs.gsfc.nasa.gov/
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> ------------------------------
>>> 
>>> Message: 3
>>> Date: Wed, 16 Dec 2009 08:47:45 -0800
>>> From: "Acton, Charles H (343N)" <charles.h.acton at jpl.nasa.gov>
>>> Subject: Re: [Spice_discussion] Python Interface
>>> To: spice_discussion <spice_discussion at naif.jpl.nasa.gov>
>>> Message-ID: <C74E4F31.174F7%Charles.H.Acton at jpl.nasa.gov>
>>> Content-Type: text/plain; charset="iso-8859-1"
>>> 
>>> On 12/16/09 5:05 AM, "K.-Michael Aye" <kmichael.aye at googlemail.com> wrote:
>>> 
>>> 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! ;)
>>> 
>>> 
>>> Dear SPICE Users--
>>> 
>>> Based on user requests, development of a Python interface to SPICE has been on the NAIF work list for some time. And funding specifically for this, as well as a JNI interface to SPICE, has been provided by NASA's Advanced Multi-Mission Operations System (AMMOS) program office.
>>> 
>>> NAIF's decision to build the JNI interface first, followed by the Python interface, was based on the relative number of requests for both of these capabilities.
>>> 
>>> The Alpha-test release of a very substantial JNI interface will become available to interested users in January. (If you'd like to participate in this testing and have not already advised NAIF of this, please do so now.)
>>> 
>>> While a good deal of work has already been accomplished on the Python interface, the continuation of this work will be limited in the near future because of more pressing demands on NAIF:  completion of an extension to the shape model subsystem that will add both a tessellated shape model and a digital elevation model capability; teaching two SPICE classes; and more.
>>> 
>>> There is a great deal of backlogged work awaiting the attention of NAIF; unfortunately the small size of the NAIF Team makes progress slow.
>>> 
>>> The NAIF Team is pleased there are many folks who have found SPICE helpful, and we are always happy to hear comments that can help guide our future work.
>>> 
>>> Charles Acton
>>> 
>>> 
>>> 
>>> -------------- next part --------------
>>> An HTML attachment was scrubbed...
>>> URL: http://naif.jpl.nasa.gov/pipermail/spice_discussion/attachments/20091216/8039f3c9/attachment-0001.html
>>> 
>>> ------------------------------
>>> 
>>> Message: 4
>>> Date: Wed, 16 Dec 2009 11:52:11 -0500
>>> From: "Bridgman, William T." <William.T.Bridgman at nasa.gov>
>>> Subject: Re: [Spice_discussion] Python Interface
>>> To: spice_discussion <spice_discussion at naif.jpl.nasa.gov>
>>> Message-ID: <C360366D-7CA1-487E-AF89-B47D9BB754D4 at nasa.gov>
>>> Content-Type: text/plain; charset="WINDOWS-1252"; format=flowed;
>>> 	delsp=yes
>>> 
>>> Would it be worthwhile to make the python interface a open source  
>>> project?
>>> 
>>> Tom
>>> On Dec 16, 2009, at 11:47 AM, Acton, Charles H (343N) wrote:
>>> 
>>>   
>>>> On 12/16/09 5:05 AM, "K.-Michael Aye" <kmichael.aye at googlemail.com>  
>>>> wrote:
>>>> 
>>>> 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! ;)
>>>> 
>>>> 
>>>> Dear SPICE Users--
>>>> 
>>>> Based on user requests, development of a Python interface to SPICE  
>>>> has been on the NAIF work list for some time. And funding  
>>>> specifically for this, as well as a JNI interface to SPICE, has been  
>>>> provided by NASA’s Advanced Multi-Mission Operations System (AMMOS)  
>>>> program office.
>>>> 
>>>> NAIF’s decision to build the JNI interface first, followed by the  
>>>> Python interface, was based on the relative number of requests for  
>>>> both of these capabilities.
>>>> 
>>>> The Alpha-test release of a very substantial JNI interface will  
>>>> become available to interested users in January. (If you’d like to  
>>>> participate in this testing and have not already advised NAIF of  
>>>> this, please do so now.)
>>>> 
>>>> While a good deal of work has already been accomplished on the  
>>>> Python interface, the continuation of this work will be limited in  
>>>> the near future because of more pressing demands on NAIF:   
>>>> completion of an extension to the shape model subsystem that will  
>>>> add both a tessellated shape model and a digital elevation model  
>>>> capability; teaching two SPICE classes; and more.
>>>> 
>>>> There is a great deal of backlogged work awaiting the attention of  
>>>> NAIF; unfortunately the small size of the NAIF Team makes progress  
>>>> slow.
>>>> 
>>>> The NAIF Team is pleased there are many folks who have found SPICE  
>>>> helpful, and we are always happy to hear comments that can help  
>>>> guide our future work.
>>>> 
>>>> Charles Acton
>>>> 
>>>> 
>>>> 
>>>> <ATT00001.txt>
>>>>     
>>> 
>>> --
>>> Dr. William T."Tom" Bridgman               Scientific Visualization  
>>> Studio
>>> Global Science & Technology, Inc.          NASA/Goddard Space Flight  
>>> Center
>>> Email: William.T.Bridgman at nasa.gov         Code 610.3
>>> Phone: 301-286-1346                        Greenbelt, MD 20771
>>> FAX:   301-286-1634                        http://svs.gsfc.nasa.gov/
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> ------------------------------
>>> 
>>> Message: 5
>>> Date: Wed, 16 Dec 2009 13:22:49 -0500
>>> From: "Reid, Michael R." <Mike.Reid at jhuapl.edu>
>>> Subject: RE: [Spice_discussion] Python Interface
>>> To: "spice_discussion at naif.jpl.nasa.gov"
>>> 	<spice_discussion at naif.jpl.nasa.gov>
>>> Message-ID:
>>> 	<329D879C76FDD04AAAE84BB1D89B397003725223D9 at aplesfreedom.dom1.jhuapl.edu>
>>> 	
>>> Content-Type: text/plain; charset="us-ascii"
>>> 
>>> 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!
>>> Michael
>>> 
>>> PS.:
>>> 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
>>> http://naif.jpl.nasa.gov/mailman/listinfo/spice_discussion
>>> 
>>> 
>>> 
>>> ------------------------------
>>> 
>>> _______________________________________________
>>> Spice_discussion mailing list
>>> Spice_discussion at naif.jpl.nasa.gov
>>> http://naif.jpl.nasa.gov/mailman/listinfo/spice_discussion
>>> 
>>> 
>>> End of Spice_discussion Digest, Vol 39, Issue 2
>>> ***********************************************
>>>   
>> _______________________________________________
>> Spice_discussion mailing list
>> Spice_discussion at naif.jpl.nasa.gov
>> http://naif.jpl.nasa.gov/mailman/listinfo/spice_discussion

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://naif.jpl.nasa.gov/pipermail/spice_discussion/attachments/20091217/a744388a/attachment-0001.html


More information about the Spice_discussion mailing list