Table of Contents

Class: stapMadrigalService stapMadrigalService.py

stapMadrigalService is the class that provides the Simple time access protocol service.

Like all my python cgi scripts, stapMadrigalService has the following structure: the entire cgi is contained in one class, with a main function at the end which serves simply to call the __init__ function of the class. This __init__ function is responsible for calling all other class methods. It is made up of a single try block, with the purpose of reporting all exceptions in well-formatted html to both the user and the administrator. The __init__ function first makes sure the pythonlib can be found. It then calls setScriptState to determine from any cgi arguments and cookies what the script is supposed to do.

This script serves to expose Madrigal to Virtual Observatories via the Simple Time Access Protocol, as described in http://www.mssl.ucl.ac.uk/~eca/stap.html.

The names of all form elements used by stapMadrigalService are listed below:

START: start time of the interval. This should be specified in IS0-8601 format, eg. 2006-02-08T00:00:00. Times are expressed in UTC.

END: end time of the interval, in the same format as START

FORMAT: See http://www.mssl.ucl.ac.uk/~eca/stap.html (optional)

INSTRUMENT_ID = ID of instrument to be retrieved (optional)

Change history:

Written by Bill Rideout Jul. 31, 2007

$Id: stapMadrigalService_stapMadrigalService.py.html 3304 2011-01-17 15:25:59Z brideout $

Methods   
__init__
createObjects
getRow
outputXml
setScriptState
  __init__ 
__init__ ( self )

__init__ run the entire stapMadrigalService script. All other functions are private and called by __init__.

Inputs: None

Returns: void

Affects: Ouputs cgi script simpleIsprint.

Exceptions: None.

  createObjects 
createObjects ( self )

Exceptions   
ValueError, 'Instrument %s not in Madrigal' %( self.INSTRUMENT_ID )
  getRow 
getRow (
        self,
        kinst,
        expStr,
        )

getRow returns one <TR>...</TR> row of data.

kinst - instrument id (int) of this experiment

expStr - string giving experiment day and name in form 2006-02-27<ExpName>

  outputXml 
outputXml ( self )

outputXml writes the results in the form of a Votable as specified in http://www.mssl.ucl.ac.uk/~eca/stap.html

  setScriptState 
setScriptState ( self )

Exceptions   
ValueError, 'END %s cannot be before START %s' %( self.END, self.START )

Table of Contents

This document was automatically generated on Fri May 30 15:25:47 2008 by HappyDoc version r1_5