예제 #1
0
def synapse_lifetime_distribution_loglog_linbin(ax,
                                                tr,
                                                crun='run_00000000',
                                                bin_w=10.,
                                                discard_t=0.):
    ''' 
    discard all values until discard_t
    '''
    if discard_t != 0.:
        raise NotImplementedError
    else:
        print("not discarding any ts")

    if not len(tr.crun.turnover) == 0:

        _lt, _dt = extract_lifetimes(tr.crun.turnover, tr.N_e)
        life_t, death_t = _lt * second, _dt * second

        counts, edges = np.histogram(life_t / ms,
                                     bins=np.arange(tr.dt / ms, tr.T / ms,
                                                    bin_w))
        centers = (edges[:-1] + edges[1:]) / 2.
        ax.plot(centers, counts, '.', markersize=0.5)

    ax.set_xscale('log')
    ax.set_yscale('log')
    ax.set_title('Lifetime distribution')
    ax.set_xlabel('time [ms]')
예제 #2
0
def synapse_lifetime_distribution_loglin(ax,
                                         tr,
                                         crun='run_00000000',
                                         bins=50,
                                         discard_t=0.):
    ''' 
    discard all values until discard_t
    '''
    if discard_t != 0.:
        raise NotImplementedError

    if not len(tr.crun.turnover) == 0:
        _lt, _dt = extract_lifetimes(tr.crun.turnover, tr.N_e)
        life_t, death_t = _lt * second, _dt * second

        if len(life_t) == 0:
            print("No recorded lifetimes. Not plotting.")
            ax.set_title("No recorded lifetimes")
        else:
            b_min, b_max = tr.dt / ms, np.max(life_t / ms)
            bins = np.linspace(np.log10(b_min), np.log10(b_max), bins)
            ax.hist(life_t / ms, 10**bins, normed=False, histtype='step')
            ax.set_title('Lifetime distribution')
            ax.set_xlabel('time [ms]')
            ax.set_xscale('log')
            ax.set_xlim(b_min, b_max)
예제 #3
0
def synapse_deathtime_distribution(ax, tr, crun, discard_t=0.):
    ''' 
    discard all values until discard_t
    '''
    if discard_t != 0.:
        raise NotImplementedError

    if not len(tr.crun.turnover) == 0:
        _lt, _dt = extract_lifetimes(tr.crun.turnover, tr.N_e)
        life_t, death_t = _lt * second, _dt * second
        ax.hist(death_t / ms)

    ax.set_title('Deathtime distribution')
    ax.set_xlabel('time [ms]')