Exemple #1
0
    rows.append([source_name, source_id, ra_str, dec_str])

meta = OrderedDict()
meta['catalog_name'] = 'TeVCat'
meta['date'] = 'June 11, 2016'
meta['authors'] = 'Scott Wakely, Deirdre Horan'
meta['url'] = 'http://tevcat.uchicago.edu/'

names = ['source_name', 'source_id', 'ra_str', 'dec_str']
table = Table(rows=rows, names=names, meta=meta)

table['source_name'].description = 'Source canonical name'

table['source_id'].description = 'Source identification number'

table['ra'] = Angle(table['ra_str'], unit='hourangle').deg
table['ra'].unit = 'deg'
table['ra'].format = '%.5f'
table['ra'].description = 'Right Ascension (J2000)'
del table['ra_str']

table['dec'] = Angle(table['dec_str'], unit='deg').deg
table['dec'].unit = 'deg'
table['dec'].format = '%.5f'
table['dec'].description = 'Declination (J2000)'
del table['dec_str']

filename = 'tevcat.ecsv'
print('Writing', filename)
table.write(filename, format='ascii.ecsv')
Exemple #2
0
t2['Source_ID'] = t1['id']
t2['Source_ID'].description = 'Source ID'

t2['Source_Name'] = t1['TEV NAME']
t2['Source_Name'].description = 'Source name'

t2['Other_Names'] = t1['OTHER NAMES']
t2['Other_Names'].description = 'Other common names for the source (separated by "/" if multiple)'

t2['CLASS'] = t1['TYPE']
t2['CLASS'].description = 'Source class (separated by "/" if multiple)'

t2['RA'] = Angle(t1['RA (J2000)'], unit='hourangle').deg
t2['RA'].unit = 'deg'
t2['RA'].description = 'Right Ascension (J2000)'

t2['DEC'] = Angle(t1['Dec (J2000)'], unit='deg').deg
t2['DEC'].unit = 'deg'
t2['DEC'].description = 'Declination (J2000)'

t2['GLON'] = t1['LII(degrees)']
t2['GLON'].unit = 'deg'
t2['GLON'].description = 'Galactic longitude'

t2['GLAT'] = t1['BII(degrees)']
t2['GLAT'].unit = 'deg'
t2['GLAT'].description = 'Galactic latitude'

t2['RA_Err_Stat'] = [
    Angle(float(_) / 3600., unit='hourangle').deg for _ in t1['ErrRaStat[s]']