def galah(dr=1,verbose=True,spider=False): filePath, ReadMePath= path.galahPath(dr=dr) if os.path.exists(filePath): return None if dr == 1: _download_file(\ 'https://cloudstor.aarnet.edu.au/plus/index.php/s/OMc9QWGG1koAK2D/download?path=%2F&files=catalog.dat', filePath,verbose=verbose,spider=spider) _download_file(\ 'https://cloudstor.aarnet.edu.au/plus/index.php/s/OMc9QWGG1koAK2D/download?path=%2F&files=ReadMe', ReadMePath,verbose=verbose,spider=spider) return None
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
def galah(dr=2, verbose=True, spider=False): if dr == 1 or dr == '1': filePath, ReadMePath = path.galahPath(dr=dr) else: filePath = path.galahPath(dr=dr) if os.path.exists(filePath): return None if dr == 1: _download_file(\ 'https://cloudstor.aarnet.edu.au/plus/index.php/s/OMc9QWGG1koAK2D/download?path=%2F&files=catalog.dat', filePath,verbose=verbose,spider=spider) _download_file(\ 'https://cloudstor.aarnet.edu.au/plus/index.php/s/OMc9QWGG1koAK2D/download?path=%2F&files=ReadMe', ReadMePath,verbose=verbose,spider=spider) elif dr == 2 or dr == '2' or dr == 2.1 or dr == '2.1': # GALAH updated catalog May 10 2018; remove catalog downloaded before if os.path.exists(filePath.replace('DR2.1', 'DR2')): os.remove(filePath.replace('DR2.1', 'DR2')) _download_file(\ os.path.join('https://datacentral.aao.gov.au/teamdata/GALAH/public/', os.path.basename(filePath)), filePath,verbose=verbose,spider=spider) return None
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