#!/usr/bin/env python

print "Content-Type: text/plain;charset=utf-8\n"

import getopt, sys, urllib, time

def main():
	status = 0

# input arguments
	try:
		opts, args = getopt.getopt(sys.argv[1:],"h:iq",["help","invid=","quarter="])
	except getopt.GetoptError:
		usage()
		tree = False
		
	for o, a in opts:
		if o in ("-h", "--help"):
			usage()
		if o in ("-i", "--invid"):
			invid = str(a)
		if o in ("-q", "--quarter"):
			quarter = int(a)

	#kepid, invid, kepmag, mode, start, stop, release = GetMetaData(invid,quarter)

def usage():

  print ' -------------------------------------------------------------------------'
  print ' Martin Still (martin.d.still@nasa.gov) NASA Ames Nov 11, 2009'
  print ' '
  print ' Find all quarter data associated with an investigation ID within the MAST'
  print ' archive.'
  print ' '
  print ' Typical usage:'
  print ' KepInvestigationAtMAST.py --invid=GO10003 --quarter=1'
  print ' '
  print ' --invid  Investigation ID number of GO program'
  print ' --quarter  Kepler quarter (integer number)'
  print ' -------------------------------------------------------------------------'
  sys.exit(' ')

#-------------------------------
if __name__ == "__main__":
	main()
