Run a cone search of the Gaia DR2.

def coneSearch(self, center, radius=3*u.arcmin, magnitudelimit=20):
        '''
        Run a cone search of the Gaia DR2.
        '''


        self.magnitudelimit = magnitudelimit

        # define a query for cone search surrounding this center
        conequery = """SELECT designation, ra, dec, j_m, h_m, ks_m, j_date FROM gaiadr1.tmass_original_valid WHERE CONTAINS(POINT('ICRS',ra,dec),CIRCLE('ICRS',{},{},{}))=1 and j_m < {}""".format(center.ra.deg, center.dec.deg, radius.to(u.deg).value, magnitudelimit)


        # run the query
        self.speak('querying 2MASS, centered on {} with radius {}, for J<{}'.format(center, radius, magnitudelimit))
        table = self.query(conequery)




        # create skycoord objects
        self.coordinates = coord.SkyCoord(  ra=table['ra'].data*u.deg,
                                        dec=table['dec'].data*u.deg,
                                        obstime=Time(table['j_date'].data, format='jd'))

        self.magnitudes = dict(         J=table['j_m'].data,
                                        H=table['h_m'].data,
                                        Ks=table['ks_m'].data)
        self.magnitude = self.magnitudes['J']