Implementing Godiva2 with CDAT/Python
Encouraged by the success of
ServingGoogleMapsDataWithCDAT, I am looking at the possibility of re-implementing the
Godiva2 data browsing website using CDAT/Python as the back-end instead of GADS/Java. The intention is that any dataset that can be read in CDAT can be exposed through the Godiva2 interface (and hence browsed using Google Maps and Google Earth). The advantages of doing this include:
- The whole dynamic portion of the site could be implemented with a single Python script
- We can use all of the features of CDAT to handle awkward things like the time dimension
- It paves the way for doing some simple data analysis on the website: we can use CDAT functionality
- Easier for other people to install the software to create their own Godiva2 website (esp. the BADC, who do a lot of development with CDAT/Python).
Migrating from GADS/Java to CDAT/Python should not be too hard. It will mainly involve editing the site such that the dynamically-generated content (including HTML, XML and the pictures themselves) is generated using dynamic Python (e.g. Python scripts, Python Server Pages - PSP - or
Spyce) instead of Java Server Pages (JSP). We already know how to
serve Google Maps pictures using CDAT/Python.
Installation
Configuring Apache/mod_python
See the instructions for
ServingGoogleMapsDataWithCDAT. The only extra thing we need to do here is to set up mod_python to serve Python Server Pages (these are pages that mix static HTML with dynamic content from Python). In my setup (Apache2 on Debian Sarge with mod_python already installed) I edited
/etc/apache2/sites-enabled/000-default, adding the following lines in the
<VirtualHost *> section:
<Directory /var/www/godiva2cdat>
AddHandler mod_python .py .psp
PythonHandler mod_python.publisher | .py
PythonHandler mod_python.psp | .psp
PythonDebug On
</Directory>
This ensures that all files in the
/var/www/godiva2cdat directory with the extension
.py are executed as Python scripts and all files with the extension
.psp are executed as Python Server Pages.
Getting the source code
The source code is in the
ESSC SVN repository, as a branch of the Godiva2 code. Get it as follows:
cd /var/www/godiva2cdat
svn co svn://lovejoy.nerc-essc.ac.uk/dataservers/godiva2/branches/godiva2cdat .
No compilation of code is necessary.
--
JonBlower - 16 May 2006