def obslog(year=None): """ NAME: obslog PURPOSE: read the observation summary up to a certain year INPUT: year= read up to this year (None) OUTPUT: observation log HISTORY: 2013-11-04 - Written - Bovy (IAS) """ obslogfilename= path.obslogPath(year=year) if not os.path.exists(obslogfilename): download.obslog(year=year) genfromtxtKwargs= {'delimiter':'|', 'dtype':[('Fieldname','S14'), ('LocID','int'), ('ra','float'), ('dec','float'), ('Plate','int'), ('A_ver','S14'), ('DrilledHA','float'), ('HDB','int'), ('NObs_Plan','int'), ('NObs_Done','int'), ('NObs_Ver_Plan','int'), ('NObs_Ver_Done','int'), ('Total_SN','float'), ('Red_SN','float'), ('ManPriority','int'), ('Priority','float'), ('Time','float'), ('Shared','int'), ('Stars','int'), ('At_APO','int'), ('Reduction','int'), ('ObsHistory','S50'), ('UNKNOWN','S50'), ('UNKNOWN1','int'), ('UNKNOWN2','int'), ('ReductionHistory','S50')], 'skip_footer':1} if int(numpy.__version__.split('.')[0]) < 1 \ or int(numpy.__version__.split('.')[1]) < 10: genfromtxtKwargs['skiprows']= 2 else: genfromtxtKwargs['skip_header']= 2 obslogtxt= numpy.genfromtxt(obslogfilename,**genfromtxtKwargs) return obslogtxt
def obslog(year=None): """ NAME: obslog PURPOSE: read the observation summary up to a certain year INPUT: year= read up to this year (None) OUTPUT: observation log HISTORY: 2013-11-04 - Written - Bovy (IAS) """ obslogfilename= path.obslogPath(year=year) if not os.path.exists(obslogfilename): download.obslog(year=year) obslogtxt= numpy.genfromtxt(obslogfilename,skiprows=2,delimiter='|', dtype=[('Fieldname','S14'), ('LocID','int'), ('ra','float'), ('dec','float'), ('Plate','int'), ('A_ver','S14'), ('DrilledHA','float'), ('HDB','int'), ('NObs_Plan','int'), ('NObs_Done','int'), ('NObs_Ver_Plan','int'), ('NObs_Ver_Done','int'), ('Total_SN','float'), ('Red_SN','float'), ('ManPriority','int'), ('Priority','float'), ('Time','float'), ('Shared','int'), ('Stars','int'), ('At_APO','int'), ('Reduction','int'), ('ObsHistory','S50'), ('UNKNOWN','S50'), ('UNKNOWN1','int'), ('UNKNOWN2','int'), ('ReductionHistory','S50')], skip_footer=1) return obslogtxt
def obslog(year=None): """ NAME: obslog PURPOSE: read the observation summary up to a certain year INPUT: year= read up to this year (None) OUTPUT: observation log HISTORY: 2013-11-04 - Written - Bovy (IAS) """ obslogfilename= path.obslogPath(year=year) obslogtxt= numpy.genfromtxt(obslogfilename,skiprows=2,delimiter='|', dtype=[('Fieldname','S14'), ('LocID','int'), ('ra','float'), ('dec','float'), ('Plate','int'), ('A_ver','S14'), ('DrilledHA','float'), ('HDB','int'), ('NObs_Plan','int'), ('NObs_Done','int'), ('NObs_Ver_Plan','int'), ('NObs_Ver_Done','int'), ('Total_SN','float'), ('Red_SN','float'), ('ManPriority','int'), ('Priority','float'), ('Time','float'), ('Shared','int'), ('Stars','int'), ('At_APO','int'), ('Reduction','int'), ('ObsHistory','S50'), ('UNKNOWN','S50'), ('UNKNOWN1','int'), ('UNKNOWN2','int'), ('ReductionHistory','S50')], skip_footer=1) return obslogtxt
def obslog(year=None): """ NAME: obslog PURPOSE: download the observation log INPUT: year= observation log up to this year (None) OUTPUT: (none; just downloads) HISTORY: 2015-05-01 - Written - Bovy (IAS) """ # First make sure the file doesn't exist filePath= path.obslogPath(year=year) if os.path.exists(filePath): return None # Create the file path downloadPath= \ filePath.replace(os.path.dirname(filePath), 'https://zenodo.org/record/17300/files') _download_file(downloadPath,filePath,None) return None
def obslog(year=None): """ NAME: obslog PURPOSE: download the observation log INPUT: year= observation log up to this year (None) OUTPUT: (none; just downloads) HISTORY: 2015-05-01 - Written - Bovy (IAS) """ # First make sure the file doesn't exist filePath = path.obslogPath(year=year) if os.path.exists(filePath): return None # Create the file path downloadPath= \ filePath.replace(os.path.dirname(filePath), 'https://zenodo.org/record/17300/files') _download_file(downloadPath, filePath, None) return None