You are on page 1of 1

Sample Python Scripts

Search Pointings archive for ACS images more than 75 degrees from galactic plane
with < 5 exposures in U band AND more than 1 in I band, output as comma separated
list save results in file out_py.txt

#!/usr/local/bin/python

# change above line to point to local


# python executable

import urllib, urlparse, string, time

# create URL with desired search parameters

url = "http://archive.stsci.edu/pointings/search.php?"
url = url + "primary=ACS&outputformat=CSV"
url = url + "&pnt_ucountp=%3C5&pnt_icountp=%3E1&bao=and"
url = url + "&galactic=Above&galsearch=75"
url = url + "&action=Search+Exposures"

print url

# retrieve URL and write results to filename

filename = "out_py.txt"

urllib.urlretrieve(url,filename)

### Done!

Donated by Martin Still from the Kepler GO Office: Extracts metadata from the
Kepler archive. A shell command like this: KepInvestigationAtMAST.py --invid=STKL
--quarter=1 will list all quarter 1 data ingested so far from the KASC LC program.
One can use this in a cron job to monitor the incremental ingestion of GO data
after e

You might also like