Пример #1
0
import pylab as plt
import helper as hf
import plot_helper as phf
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('-bs', '--bitwise_spikefile', type=str)
parser.add_argument('-os', '--original_spikefile', type=str)
parser.add_argument('-bmem', '--bitwise_mem_pop_file', type=str)

parser.add_argument('-fn', '--filename', type=str)

args = parser.parse_args()

original_spikefile = args.original_spikefile
original_times, original_senders = hf.read_spikefile(original_spikefile)
bitwise_spikefile = args.bitwise_spikefile
bitwise_times, bitwise_senders = hf.read_spikefile(bitwise_spikefile)

bitwise_mem_pop = np.loadtxt(args.bitwise_mem_pop_file)

phf.latexify(columns=2)
excolor = 'C0'
incolor = 'C1'

fig = plt.figure()
gs0 = gridspec.GridSpec(2, 2)
gs0.update(left=0.1, right=0.97, top=0.97, bottom=0.1, hspace=0.25)

gs1 = gridspec.GridSpecFromSubplotSpec(7, 1, subplot_spec=gs0[0, :])
Пример #2
0
    sns.xkcd_rgb["denim blue"], sns.xkcd_rgb["medium green"],
    sns.xkcd_rgb["pale red"]
]
plt.figure()
current_palette = sns.color_palette(flatui)
sns.palplot(current_palette)
sns.set_palette(current_palette)
plt.savefig('palette.png')
plt.close()
args = parser.parse_args()

excolor = 'C0'
incolor = 'C1'

statistical_spikefile = args.statistical_spikefile
statistical_times, statistical_senders = hf.read_spikefile(
    statistical_spikefile)
bitwise_spikefile = args.bitwise_spikefile
bitwise_times, bitwise_senders = hf.read_spikefile(bitwise_spikefile)

statistical_weights = hf.read_weightfile(args.statistical_weightfile)
bitwise_weights = hf.read_weightfile(args.bitwise_weightfile)

fig = plt.figure(figsize=(9, 8))
gs0 = gridspec.GridSpec(2, 2)
gs0.update(left=0.1, right=0.97, top=0.97, bottom=0.06, hspace=0.15)

gs1 = gridspec.GridSpecFromSubplotSpec(7, 1, subplot_spec=gs0[0, :])

ax01 = plt.subplot(gs1[:5, 0])
ax02 = plt.subplot(gs1[5:, 0])
import argparse
import mpl_toolkits.axes_grid.inset_locator

parser = argparse.ArgumentParser()
parser.add_argument('-cs', '--comp_spikefile', type=str)
parser.add_argument('-bs', '--bitwise_spikefile', type=str)

parser.add_argument('-cw', '--comp_weightfile', type=str)
parser.add_argument('-bw', '--bitwise_weightfile', type=str)

parser.add_argument('-fn', '--filename', type=str)

args = parser.parse_args()

comp_spikefile = args.comp_spikefile
comp_times, comp_senders = hf.read_spikefile(comp_spikefile)
bitwise_spikefile = args.bitwise_spikefile
bitwise_times, bitwise_senders = hf.read_spikefile(bitwise_spikefile)

comp_weights = hf.read_weightfile(args.comp_weightfile)
bitwise_weights = hf.read_weightfile(args.bitwise_weightfile)

bin_ms = 5.
phf.latexify(columns=2)
excolor = 'C0'
incolor = 'C1'

fig = plt.figure()
gs0 = gridspec.GridSpec(2, 2)
gs0.update(left=0.1, right=0.97, top=0.97, bottom=0.1, hspace=0.25)
Пример #4
0
gamma_peak = []
N_grps = []

c_high = 'C5'
c_low = 'C6'
for rep, (spk_fl, grp_stat_fl, con_fl) in enumerate(
        zip(args.spikelist, args.groupstatlist, args.connectivitylist)):

    connectivity = pd.read_json(con_fl)
    connecitivty_e = connectivity.loc[connectivity['pre'] < 800]
    connecitivty_e_e = connectivity.loc[connectivity['post'] < 800]

    connecitivty_e_e['bin_w'] = pd.cut(connecitivty_e_e['weight'],
                                       np.arange(0, 10.5, 0.5))

    times, senders = hf.read_spikefile(spk_fl)
    exc_times, exc_sender, inh_times, inh_sender = hf.split_in_ex(
        times, senders)
    exc_rate, exc_bins = hf.bin_pop_rate(exc_times, exc_sender, bin_ms)
    exc_Pxx, exc_freqs = mlab.psd(exc_rate - np.mean(exc_rate),
                                  NFFT=NFFT,
                                  Fs=1000. / (exc_bins[1] - exc_bins[0]),
                                  noverlap=noverlap)

    exc_Pxx_tab[:, rep] = exc_Pxx
    idx = np.argmax(exc_Pxx[exc_freqs > 20])
    cut_freqs = exc_freqs[exc_freqs > 20]
    max_freq = cut_freqs[idx]
    if max_freq < 50:
        if table_low is None:
            table_low = pd.pivot_table(connecitivty_e_e,