def take_data(data, mask):
    """Selects correlation(difference) data at given masked indices.
    
    Parameters
    ----------
    data : tuple of ndarrays
        Data tuple as returned by `ccorr` and `acorr` functions
    mask : ndarray
        A boolean frame mask array 
    
    Returns
    -------
    out : tuple
        Same data structure as input data, but with all arrays in data masked
        with the provided mask array.
    """
    def _mask(i,data):
        if i !=1:
            data = data[...,mask,:] if data is not None else None
        return data
        
    return tuple((_mask(i,d) for (i,d) in enumerate(data)))