enterprise/signals/utils.py
def quant2ind(U):
    """
    Use quantization matrix to return slices of non-zero elements.

    :param U: quantization matrix

    :return: list of `slice`s for non-zero elements of U

    .. note:: This function assumes that the pulsar TOAs were sorted by time.

    """
    inds = []
    for cc, col in enumerate(U.T):
        epinds = np.flatnonzero(col)
        if epinds[-1] - epinds[0] + 1 != len(epinds):
            raise ValueError("ERROR: TOAs not sorted properly!")
        inds.append(slice(epinds[0], epinds[-1] + 1))
    return inds

    Use quantization matrix to return slices of non-zero elements.

    :param U: quantization matrix

    :return: list of `slice`s for non-zero elements of U

    .. note:: This function assumes that the pulsar TOAs were sorted by time.

    
Use quantization matrix to return slices of non-zero elements.
Use quantization matrix to return slices of non - zero elements .
def quant2ind(U):
    inds = []
    for cc, col in enumerate(U.T):
        epinds = np.flatnonzero(col)
        if epinds[-1] - epinds[0] + 1 != len(epinds):
            raise ValueError("ERROR: TOAs not sorted properly!")
        inds.append(slice(epinds[0], epinds[-1] + 1))
    return inds
def quant2ind ( U ) : inds = [ ] for cc , col in enumerate ( U . T ) : epinds = np . flatnonzero ( col ) if epinds [ - 1 ] - epinds [ 0 ] + 1 != len ( epinds ) : raise ValueError ( "ERROR: TOAs not sorted properly!" ) inds . append ( slice ( epinds [ 0 ] , epinds [ - 1 ] + 1 ) ) return inds
Use quantization matrix to return slices of non-zero elements.
Use quantization matrix to return slices of non - zero elements .
"""
    Use quantization matrix to return slices of non-zero elements.

    :param U: quantization matrix

    :return: list of `slice`s for non-zero elements of U

    .. note:: This function assumes that the pulsar TOAs were sorted by time.

    """
list of `slice`s for non-zero elements of U
note:: This function assumes that the pulsar TOAs were sorted by time.
list of ` slice ` s for non - zero elements of U note :: This function assumes that the pulsar TOAs were sorted by time .
U
None