Example #1
0
def gaiarv(dr=2,verbose=True):
    filePaths= path.gaiarvPath(dr=dr,format='fits')
    csvFilePaths= path.gaiarvPath(dr=dr,format='csv')
    for filePath, csvFilePath in zip(filePaths,csvFilePaths):
        if os.path.exists(filePath): continue
        try:
            os.makedirs(os.path.dirname(filePath)) 
        except OSError: pass
        downloadPath= csvFilePath.replace(path._GAIA_TOOLS_DATA.rstrip('/'),
                                       'http://cdn.gea.esac.esa.int')
        _download_file(downloadPath,csvFilePath,verbose=verbose)
        data= ascii.read(csvFilePath,format='csv')
        data.write(filePath,format='fits')
    return None    
Example #2
0
def gaiarv(dr=2):
    """
    NAME:
       gaiarv
    PURPOSE:
       Load the RV subset of the Gaia data
    INPUT:
       dr= (2) data release
    OUTPUT:
       data table
    HISTORY:
       2018-04-25 - Written for DR2 - Bovy (UofT)
    """
    filePaths = path.gaiarvPath(dr=dr, format='fits')
    if not numpy.all([os.path.exists(filePath) for filePath in filePaths]):
        download.gaiarv(dr=dr)
    return numpy.lib.recfunctions.stack_arrays(\
        [fitsread(filePath,ext=1) for filePath in filePaths],
        autoconvert=True)