Esempio n. 1
0
def galah(dr=1):
    """
    NAME:
       galah
    PURPOSE:
       Load the GALAH data
    INPUT:
       dr= (1) data release
    OUTPUT:
       data table
    HISTORY:
       2016-09-12 - Written - Bovy (UofT)
    """
    filePath, ReadMePath= path.galahPath(dr=dr)
    if not os.path.exists(filePath):
        download.galah(dr=dr)
    data= astropy.io.ascii.read(filePath,readme=ReadMePath)
    data['RA']._fill_value= numpy.array([-9999.99])
    data['dec']._fill_value= numpy.array([-9999.99])
    return data
Esempio n. 2
0
def galah(dr=2, xmatch=None, **kwargs):
    """
    NAME:
       galah
    PURPOSE:
       Load the GALAH data
    INPUT:
       dr= (2) data release
       xmatch= (None) if set, cross-match against a Vizier catalog (e.g., vizier:I/345/gaia2 for Gaia DR2) using gaia_tools.xmatch.cds and return the overlap
       +gaia_tools.xmatch.cds keywords
    OUTPUT:
       data table[,xmatched table]
    HISTORY:
       2016-09-12 - Written - Bovy (UofT)
       2018-04-19 - Updated for DR2 - Bovy (UofT)
       2018-05-08 - Add xmatch - Bovy (UofT)
    """
    if dr == 1 or dr == '1':
        filePath, ReadMePath = path.galahPath(dr=dr)
    else:
        filePath = path.galahPath(dr=dr)
    if not os.path.exists(filePath):
        download.galah(dr=dr)
    if dr == 1 or dr == '1':
        data = astropy.io.ascii.read(filePath, readme=ReadMePath)
        data['RA']._fill_value = numpy.array([-9999.99])
        data['dec']._fill_value = numpy.array([-9999.99])
    else:
        data = fitsread(filePath, 1)
    if not xmatch is None:
        if dr == 1 or dr == '1':
            kwargs['colRA'] = kwargs.get('colRA', 'RA')
            kwargs['colDec'] = kwargs.get('colDec', 'dec')
        else:
            kwargs['colRA'] = kwargs.pop('colRA', 'raj2000')
            kwargs['colDec'] = kwargs.pop('colDec', 'dej2000')
        ma, mai = _xmatch_cds(data, xmatch, filePath, **kwargs)
        return (data[mai], ma)
    else:
        return data