def METHOD_NAME(tan, nside=None, topscale=256.):
    '''
    tan: TanWCS database object.
    '''
    from astrometry.util.starutil_numpy import degrees_between
    if nside is None:
        # print 'Pixscale', tan.get_pixscale()
        nside = 2 ** int(np.round(np.log2(topscale / tan.get_pixscale())))
        # print 'Nside', nside
        nside = int(np.clip(nside, 1, 2**10))
        # print 'Nside', nside
    r1,d1 = healpix_to_radecdeg(0, nside, 0., 0.)
    r2,d2 = healpix_to_radecdeg(0, nside, 0.5, 0.5)
    hpradius = degrees_between(r1,d1, r2,d2)
    # HACK -- padding for squished parallelograms
    hpradius *= 1.5
    r,d,radius = tan.get_center_radecradius()
    radius = np.hypot(radius, hpradius)
    hh = healpix_rangesearch_radec(r, d, radius, nside)
    hh.sort()
    #print 'Healpixes:', hh
    return (nside, hh)