Ejemplo n.º 1
0
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, :])

ax01 = plt.subplot(gs1[:5, 0])
ax02 = plt.subplot(gs1[5:, 0])
#only plot every 10th sender
idxes_subsample = bitwise_senders % 4 == 0
idxes_times = bitwise_times > np.max(bitwise_times) - 5000
senders = bitwise_senders[idxes_subsample & idxes_times]
import matplotlib
matplotlib.use('Agg')
import numpy as np
import sys
import helper
import json
import argparse
import pylab as plt
import seaborn as sns 
import plot_helper as phf
phf.latexify(columns=1)


parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input', nargs='+', type=str)
parser.add_argument('-o', '--output', type=str)

args = parser.parse_args()

plt.figure()

for i in args.input:
    with open(i, 'r+') as f:
        data = json.load(f)
        if 'qualitative_model' == data['label'] or  'bitwise' in data['label'] or 'initial' in data['label']: # or 'reso' in data['label']:
            if 'qualitative' in data['label']:
                plt.plot(data['dt'], data['dw'], label=data['label'], linewidth=1.,zorder=10)
            else:
                plt.plot(data['dt'], data['dw'], label=data['label'],linewidth=3.)
plt.subplots_adjust(left=0.25, right=0.99, top=0.95, bottom=0.2, hspace=0.2, wspace=0.25)
plt.axhline(0, color='k', linestyle='--',zorder=0)
Ejemplo n.º 3
0
df_latex = df.replace(value=np.nan, to_replace='Failed').groupby([
    'Experiment'
])['Number of groups', 'Number of groups (nest)', 'exc_rate', 'inh_rate',
   'spektral peak'].agg([np.median, iqr, 'min', 'max',
                         'count'])  #.agg([np.median,iqr])
print(df_latex.to_latex())
print(df_latex)
df_latex_spek = df.replace(value=np.nan, to_replace='Failed').groupby([
    'Experiment', 'spektral peak'
])['Number of groups', 'Number of groups (nest)', 'exc_rate', 'inh_rate',
   'spektral peak'].agg([np.median, iqr, 'min', 'max',
                         'count'])  #.agg([np.median,iqr])
print(df_latex_spek.to_latex())
print(df_latex_spek)

phf.latexify(fig_height=6., columns=1)
fig = plt.figure()
N = 9

N_bot = 5
M = 4
gs0 = gridspec.GridSpec(N, M)

ax_orig = plt.subplot(gs0[:N_bot, :M - 1])
ax_nest = plt.subplot(gs0[N_bot:, 0:M - 1])

ax_orig_broken = fig.add_subplot(gs0[:N_bot, M - 1])  # , sharey=ax_orig)
ax_nest_broken = fig.add_subplot(gs0[N_bot:, M - 1])  # , sharey=ax_nest)

orig_pal = ['C2', 'C1', 'C0', 'C5', 'C4', 'C4', 'C4', 'C4', 'C4', 'C4', 'C4']
orig_exp_order = [
Ejemplo n.º 4
0
                pd.pivot_table(connecitivty_e_e,
                               values='weight',
                               columns='bin_w',
                               index='delay',
                               aggfunc=len))
        excolor = c_low
        h += 1
        gamma_peak.append('high')

    with open(grp_stat_fl, "r") as f:
        stats = json.load(f)
    reps.append(rep)
    N_grps.append(len(stats['N_fired']))
df = pd.DataFrame(dict(reps=reps, n_groups=N_grps, spektral_peak=gamma_peak))

phf.latexify(fig_height=2.5, columns=2)
fig = plt.figure()

gs0 = gridspec.GridSpec(1, 3)

ax_psd = plt.subplot(gs0[0, 0])

ax_weights = plt.subplot(gs0[0, 1])
ax_groups = plt.subplot(gs0[0, 2])

print(df.columns)
ax_psd.plot(exc_freqs,
            exc_Pxx_tab[:, df.loc[df['spektral_peak'] == 'low', 'reps']],
            color=c_low,
            linewidth=1.0)
ax_psd.plot(exc_freqs,