frequenciesAll, maxFacilitationAll = simulate_steady_state_freq(numpy.arange(1.,100.,1.), 
                                                                    flag='max')

# Recovery spike
revoceryTimes, relativeRecovery = simulate_recovery(numpy.arange(100,5000,200))

# Steady state conductance 0-1 frequencies
frequenciesZoom, relativeFacilitationZoom = simulate_steady_state_freq(numpy.arange(0.1,1.,.1))

# DISPLAY
plot_settings.set_mode(mode='by_fontsize', w = 750.0, h = 400.0, fontsize=12)
font_size_text = 9
fig = pylab.figure( facecolor = 'w' )

ax_list = []
ax_list.append( MyAxes(fig, [ .1, .4, .18,  .26 ] ) )    # text box
ax_list.append( MyAxes(fig, [ .35, .6, .24, .34 ] ) )    # 
ax_list.append( MyAxes(fig, [ .73, .6, .24, .34 ] ) )    # 
ax_list.append( MyAxes(fig, [ .35, .1, .24, .34 ] ) )    # 
ax_list.append( MyAxes(fig, [ .73, .1, .24, .34 ] ) )    # 

# Text
ax=ax_list[0]
plot_text(ax)

# Example steady state all
ax=ax_list[1]
plot_steady_state_freq(ax, frequenciesAll, steadyStateFacilitationAll)

# Example steady state zoom
ax=ax_list[2]
                         save_result_at)
    else:
        print 'hej'
        #nbNeurons1, meanRates1, meanRatesStd1, info_string = misc.pickle_load(save_result_at)

    # DISPLAY
    plot_settings.set_mode(pylab,
                           mode='by_fontsize',
                           w=1100.0,
                           h=450.0,
                           fontsize=12)
    font_size_text = 8
    fig = pylab.figure(facecolor='w')

    ax_list = []
    ax_list.append(MyAxes(fig, [.075, .37, .135, .26]))  # text box
    ax_list.append(MyAxes(fig, [.26, .6, .165, .34]))  #
    ax_list.append(MyAxes(fig, [.53, .6, .165, .34]))  #
    ax_list.append(MyAxes(fig, [.26, .1, .165 * 2.312, .34]))  #
    ax_list.append(MyAxes(fig, [.8, .6, .165, .34]))  #
    #ax_list.append( MyAxes(fig, [ .53,  .1,  .165, .34 ] ) )    #
    ax_list.append(MyAxes(fig, [.8, .1, .165, .34]))  #

    # Text
    ax = ax_list[0]
    plot_text(ax, info_string)

    ax = ax_list[1]
    plot_example_raster_MSN(ax, MSN_spikes_and_ids)

    ax = ax_list[2]
Beispiel #3
0
                                           start_rec ) 
names=names[0:15]
model_params['conns'].update({'STN_SNR':{'syn':'STN_SNR_ampa_p3'}})
save_result_at=OUTPUT_PATH+'/simulate_sensitivity_STN_plast.plk'
d2, data_rate_change2, dp2, names2=simulate_sensitivity([1, 1], save_result_at,n_exp,
                                           params_msn_d1, params_msn_d2, params_stn,
                                           synapse_models, model_params, sim_time,
                                           start_rec )

 
 #Inspect results
plot_settings.set_mode(pylab, mode='by_fontsize', w = 1100.0, h = 450.0+275.0, fontsize=16)
font_size_text = 8
fig = pylab.figure( facecolor = 'w' )
ax_list = []
ax_list.append( MyAxes(fig, [ .075, .37, .135, .26 ] ) )    # text box
ax_list.append( MyAxes(fig, [ .26,  .7,  .4, .2 ] ) )    # 
#ax_list.append( MyAxes(fig, [ .53,  .7,  .165, .2 ] ) )    # 
#ax_list.append( MyAxes(fig, [ .8,   .7,  .165, .2 ] ) )    # 
ax_list.append( MyAxes(fig, [ .26,  .3,  .4, .2 ] ) )    #     
#ax_list.append( MyAxes(fig, [ .53,  .4,  .165, .2 ] ) )    # 
#ax_list.append( MyAxes(fig, [ .8,   .4,  .165, .2 ] ) )    # 
#ax_list.append( MyAxes(fig, [ .26,  .1,  .165, .2 ] ) )    #     
#ax_list.append( MyAxes(fig, [ .53,  .1,  .165, .2 ] ) )    # 
#ax_list.append( MyAxes(fig, [ .8,   .1,  .165, .2 ] ) )    # 


ax=ax_list[1]

plot_data(ax, data_rate_change[0], 'Static STN-SNr', names, show_label=False)
ax=ax_list[1]
Beispiel #4
0
my_nest.Connect(sgs, [MSN[0]], model=syn_model)  # connect MSNs
T = 2000  # simulation time
my_nest.Simulate(T)  # simulate

MSN.get_signal('v', 'V_m')

