Now, as a very final step -- for the time being --, we cross-match some real data.
Two catalogs in optical are to be used, from CS82 and SDSS, both covering a small region at the very central region of the celestial equator: ~1 sq-degree of sky containing 200K+ sources each.
In [1]:
import booq
In [2]:
from booq.io import fits
reload(fits)
cs82 = fits.read('data/cs82.fits')
sdss = fits.read('data/sdss.fits')
In [3]:
cs82.info
In [4]:
sdss.info
In [5]:
colsA = {'ra':'RA','dec':'DEC','id':'OBJID'}
catA = cs82.load(columns=['OBJID','RA','DEC'])
In [6]:
colsB = {'id':'ObjID'}
catB = sdss.load(columns=['ObjID','ra','dec'])
In [7]:
from booq.table import aTable
A = aTable(catA.data).to_pandas()
In [8]:
from booq.table import aTable
B = aTable(catB.data).to_pandas()
In [9]:
from booq.pipelines import xmatch_nn
# X-match the catalogs
matched_catalog_parallel = xmatch_nn.xmatch(A, B, columns_A=colsA, columns_B=colsB, parallel_run=True)
In [10]:
from booq.pipelines import xmatch_nn
# X-match the catalogs
matched_catalog_serial = xmatch_nn.xmatch(A,B,columns_A=colsA, columns_B=colsB)
In [11]:
matched_catalog_parallel.equals(matched_catalog_serial)
Out[11]:
In [12]:
matched_catalog_parallel.describe()
Out[12]: