(nside, nest=False)
return is_nside_ok
Returns :const:`True` if nside is a valid nside parameter, :const:`False` otherwise.

    NSIDE needs to be a power of 2 only for nested ordering

    Parameters
    ----------
    nside : int, scalar or array-like
      integer value to be tested

    Returns
    -------
    ok : bool, scalar or array-like
      :const:`True` if given value is a valid nside, :const:`False` otherwise.

    Examples
    --------
    >>> import healpy as hp
    >>> hp.isnsideok(13, nest=True)
    False

    >>> hp.isnsideok(13, nest=False)
    True

    >>> hp.isnsideok(32)
    True

    >>> hp.isnsideok([1, 2, 3, 4, 8, 16], nest=True)
    array([ True,  True, False,  True,  True,  True], dtype=bool)
Returns :const:`True` if nside is a valid nside parameter, :const:`False` otherwise.
Returns : const : True if nside is a valid nside parameter : const : False otherwise .
def isnsideok(nside, nest=False):
    """Returns :const:`True` if nside is a valid nside parameter, :const:`False` otherwise.

    NSIDE needs to be a power of 2 only for nested ordering

    Parameters
    ----------
    nside : int, scalar or array-like
      integer value to be tested

    Returns
    -------
    ok : bool, scalar or array-like
      :const:`True` if given value is a valid nside, :const:`False` otherwise.

    Examples
    --------
    >>> import healpy as hp
    >>> hp.isnsideok(13, nest=True)
    False

    >>> hp.isnsideok(13, nest=False)
    True

    >>> hp.isnsideok(32)
    True

    >>> hp.isnsideok([1, 2, 3, 4, 8, 16], nest=True)
    array([ True,  True, False,  True,  True,  True], dtype=bool)
    """
    # we use standard bithacks from http://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2
    if hasattr(nside, "__len__"):
        if not isinstance(nside, np.ndarray):
            nside = np.asarray(nside)
        is_nside_ok = (
            (nside == nside.astype(int)) & (nside > 0) & (nside <= max_nside)
        )
        if nest:
            is_nside_ok &= (nside.astype(int) & (nside.astype(int) - 1)) == 0
    else:
        is_nside_ok = nside == int(nside) and 0 < nside <= max_nside
        if nest:
            is_nside_ok = is_nside_ok and (int(nside) & (int(nside) - 1)) == 0
    return is_nside_ok
def isnsideok ( nside , nest = False ) : # we use standard bithacks from http://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2 if hasattr ( nside , "__len__" ) : if not isinstance ( nside , np . ndarray ) : nside = np . asarray ( nside ) is_nside_ok = ( ( nside == nside . astype ( int ) ) & ( nside > 0 ) & ( nside <= max_nside ) ) if nest : is_nside_ok &= ( nside . astype ( int ) & ( nside . astype ( int ) - 1 ) ) == 0 else : is_nside_ok = nside == int ( nside ) and 0 < nside <= max_nside if nest : is_nside_ok = is_nside_ok and ( int ( nside ) & ( int ( nside ) - 1 ) ) == 0 return is_nside_ok