marker=',')
for a in ax[:2]:
    a.xaxis.set_visible(False)
    a.yaxis.set_visible(False)

ax[1].plot(np.concatenate(kc_st[::10]),
           np.concatenate(kc_id[::10]),
           color='#e66101',
           ls='',
           marker=',')

#* plot ggn vm from both simulations
myplot.plot_ggn_vm(ax[2],
                   fd_sc,
                   fd_sc['/data/uniform/ggn_basal/GGN_basal_Vm'],
                   'dend_b',
                   1,
                   color='k',
                   alpha=1.0)
ax[2].set_ylim((-53, -40))
ax[2].set_yticks([-50, -45])
ax[2].set_xlim(200, 2500)
ax[2].set_xticks([200, 1000, 2000])
ax[2].set_xlabel('Time (ms)')
ax[2].hlines(y=-53,
             xmin=stiminfo['onset'],
             xmax=stiminfo['onset'] + stiminfo['duration'],
             color='gray',
             lw=10)
ax[2].hlines(y=-53,
             xmin=stiminfo['onset'] + stiminfo['duration'],
Пример #2
0
fig, ax = plt.subplots(nrows=3, ncols=2, sharex='all', sharey='row')
# jid = '13081213'   # this reproduces GGN Vm well, PN->KC clustered, same KC cluster receives coactive PNs
jid = '21841553'   # new simulation 
fname = nda.find_h5_file(jid, datadir)
originals = []
with h5.File(fname, 'r') as fd:
    ax[0, 0].set_title(f'{jid}')
    print(fname)
    orig = fd.attrs['original']
    originals.append(orig)
    print(f'original:{orig}')
    with h5.File(orig, 'r') as forig:
        print(yaml.dump(nda.load_config(forig), default_flow_style=False))
    # fig, ax = plt.subplots(nrows=2, ncols=1, sharex='all')
    myplot.plot_ggn_vm(ax[1, 0], fd, fd['/data/uniform/ggn_output/GGN_output_Vm'], 'LCA', 1, color='black', alpha=1.0)
    ax[1, 0].set_ylim(-60, -45)
    ax[1, 0].set_yticks([-55, -50])
    ig_vm = fd['/data/uniform/ig/IG_Vm']
    dt = ig_vm.attrs['dt']
    ig_vm = ig_vm[0, :]
    t = np.arange(len(ig_vm)) * dt
    ax[2, 0].plot(t, ig_vm, color='black')
    ax[2, 0].hlines(y=-60.0, xmin=500, xmax=1500, color='gray', lw=10)
    ax[2, 0].hlines(y=-60.0, xmin=1500, xmax=2000, color='lightgray', lw=10)
    for axis in ax.flat:
        [sp.set_visible(False) for sp in axis.spines.values()]
        axis.tick_params(right=False, top=False)    
    ax[1, 0].tick_params(bottom=False)
    xticks = [200.0, 1000.0, 2000.0, 3000.0]    
    ax[2, 0].set_xticks(xticks)
import pn_kc_ggn_plot_mpl as myplot

datadir = '/data/rays3/ggn/olfactory_network'

#jid = '20161955'
# jid = '20162331'
jid = '20162116'
fname = nda.find_h5_file(jid, datadir)
fig, ax = plt.subplots()
with h5.File(fname, 'r') as fd:
    spike_counts = [
        ds.shape[0] for ds in fd['/data/event/kc/kc_spiketime'].values()
    ]
    spiking = len(np.flatnonzero(spike_counts))
    print('spiking kcs:{}'.format(spiking))
    myplot.plot_ggn_vm(ax, fd, fd['/data/uniform/ggn_basal/GGN_basal_Vm'],
                       'dend_b', 1)
    ax.set_xlabel('Time (ms)')
    ax.set_ylabel('GGN Vm (mV)')
    ax.tick_params(right=False, top=False)
    ax.set_xlim(500, 2500)
fig.set_frameon(False)
fig.set_size_inches(20 / 2.54, 10 / 2.54)
fig.savefig('supp_4_ggn_ig_hyperpolarization.svg')

# 50.0,1.4,2.7,20162064
jid = '20162064'
fname = nda.find_h5_file(jid, datadir)
fig, ax = plt.subplots()
with h5.File(fname, 'r') as fd:
    spike_counts = [
        ds.shape[0] for ds in fd['/data/event/kc/kc_spiketime'].values()
    pn_st.append(pn.value)
    pn_id.append([int(pn.name.rpartition('_')[-1])] * len(pn))
ax0.plot(np.concatenate(pn_st[::10]),
         np.concatenate(pn_id[::10]),
         color='#fdb863',
         ls='',
         marker='s',
         ms=1)
ax0.xaxis.set_visible(False)
ax0.yaxis.set_visible(False)

#* plot ggn vm from both simulations
myplot.plot_ggn_vm(ax1,
                   fd_constant,
                   fd_constant['/data/uniform/ggn_basal/GGN_basal_Vm'],
                   'dend_b',
                   1,
                   color='#009292',
                   alpha=1.0)
ax1.hlines(y=-53,
           xmin=stiminfo_const['onset'],
           xmax=stiminfo_const['onset'] + stiminfo_const['duration'],
           color='gray',
           lw=10)
ax1.hlines(y=-53,
           xmin=stiminfo_const['onset'] + stiminfo_const['duration'],
           xmax=stiminfo_const['onset'] + stiminfo_const['duration'] +
           stiminfo_const['offdur'],
           color='lightgray',
           lw=10)
Пример #5
0
ax1 = fig.add_subplot(gs[1], sharex=ax0)
axes = [ax0, ax1]
with h5.File(fname, 'r') as fd:
    print('jid: {} spiking KCs: {}'.format(jid, len(nda.get_spiking_kcs(fd))))
    print(yaml.dump(nda.load_config(fd), default_style=''))
    # pn_st = []
    # pn_id = []
    # for pn in fd[nda.pn_st_path].values():
    #     pn_st.append(pn.value)
    #     pn_id.append([int(pn.name.rpartition('_')[-1])] * len(pn))
    # ax0.plot(np.concatenate(pn_st[::10]), np.concatenate(pn_id[::10]), 'k,')
    kc_x, kc_y = nda.get_event_times(fd[nda.kc_st_path])
    ax0.plot(np.concatenate(kc_x[::10]), np.concatenate(kc_y[::10]), 'k,')
    myplot.plot_ggn_vm(ax1,
                       fd,
                       fd['/data/uniform/ggn_basal/GGN_basal_Vm'],
                       'dend_b',
                       1,
                       color='k')
    ax1.set_ylim(-51, -45)
    ax1.set_xlim(700, 2500)
    xticks = np.array([
        200.0, 1000.0, 2000.0
    ]) + 500  # Here the onset was at 1s, 500 ms past the newer simulations
    ax1.set_xticks(xticks)
    ax1.set_xticklabels((xticks - 500) / 1000.0)
    ax1.set_yticks([-50.0, -40.0])
for axis in axes:
    [sp.set_visible(False) for sp in axis.spines.values()]
    axis.tick_params(right=False, top=False)
for axis in axes[:-1]:
    axis.xaxis.set_visible(False)
Пример #6
0
          np.concatenate(pn_id[::10]),
          marker='s',
          ms=1,
          color='#fdb863',
          ls='none')
 kc_x, kc_y = nda.get_event_times(fd[nda.kc_st_path])
 ax1.plot(np.concatenate(kc_x[::10]),
          np.concatenate(kc_y[::10]),
          color='#e66101',
          marker='s',
          ms=1,
          ls='none')
 myplot.plot_ggn_vm(axes[2],
                    fd,
                    fd['/data/uniform/ggn_basal/GGN_basal_Vm'],
                    'dend_b',
                    1,
                    color='#009292',
                    alpha=1.0)
 ax2.set_ylim(-53, -45)
 ax2.set_xlim(200, 2000)
 xticks = np.array([200.0, 1000.0, 2000.0])
 ax2.set_xticks(xticks)
 ax2.set_xticklabels(xticks / 1000.0)
 ax2.set_yticks([-50.0, -45.0])
 ax2.hlines(y=-53.0,
            xmin=Q_(config['stimulus']['onset']).to('ms').m,
            xmax=Q_(config['stimulus']['onset']).to('ms').m +
            Q_(config['stimulus']['duration']).to('ms').m,
            lw=3,
            color='lightgray')