コード例 #1
0
    # print 'Vm : ', Vm[-1]
    # print 'm : ', m[-1]
    # print 'h : ', h[-1]
    # print 'n : ', n[-1]
    # print 'a : ', a[-1]
    # print 'b : ', b[-1]

    return Vm, I

##############################################################################################
## main program
##############################################################################################

if __name__ == "__main__":
    # Set global matplotlib parameters.
    lplot.set_rc_param()

    ## set parameters
    p = set_parameters()

    ## simulate
    Vm, I = simulate(p)

    print "plotting original signal"
    plt.figure(figsize=lplot.size_common)
    ax = plt.gca()
    lplot.nice_axes(ax)
    ax.set_ylabel(r"Mem. Pot. \textbf{[\si{\milli\volt}]}")
    ax.set_xlabel(r"Time \textbf{[\si{\milli\second}]}")
    plt.plot(p['time'], Vm, color=lcmaps.get_color(0))
    lplot.save_plt(plt, "cs_ap_original_signal", ".")
コード例 #2
0
    if dt is None:
        dt = data['dt']
    if data['dt'] != dt:
        raise ValueError("Mismatching simulations.")
    dt = data['dt']

# Collecting data from PC neurons.
LFPy_util.other.collect_data(dir_input, sim_sphere, gather_data)

sort_indices = np.argsort(neuron_names[:])
neuron_names = np.take(neuron_names, sort_indices)
widths_I = np.take(widths_I, sort_indices)
widths_II = np.take(widths_II, sort_indices)
amps_II = np.take(amps_II, sort_indices)

lplot.set_rc_param(True)
lplot.plot_format = ['pdf']

width_bins = np.arange(0, 2.5, dt)
ampli_bins = np.linspace(0,300,80)
bins = [ampli_bins, width_bins]

amp_width_hist = np.zeros([len(neuron_names), len(ampli_bins)-1, len(width_bins)-1])
for i in xrange(len(widths_I)):
    hist, _, _ = np.histogram2d(amps_II[i], widths_I[i], bins)
    hist = hist/float(hist.sum())
    amp_width_hist[i] = hist

for grp in groups:
    hist = np.zeros(amp_width_hist[0].shape)
    for i, name in enumerate(neuron_names):