Professional Documents
Culture Documents
/usr/bin/env python
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)
return jd
def QuarterDates(quarter):
Qstart = [2454953.5,2454964.5,2454998.5]
Qstop = [2454962.5,2454997.5,2455100.5]
if (quarter < len(Qstart)):
return Qstart[quarter] - 10, Qstop[quarter] + 10
else:
message = 'No spacecraft roll dates recorded for quarter ' + str(quarter)
+ '.\n'
message += 'Find an updated script at http://keplergo.arc.nasa.gov'
sys.exit(message)
def GetMetaData(invid,quarter):
url = 'http://archive.stsci.edu/kepler/data_search/search.php?'
url += 'action=Search'
url += '&max_records=100000'
url += '&verb=3'
url += '&ktc_investigation_id=' + invid
url += '&ktc_target_type[]=LC'
url += '&ktc_target_type[]=SC'
url += '&outputformat=CSV'
lines = urllib.urlopen(url)
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()
Top of Page Copyright Email Questions or Suggestions Contacts Last Modified: Mar
16, 2010 14:29