def rave(dr=5, usecols=None): """ NAME: rave PURPOSE: Load the RAVE data INPUT: dr= (5) data release usecols= (sequence, optional) indices to read from RAVE data OUTPUT: data table HISTORY: 2016-09-12 - Written - Bovy (UofT) """ filePath, ReadMePath = path.ravePath(dr=dr) if not os.path.exists(filePath): download.rave(dr=dr) if dr == 4: data = astropy.io.ascii.read(filePath, readme=ReadMePath) elif dr == 5: if usecols: data = numpy.genfromtxt(filePath, delimiter=',', names=True, usecols=usecols) else: data = numpy.genfromtxt(filePath, delimiter=',', names=True) return data
def rave(dr=5,verbose=True): filePath, ReadMePath= path.ravePath(dr=dr) if os.path.exists(filePath): return None if dr == 4: vizier('III/272',filePath,ReadMePath, catalogname='ravedr4.dat',readmename='ReadMe') elif dr == 5: # Have to figure out what will happen tonight! _download_file(\ 'https://www.rave-survey.org/data/files/single?name=DR5/RAVE_DR5.csv.gz', filePath+'.gz',verbose=verbose) # gunzip the file try: subprocess.check_call(['gunzip', filePath+'.gz']) except subprocess.CalledProcessError: raise IOError('gunzipping the RAVE-DR5 catalog failed ...') return None
def rave(dr=5): """ NAME: rave PURPOSE: Load the RAVE data INPUT: dr= (5) data release OUTPUT: data table HISTORY: 2016-09-12 - Written - Bovy (UofT) """ filePath, ReadMePath= path.ravePath(dr=dr) if not os.path.exists(filePath): download.rave(dr=dr) if dr == 4: data= astropy.io.ascii.read(filePath,readme=ReadMePath) elif dr == 5: data= numpy.genfromtxt(filePath,delimiter=',',names=True) return data