[AstroPy] Table join with fits tables (or something else)

Hans Moritz Guenther moritz.guenther at gmx.de
Sat Dec 3 13:24:29 EST 2011


Hi,

how big are your tables?

I had a similar problem and I have extended atpy (atpy.github.com) to do 
it. atpy handles all the input and output, thus any format that is 
supported by atpy should work.

Joining tables works fine for <1e5 entries in your tables but becomes a 
bit slow for larger sets.

See: https://github.com/hamogu/atpy-extensions

It's called a catalog, because I had join with cross-matching of
sources in different catalogs in mind, but any other field is possible:

e.g. to join catalogs according to the field "name":

import catalog

def match_source_name(self, pos, data):
         return np.where(self['name'] == pos)[0]

mycatalog1 = catalog.BaseCatalog('myfile1.fits')
mycatalog2 = catalog.BaseCatalog('myfile2.fits')
mycatalog1.match_source = match_source_name

mycatalog1.add_catalog(mycatalog2, auto_add_columns = True)


However, documentation is not quite done, because I decided to publish 
that modul once the astropy table format is defined (and I will change 
it use the astropy table format instead of atpy).
If you want to use it, feel free to send my some more details and I'll 
make an example that works for you. I would welcome that as a test for 
this module.

Moritz




More information about the AstroPy mailing list