pylab.close('all')  # display
# Create figure where figsize(width,height) and figure dimenstions window
# width = figsize(width) x dpi and window hight = figsize(hight) x dpi
plot_settings.set_mode(mode='dynamic', w=700.0, h=400.0)
font_size_text = 10
fig = pylab.figure(facecolor='w')
pylab.suptitle('MSN to MSN')

ax_list = []
ax_list.append(MyAxes(fig, [.1, .37, .2, .26]))  # text box
ax_list.append(MyAxes(fig, [.50, .15, .40, .65]))  # voltage trace

ds = my_nest.GetDefaults(syn_model)
sn = my_nest.GetStatus(MSN[:])[0]

ax = ax_list[0]  # Text box
tb = ''
tb = tb + ' %6s %7s %3s \n' % ('Synapse model:', ds['synapsemodel'], ' ')
tb = tb + ' \n '
tb = tb + ' %6s %7s %3s \n' % ('Delay:', ds['delay'], 'ms')
tb = tb + ' %6s %7s %3s \n' % ('Weight:', ds['weight'], 'nS')
tb = tb + ' \n '
tb = tb + ' %6s %7s %3s \n' % ('Decay:', sn['GABAA_2_Tau_decay'], 'ms')
tb = tb + ' %6s %7s %3s \n' % ('E_rev:', sn['GABAA_2_E_rev'], 'mV')
#hzs=[0.1, 0.2, 0.4, 0.8, 1.6, 3.2, 6.4, 12.8, 25.6, 51.2]

hzs = range(1, 48, 5)
signal_rates = simulate_signal_rates(load=True, hzs=hzs)

# DISPLAY
plot_settings.set_mode(pylab,
                       mode='by_fontsize',
                       w=1100.0,
                       h=450.0,
                       fontsize=12)
font_size_text = 8
fig = pylab.figure(facecolor='w')

ax_list = []
ax_list.append(MyAxes(fig, [.075, .37, .135, .26]))  # text box
ax_list.append(MyAxes(fig, [.26, .6, .165, .34]))  #
#ax_list.append( MyAxes(fig, [ .53,  .6,  .165, .34 ] ) )    #
#ax_list.append( MyAxes(fig, [ .8,   .6,  .165, .34 ] ) )    #
#ax_list.append( MyAxes(fig, [ .26,  .1,  .165, .34 ] ) )    #
#ax_list.append( MyAxes(fig, [ .53,  .1,  .165, .34 ] ) )    #
# ax_list.append( MyAxes(fig, [ .8,   .1,  .165, .34 ] ) )    #

# Text
ax = ax_list[0]
plot_text(ax, info_string)

ax = ax_list[1]
plot_signal_rates(ax, hzs, signal_rates)

pylab.show()
sim_time=20000
  

save_at=OUTPUT_PATH+'/simulate_network_fmin.plk' 
x=fmin(0,save_at)
#x=[215, 0.08]

STN_target1, e1=restriction_1(gpe_rate, n_ctx, n_gpe, x, neuron_model, syn_models)
STN_target2, e2=restriction_2(gpe_rate, n_ctx, n_gpe, x, neuron_model, syn_models)
STN_target3 = GPE_46_hz(gpe_rate, n_ctx, n_gpe, x, neuron_model, syn_models)

plot_settings.set_mode(pylab, mode='by_fontsize', w = 500.0, h = 500.0, fontsize=8)
font_size_text = 8
fig = pylab.figure( facecolor = 'w')

ax_list=[]
ax_list.append( MyAxes(fig, [ .1, .7, .8, .2 ] ) )    # text box
ax_list.append( MyAxes(fig, [ .1, .4, .8, .2 ] ) )    # 
ax_list.append( MyAxes(fig, [ .1, .1, .8, .2 ] ) )    # 
 
ax=ax_list[0]
plot_example(ax, STN_target1,sim_time, x, type='No GPE')  

ax=ax_list[1]
plot_example(ax, STN_target2, sim_time, x, type='Normal')  

ax=ax_list[2]
plot_example(ax, STN_target3, sim_time, x, type='GPE rate at '+str(30*1.55))  
        
pylab.show()
STN_example_rebound_spike_5, s = simulate_example_rebound_spike([-70.],
                                                                time=300.)
STN_example_rebound_spike_6, s = simulate_example_rebound_spike([-100.],
                                                                time=300.)

# DISPLAY
plot_settings.set_mode(pylab,
                       mode='by_fontsize',
                       w=1100.0,
                       h=450.0,
                       fontsize=16)
font_size_text = 8
fig = pylab.figure(facecolor='w')

