(nside, theta, phi=None, nest=False, lonlat=False)
return (p, w)
Return the 4 closest pixels on the two rings above and below the
    location and corresponding weights.
    Weights are provided for bilinear interpolation along latitude and longitude

    Parameters
    ----------
    nside : int
      the healpix nside
    theta, phi : float, scalar or array-like
      if phi is not given, theta is interpreted as pixel number,
      otherwise theta[rad],phi[rad] are angular coordinates
    nest : bool
      if ``True``, 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
    -------
    res : tuple of length 2
      contains pixel numbers in res[0] and weights in res[1].
      Usual numpy broadcasting rules apply.

    See Also
    --------
    get_interp_val, get_all_neighbours

    Examples
    --------
    Note that some of the test inputs below that are on pixel boundaries
    such as theta=pi/2, phi=pi/2, have a tiny value of 1e-15 added to them
    to make them reproducible on i386 machines using x87 floating point
    instruction set (see https://github.com/healpy/healpy/issues/528).

    >>> import healpy as hp
    >>> pix, weights = hp.get_interp_weights(1, 0)
    >>> print(pix)
    [0 1 4 5]
    >>> weights
    array([ 1.,  0.,  0.,  0.])

    >>> pix, weights = hp.get_interp_weights(1, 0, 0)
    >>> print(pix)
    [1 2 3 0]
    >>> weights
    array([ 0.25,  0.25,  0.25,  0.25])

    >>> pix, weights = hp.get_interp_weights(1, 0, 90, lonlat=True)
    >>> print(pix)
    [1 2 3 0]
    >>> weights
    array([ 0.25,  0.25,  0.25,  0.25])

    >>> pix, weights = hp.get_interp_weights(1, [0, np.pi/2 + 1e-15], 0)
    >>> print(pix)
    [[ 1  4]
     [ 2  5]
     [ 3 11]
     [ 0  8]]
    >>> np.testing.assert_allclose(
    ...     weights,
    ...     np.array([[ 0.25,  1.  ],
    ...               [ 0.25,  0.  ],
    ...               [ 0.25,  0.  ],
    ...               [ 0.25,  0.  ]]), rtol=0, atol=1e-14)
Return the 4 closest pixels on the two rings above and below the
    location and corresponding weights.
    Weights are provided for bilinear interpolation along latitude and longitude
Return the 4 closest pixels on the two rings above and below the location and corresponding weights . Weights are provided for bilinear interpolation along latitude and longitude
def get_interp_weights(nside, theta, phi=None, nest=False, lonlat=False):
    """Return the 4 closest pixels on the two rings above and below the
    location and corresponding weights.
    Weights are provided for bilinear interpolation along latitude and longitude

    Parameters
    ----------
    nside : int
      the healpix nside
    theta, phi : float, scalar or array-like
      if phi is not given, theta is interpreted as pixel number,
      otherwise theta[rad],phi[rad] are angular coordinates
    nest : bool
      if ``True``, 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
    -------
    res : tuple of length 2
      contains pixel numbers in res[0] and weights in res[1].
      Usual numpy broadcasting rules apply.

    See Also
    --------
    get_interp_val, get_all_neighbours

    Examples
    --------
    Note that some of the test inputs below that are on pixel boundaries
    such as theta=pi/2, phi=pi/2, have a tiny value of 1e-15 added to them
    to make them reproducible on i386 machines using x87 floating point
    instruction set (see https://github.com/healpy/healpy/issues/528).

    >>> import healpy as hp
    >>> pix, weights = hp.get_interp_weights(1, 0)
    >>> print(pix)
    [0 1 4 5]
    >>> weights
    array([ 1.,  0.,  0.,  0.])

    >>> pix, weights = hp.get_interp_weights(1, 0, 0)
    >>> print(pix)
    [1 2 3 0]
    >>> weights
    array([ 0.25,  0.25,  0.25,  0.25])

    >>> pix, weights = hp.get_interp_weights(1, 0, 90, lonlat=True)
    >>> print(pix)
    [1 2 3 0]
    >>> weights
    array([ 0.25,  0.25,  0.25,  0.25])

    >>> pix, weights = hp.get_interp_weights(1, [0, np.pi/2 + 1e-15], 0)
    >>> print(pix)
    [[ 1  4]
     [ 2  5]
     [ 3 11]
     [ 0  8]]
    >>> np.testing.assert_allclose(
    ...     weights,
    ...     np.array([[ 0.25,  1.  ],
    ...               [ 0.25,  0.  ],
    ...               [ 0.25,  0.  ],
    ...               [ 0.25,  0.  ]]), rtol=0, atol=1e-14)
    """
    check_nside(nside, nest=nest)
    if phi is None:
        theta, phi = pix2ang(nside, theta, nest=nest)
    elif lonlat:
        theta, phi = lonlat2thetaphi(theta, phi)
    if nest:
        r = pixlib._get_interpol_nest(nside, theta, phi)
    else:
        r = pixlib._get_interpol_ring(nside, theta, phi)
    p = np.array(r[0:4])
    w = np.array(r[4:8])
    return (p, w)
def get_interp_weights ( nside , theta , phi = None , nest = False , lonlat = False ) : check_nside ( nside , nest = nest ) if phi is None : theta , phi = pix2ang ( nside , theta , nest = nest ) elif lonlat : theta , phi = lonlat2thetaphi ( theta , phi ) if nest : r = pixlib . _get_interpol_nest ( nside , theta , phi ) else : r = pixlib . _get_interpol_ring ( nside , theta , phi ) p = np . array ( r [ 0 : 4 ] ) w = np . array ( r [ 4 : 8 ] ) return ( p , w )