def hp_is_nest(hp_header):
    """Return True if the healpix header is in nested

    Parameters
    ----------
    hp_header : :class:`~astropy.io.fits.header.Header`
        the header

    Returns
    -------
    boolean :
        True if the header is nested
    """
    ordering = hp_header.get('ORDERING', None)
    if not ordering:
        raise ValueError('Np ordering in healpix header')
    if ordering.lower() in ['nested', 'nest']:
        return True
    elif ordering.lower() == 'ring':
        return False
    else:
        raise ValueError('Unknown ordering in healpix header')
