In [1]:
import booq
In [2]:
%matplotlib inline
from matplotlib import pyplot as plt
from matplotlib import cm
import numpy
plt.rcParams['figure.figsize'] = (10.0, 5.0)
In [3]:
from booq.io import fits
cs82 = fits.open('data/cs82_luckSquare.fits')
svla = fits.open('data/vla_luckSquare.fits')
colsA = {'ra':'ALPHA_J2000','dec':'DELTA_J2000','id':'SE_ID'}
catA = cs82.read( columns=colsA.values())
colsB = {'ra':'RA','dec':'DEC','id':'Str82'}
catB = svla.read(columns=colsB.values())
from booq.table import ATable
A = ATable(catA.data).to_pandas()
B = ATable(catB.data).to_pandas()
In [4]:
A.info()
In [5]:
B.info()
In [6]:
from booq.coordinates.skycoords import skycoords
A_coord = skycoords(A.ALPHA_J2000.values, A.DELTA_J2000.values)
B_coord = skycoords(B.RA.values, B.DEC.values)
In [7]:
from booq.catalogs import xmatch
_Aidx,_Asep = xmatch.nn(A_coord,B_coord)
_Bidx,_Bsep = xmatch.nn(B_coord,A_coord)
import numpy
_sep = numpy.append(_Asep.arcsec,_Bsep.arcsec)
from booq.utils import stats
_sts = stats.basic(_sep)
from booq import utils
utils.pprint(_sts)
import seaborn
p = seaborn.distplot(_sep)
plt.show(p)
del _Aidx,_Asep,_Bidx,_Bsep,_sts,_sep
In [8]:
from astropy.units import Quantity
radius = Quantity(2,'arcsec')
In [9]:
from booq.catalogs import xmatch
match_A_gc_idx, match_B_gc_idx, match_gc_sep = xmatch.gc(A_coord, B_coord, radius)
In [10]:
from booq import utils
utils.pprint(utils.stats.basic(match_gc_sep.arcmin))
In [11]:
from booq.pipelines import xmatch_nn
reload(xmatch_nn)
df_matched_idx = xmatch_nn.select_pairs(match_A_gc_idx, match_B_gc_idx, match_gc_sep.arcmin)
df_matched_idx.describe(include='all')
Out[11]:
In [12]:
from booq.pipelines import xmatch_nn
reload(xmatch_nn)
df = matched_catalog = xmatch_nn.merge_catalogs(A, B, df_matched_idx, 'Str82')
In [13]:
df.describe(include='all')
Out[13]:
In [14]:
import booq
logging = booq.log.init(verbose=True,debug=True)
from booq.io import fits
cs82 = fits.open('data/cs82_luckSquare.fits')
svla = fits.open('data/vla_luckSquare.fits')
colsA = {'ra':'ALPHA_J2000','dec':'DELTA_J2000','id':'SE_ID'}
catA = cs82.read( columns=colsA.values())
colsB = {'ra':'RA','dec':'DEC','id':'Str82'}
catB = svla.read(columns=colsB.values())
from booq.table import ATable
A = ATable(catA.data).to_pandas()
B = ATable(catB.data).to_pandas()
In [15]:
from booq.pipelines import xmatch_nn
matched_catalog = xmatch_nn.xmatch(A,B,columns_A=colsA, columns_B=colsB, radius=2, method='gc')
In [16]:
matched_catalog.describe(include='all')
Out[16]:
In [ ]: