Skip to content

Instantly share code, notes, and snippets.

@low-sky
Created August 4, 2015 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save low-sky/01000ab550ebf88ab3a8 to your computer and use it in GitHub Desktop.
Save low-sky/01000ab550ebf88ab3a8 to your computer and use it in GitHub Desktop.
Python snipped for BtP table join.
from astropy.table import Table,join,Column,unique
import numpy as np
t = Table.read('btp-all-fixed_angular-ipac-v12_2_c_4.tbl',format='ipac')
t = unique(t,keys='Galaxy')
t2 = Table.read('gal_base.fits')
c = Column(np.char.strip(np.array(t2['NAME'])),name='Galaxy')
t2.add_column(c)
t3 = join(t,t2,keys='Galaxy',join_type='inner')
t3.write('btp_full.fits',format='fits')
t4 = t3['Galaxy','INCL_DEG','POSANG_DEG']
t4.write('btp_params.tbl',format='ipac')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment