def main(**kwargs):
    
    exclude=kwargs.get('exclude',[])
    models=['GP_GP', 'GA_GA', 'GI_GA', 'GI_GI']
    models=[m for m in models if not ( m in exclude)]
    
    nets=['Net_0', 'Net_1']
    attrs=['mean_coherence', 'phases_diff_with_cohere']
    
    from_disk=kwargs.get('from_diks',0)
    path=('/home/mikael/results/papers/inhibition/network/'
          +'supermicro/simulate_slow_wave_ZZZ_dop_effect_perturb/')
    path=kwargs.get('data_path', path)
        
    script_name=kwargs.get('script_name', (__file__.split('/')[-1][0:-3]
                                           +'/data'))

    file_name = get_file_name(script_name)
 
    sd = get_storage(file_name, '')
    d={}
    if not from_disk:
    
#         d['raw']=gather(path, nets, models, attrs)
        d['raw']=gather2(path, nets, models, attrs)
        d['data']=extract_data(d['raw'], nets, models, attrs)
        d['performance']=compute_performance(d['data'], nets, models, attrs)
        d['bar_obj'], d['labels']=generate_plot_data(d['performance'],
                                                     models, 
                                                     attrs)

        save(sd, d)
    else:
        filt=['bar_obj']+models+['labels']
        d = sd.load_dic(*filt)

    figs=[]
    figs.append(plot_coher(d, d['labels'], title_name=kwargs.get('title')))

    
    save_figures(figs, script_name)
    pylab.show()
Exemple #2
0
def main(**kwargs):

    exclude = kwargs.get('exclude', [])
    models = ['GP_GP', 'GA_GA', 'GI_GA', 'GI_GI']
    models = [m for m in models if not (m in exclude)]

    nets = ['Net_0', 'Net_1']
    attrs = ['mean_coherence', 'phases_diff_with_cohere']

    from_disk = kwargs.get('from_diks', 0)
    path = ('/home/mikael/results/papers/inhibition/network/' +
            'supermicro/simulate_slow_wave_ZZZ_dop_effect_perturb/')
    path = kwargs.get('data_path', path)

    script_name = kwargs.get('script_name',
                             (__file__.split('/')[-1][0:-3] + '/data'))

    file_name = get_file_name(script_name)

    sd = get_storage(file_name, '')
    d = {}
    if not from_disk:

        #         d['raw']=gather(path, nets, models, attrs)
        d['raw'] = gather2(path, nets, models, attrs)
        d['data'] = extract_data(d['raw'], nets, models, attrs)
        d['performance'] = compute_performance(d['data'], nets, models, attrs)
        d['bar_obj'], d['labels'] = generate_plot_data(d['performance'],
                                                       models, attrs)

        save(sd, d)
    else:
        filt = ['bar_obj'] + models + ['labels']
        d = sd.load_dic(*filt)

    figs = []
    figs.append(plot_coher(d, d['labels'], title_name=kwargs.get('title')))

    save_figures(figs, script_name)
    pylab.show()
 
sm = pylab.cm.ScalarMappable(cmap='copper', 
                             norm=pylab.normalize(vmin=2.5, vmax=20))
sm._A = []
  
box = ax.get_position()
pos=[box.x0+1.03*box.width, box.y0+box.height*0.1,
     0.01,  box.height*0.8]
axColor=pylab.axes(pos)
cbar=pylab.colorbar(sm, cax=axColor)
tick_locator = ticker.MaxNLocator(nbins=7)
cbar.locator = tick_locator
cbar.update_ticks()
cbar.ax.tick_params( length=1, )
cbar.ax.set_yticklabels(ln, fontsize=5*scale)  
  
ax.text(1.3, 0.5,  r'$g^{TA\to FS}$, $g_{TI\to FS}$', 
        transform=ax.transAxes,  va='center', rotation=270) 
ax.set_xlabel(r'Angle (rad)')
ax.set_ylabel('Frequency (Hz)')
ax.my_set_no_ticks(xticks=4)
ax.my_set_no_ticks(yticks=4)



l2=l2[organize['TATIFS']]

save_figures([fig], script_name, dpi=400)

pylab.show()
    ax.set_ylabel('')
#     a=ax.get_xticklabels()
    ax.tick_params(axis='both', which='major', labelsize=7*scale)
#     ax.set_xticklabels(ax.get_xticklabels(), fontsize=20)
#     ax.set_yticklabels(fontsize=20)

    ax.my_remove_axis(xaxis=True, yaxis=True,keep_ticks=True)
    
#     axs[0].my_remove_axis(xaxis=True, yaxis=False,keep_ticks=True)
#     axs[1].my_remove_axis(xaxis=True, yaxis=True,keep_ticks=True)
#     axs[2].my_remove_axis(xaxis=True, yaxis=False,keep_ticks=True)
#     axs[3].my_remove_axis(xaxis=True, yaxis=True,keep_ticks=True)
#     axs[4].my_remove_axis(xaxis=False, yaxis=False,keep_ticks=True)
#     axs[5].my_remove_axis(xaxis=False, yaxis=True,keep_ticks=True)
    
    
#     
#     if i==4:
#         ax.text(1.05, -.3, 
#                   'Cortical input action 1',
#                     horizontalalignment='center', 
#                     transform=axs[i].transAxes) 
#         ax.set_xticks([1,1.5, 2, 2.5])
#         ax.set_xticklabels(['1.0','1.5','2.0','2.5'])
#             
#     if i==2:
#         ax.set_ylabel('Cortical input action 2')
       
save_figures([fig], __file__.split('/')[-1][0:-3]+'/data', dpi=200)

pylab.show()
Exemple #5
0
pos=[box.x0+1.03*box.width, box.y0+box.height*0.1,
     0.01, box.height*0.8]
axColor=pylab.axes(pos)
cbar=pylab.colorbar(sm, cax=axColor, ticks=range(len(ln)))

cbar.ax.tick_params( length=1, )
cbar.ax.set_yticklabels(ln, fontsize=5*scale)  

ax.text(1.3,  0.5, r'$Fan_{in}^{[TA,TI]\to TA}$ (#)', 
        transform=ax.transAxes, va='center', rotation=270) 

ax.set_xlabel(r'Angle (rad)')
ax.set_ylabel('Norm. count TI-TA')
ax.my_set_no_ticks(xticks=4)
ax.my_set_no_ticks(yticks=4)
ax.set_ylim([0,0.31])

for ax in axs:
    ax.tick_params(direction='out',
                   length=2,
                   width=0.5,
                   pad=0.01,
                    top=False, right=False
                    )
save_figures([fig], script_name, dpi=400)

pylab.show()