def plotmatchdisthist(M, mas=True, nbins=100, doclf=True, color='b', **kwa):
import pylab as plt
if doclf:
plt.clf()
R = np.sqrt(M.dra_arcsec**2 + M.ddec_arcsec**2)
if mas:
R *= 1000.
rng = [0, M.rad*1000.]
else:
rng = [0, M.rad]
print 'Match distances: median', np.median(R), 'arcsec'
n,b,p = plt.hist(R, nbins, range=rng, histtype='step', color=color, **kwa)
if mas:
plt.xlabel('Match distance (mas)')
else:
plt.xlabel('Match distance (arcsec)')
plt.xlim(*rng)
return n,b,p
评论列表
文章目录