link to MAST page MAST star image
MAST STScI
Tools
Tutorial Site Search
FAQ
High-Level Science Products
Software
FITS
Archive Manual
Related Sites
NASA Datacenters
MAST Services
MAST and the VO
Newsletters & Reports
Data Use Policy
Dataset Identifiers
Acknowledgments
 
link to STScI page


Sample Python Scripts

  1. 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!


Last Modified: Jan 09, 2007 15:27