download_image_files.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:lotss-catalogue 作者: mhardcastle 项目源码 文件源码
def get_wise(ra,dec,band):
    mission='wise'
    dataset='allwise'
    table='p3am_cdd'
    successful=False
    while not successful:
        try:
            results=Ibe.query_region(coord.SkyCoord(ra, dec, unit=(u.deg, u.deg), frame='icrs'),mission=mission,dataset=dataset,table=table)
            successful=True
        except requests.exceptions.ConnectionError:
            print 'Connection failed, retrying'
            sleep(10)

    url = 'http://irsa.ipac.caltech.edu/ibe/data/'+mission+'/'+dataset+'/'+table+'/'
    params = { 'coadd_id': results[results['band']==band]['coadd_id'][0],
           'band': band }
    params['coaddgrp'] = params['coadd_id'][:2]
    params['coadd_ra'] = params['coadd_id'][:4]
    path = str.format('{coaddgrp:s}/{coadd_ra:s}/{coadd_id:s}/{coadd_id:s}-w{band:1d}-int-3.fits',**params)
    outname=path.split('/')[-1]
    download_file(url+path,outname)
    return outname
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号