(nside, theta, phi=None, nest=False, lonlat=False)
return res
Return the 8 nearest pixels.

    Parameters
    ----------
    nside : int
      the nside to work with
    theta, phi : scalar or array-like
      if phi is not given or None, theta is interpreted as pixel number,
      otherwise, theta[rad],phi[rad] are angular coordinates
    nest : bool
      if ``True``, pixel number will be NESTED ordering, otherwise RING ordering.
    lonlat : bool
      If True, input angles are assumed to be longitude and latitude in degree,
      otherwise, they are co-latitude and longitude in radians.

    Returns
    -------
    ipix : int, array
      pixel number of the SW, W, NW, N, NE, E, SE and S neighbours,
      shape is (8,) if input is scalar, otherwise shape is (8, N) if input is
      of length N. If a neighbor does not exist (it can be the case for W, N, E and S)
      the corresponding pixel number will be -1.

    See Also
    --------
    get_interp_weights, get_interp_val

    Examples
    --------
    >>> import healpy as hp
    >>> print(hp.get_all_neighbours(1, 4))
    [11  7  3 -1  0  5  8 -1]

    >>> print(hp.get_all_neighbours(1, np.pi/2, np.pi/2))
    [ 8  4  0 -1  1  6  9 -1]

    >>> print(hp.get_all_neighbours(1, 90, 0, lonlat=True))
    [ 8  4  0 -1  1  6  9 -1]
Return the 8 nearest pixels.
Return the 8 nearest pixels .
def get_all_neighbours(nside, theta, phi=None, nest=False, lonlat=False):
    """Return the 8 nearest pixels.

    Parameters
    ----------
    nside : int
      the nside to work with
    theta, phi : scalar or array-like
      if phi is not given or None, theta is interpreted as pixel number,
      otherwise, theta[rad],phi[rad] are angular coordinates
    nest : bool
      if ``True``, pixel number will be NESTED ordering, otherwise RING ordering.
    lonlat : bool
      If True, input angles are assumed to be longitude and latitude in degree,
      otherwise, they are co-latitude and longitude in radians.

    Returns
    -------
    ipix : int, array
      pixel number of the SW, W, NW, N, NE, E, SE and S neighbours,
      shape is (8,) if input is scalar, otherwise shape is (8, N) if input is
      of length N. If a neighbor does not exist (it can be the case for W, N, E and S)
      the corresponding pixel number will be -1.

    See Also
    --------
    get_interp_weights, get_interp_val

    Examples
    --------
    >>> import healpy as hp
    >>> print(hp.get_all_neighbours(1, 4))
    [11  7  3 -1  0  5  8 -1]

    >>> print(hp.get_all_neighbours(1, np.pi/2, np.pi/2))
    [ 8  4  0 -1  1  6  9 -1]

    >>> print(hp.get_all_neighbours(1, 90, 0, lonlat=True))
    [ 8  4  0 -1  1  6  9 -1]
    """
    check_nside(nside, nest=nest)
    if phi is not None:
        theta = ang2pix(nside, theta, phi, nest=nest, lonlat=lonlat)
    if nest:
        r = pixlib._get_neighbors_nest(nside, theta)
    else:
        r = pixlib._get_neighbors_ring(nside, theta)
    res = np.array(r[0:8])
    return res
def get_all_neighbours ( nside , theta , phi = None , nest = False , lonlat = False ) : check_nside ( nside , nest = nest ) if phi is not None : theta = ang2pix ( nside , theta , phi , nest = nest , lonlat = lonlat ) if nest : r = pixlib . _get_neighbors_nest ( nside , theta ) else : r = pixlib . _get_neighbors_ring ( nside , theta ) res = np . array ( r [ 0 : 8 ] ) return res