ax_list = []
ax_list.append(MyAxes(fig, [.075, .37, .135, .26]))  # text box
ax_list.append(MyAxes(fig, [.26, .6, .165, .34]))  #
ax_list.append(MyAxes(fig, [.53, .6, .165, .34]))  #
ax_list.append(MyAxes(fig, [.8, .6, .165, .075]))  #
ax_list.append(MyAxes(fig, [.26, .3, .165, .075]))  #
ax_list.append(MyAxes(fig, [.53, .3, .165, .075]))  #
ax_list.append(MyAxes(fig, [.8, .3, .165, .075]))  #
ax_list.append(MyAxes(fig, [.26, .1, .165, .075]))  #
ax_list.append(MyAxes(fig, [.53, .1, .165, .075]))  #
ax_list.append(MyAxes(fig, [.8, .1, .165, .075]))  #
# Text
ax = ax_list[0]
plot_text(ax, infoString)

# Example
#ax=ax_list[1]
    SNR_mean_rate.load_signal('s')
else:
    SNR_example_plot.get_signal('v', 'V_m', stop=simTime)
    SNR_mean_rate.get_signal('s', start=1, stop=simTime)

plot_settings.set_mode(mode='dynamic', w=1100.0, h=400.0)
font_size_text = 7
fig = pylab.figure(facecolor='w')
#fig = pylab.figure( figsize = ( 34, 12 ), dpi = 50, facecolor='w' )

nb_yticks_rp = 4  # number of ticks raster plots
nb_yticks_sr = 3  # number of ticks spike rate plots
binSize = 50  # spike rate bin

ax_list = []
ax_list.append(MyAxes(fig, [0.05, .37, .09, .26]))  # text box
ax_list.append(MyAxes(fig, [0.22, .6, .2, .3]))  # MSNs raster plot
ax_list.append(MyAxes(fig, [0.22, .12, .2, .3]))  # MSNs rates
ax_list.append(MyAxes(fig, [0.57, .87, .2, .05]))  # SNR trace plastic
ax_list.append(MyAxes(fig, [0.57, .81, .2, .05]))  # SNR trace static w
ax_list.append(MyAxes(fig, [0.57, .74, .2, .05]))  # SNR trace static s
ax_list.append(MyAxes(fig, [0.57, .67, .2, .05]))  # SNR trace static s
ax_list.append(MyAxes(fig, [0.57, .6, .2, .05]))  # SNR trace static s
ax_list.append(MyAxes(fig, [0.57, .12, .2, .3]))  # SNR rates
#for ax in ax_list: fig.add_axes(ax)

# Text
ax = ax_list[0]
my_nest.ResetKernel()
SNR = create_output_population(
    nOutput,
Beispiel #9
0
if 0:
    groups_dic=simulate_network(params_msn_d1, params_msn_d2, params_stn,
                           synapse_models, sim_time=sim_time, seed=1,
                           I_e_add={'SNR':300, 'STN':0,'GPE':30}, threads=4, 
                           start_rec=500.,model_params=model_params)    
    misc.pickle_save(groups_dic, save_result_at)  
else:
    groups_dic=misc.pickle_load(save_result_at)  
 
 #Inspect results
plot_settings.set_mode(pylab, mode='by_fontsize', w = 1100.0, h = 450.0+175.0, fontsize=12)
font_size_text = 8
fig = pylab.figure( facecolor = 'w' )
ax_list = []

ax_list.append( MyAxes(fig, [ .26-0.21,  .85-0.05, 0.2 + .165+0.05, .2 -0.05+0.02] ) )    # 
ax_list.append( MyAxes(fig, [ .80-.25,   .85-0.05, 0.2 + .165+0.05, .2-0.05 +0.02] ) )    # 
ax_list.append( MyAxes(fig, [ .26-0.21,  .65-0.04, 0.2 + .165+0.05, .2 -0.05+0.02] ) )    # 
ax_list.append( MyAxes(fig, [ .80-.25,   .65-0.04, 0.2 + .165+0.05, .2 -0.05+0.02] ) )    # 
ax_list.append( MyAxes(fig, [ .26-0.21,  .45-0.03, 0.2 + .165+0.05, .2 -0.05+0.02] ) )    # 
ax_list.append( MyAxes(fig, [ .80-.25,   .45-0.03, 0.2 + .165+0.05, .2 -0.05+0.02] ) )    # 
ax_list.append( MyAxes(fig, [ .26-0.21,  .25-0.02, 0.2 + .165+0.05, .2 -0.05+0.02] ) )    # 
ax_list.append( MyAxes(fig, [ .80-.25,   .25-0.02, 0.2 + .165+0.05, .2-0.05 +0.02] ) )    # 
ax_list.append( MyAxes(fig, [ .26-0.21,  .06, 0.2 + .165+0.05, .2 -0.05+0.02] ) )    # 
ax_list.append( MyAxes(fig, [ .80-.25,   .06, 0.2 + .165+0.05, .2-0.05+0.02 ] ) )    # 

ax=ax_list[0]
plot_example_raster(ax, groups_dic['MSN_D1'], '$MSN_{D1}$')
ax=ax_list[1]
plot_example_firing_rate(ax, groups_dic['MSN_D1'], '$MSN_{D1}$',ylim=[0,35])