def make_dict_from_vector(in_array):
    """ Converts the cluster membership array stored in a fits file back to a dictionary

    Parameters
    ----------
    in_array : `np.ndarray' 
       An array filled with the index of the seed of a cluster if a source belongs to a cluster, 
       and with -1 if it does not.

    Returns
    -------
    returns dict(int:[int,...])  
       Dictionary of clusters keyed by the best source in each cluster
    """
    out_dict = {}
    for i, k in enumerate(in_array):
        if k < 0:
            continue
        try:
            out_dict[k].append(i)
        except KeyError:
            out_dict[k] = [i]
    return out_dict