def merge(data, skip=50, fraction=1.0):
    """Merge one every 'skip' clouds into a single emcee population,
    using the later 'fraction' of the run."""
    w, s, d = data.chains.shape
    start = int((1.0 - fraction) * s)
    total = int((s - start) / skip)
    return data.chains[:, start::skip, :].reshape((w * total, d))
