AstroGrid

Navigation
Log in


Forgot your password?
 
Document Actions

Using Astrogrid from Python

Requirements

In order to call the Astrogrid services from Python you only need a recent version of Python installed. Python versions 2.2 and greater come with all needed libraries but the latest version of Python is recommended (2.5 at the time of writing). If you use earlier versions, then search for the xmlrpc python library and install it. Look in Installing Python for pointers to how install Python and other additional packages.

The python scripts will communicate with the services using the workbench. You need then to have either the workbench or acr running.

About Python

There are excelent resources in the web for learning python (e.g. the Beginners Guide). The Space Telescope has a Tutorial on using Python for Interactive Data Analysis (pdf).

XML-RPC

XML-RPC s a simple specification for remote procedure calls (RPC) that uses HTTP as the transport protocol and an XML vocabulary as the message payload. It has become very popular because of its simplicity, and most languages now have standard or readily available XML-RPC implementations. This includes Python, which started bundling xmlrpclib in version 2.2.

Astrogrid Client Runtime

The Astrogrid Client Runtime (ACR) provides a XMLRPC interface to access the functions from Python. The functions available and their help is located in XMLRPC and ACR.

While XMLRPC provides a good bridge between python and the java ACR, it is not user friendly and even users who know python may feel unconfortable. For this reason a more pythonic interface to ACR is being written which hides the xmlrpc calls. Note that this is a wrap of common used XMLRPC calls packed together for easier use. These are specially useful when using python in interactive mode but requires Python 2.4 or greater installed. A tutorial and download links are available here.

Example command line tools written in python to perform basic operations are also available in the ACR download: http://www2.astrogrid.org/desktop/download/acr-interface-2007.1.1.zip