def collapse_walker_chain( walker_chain, nburn=0 ):
    """
    Takes emcee walker chains and collapses them into single
    chains, one for each parameter. An optional burn-in range
    from can be discarded from the beginning of each walker
    chain prior to combining them together.
    """
    if nburn==None:
        nburn = 0
    keys = walker_chain.keys()
    npar = len( keys )
    chain = {}
    for key in keys:
        chain[key] = walker_chain[key][nburn:,:].flatten()
    return chain