'100-noss':[paths[0]+s1.format(2), nets1],
#        '20-ss':[paths[2]+s3.format(2,5.0), nets1],
#        '50-ss':[paths[2]+s3.format(1,2.5), nets1],
#        '100-ss':[paths[2]+s3.format(0,1.0), nets1], 
#        '20-ST-ss':[paths[1]+s2.format(1,5.0), nets2],
#        '100-ST-ss':[paths[1]+s2.format(0,1.0), nets2] 
       }


d={}
for key, val in files.items():
    nets=val[1]
    d_tmp=effect_conns.gather('', nets, models, attrs, 
                              dic_keys=[key], 
                              file_names=[val[0]])
    misc.dict_update(d, d_tmp)
print d.keys()
pp(d)

from Go_NoGo_compete import show_heat_map, show_variability_several

builder=[['10-noss', nets1],
#         ['25-noss', nets1],
        ['50-noss', nets1],
#         ['75-noss', nets1],
        ['100-noss', nets1]
         ]
dd={}
titles=[]
i=0
for name, nets in builder:
fileName, fileOut, data_path =sys.argv[1:]

with Barrier():
    if comm.rank()==0:   
        out=pickle_load(fileName, all_mpi=True) 
    else:
        out=None


out=comm.bcast(out, root=0)
sim_time, args, kwargs=out
d={'sd':{'active':True,
           'params':{'to_memory':False, 
                     'to_file':True}}}

kwargs=misc.dict_update(kwargs, d)

mkdir(data_path+'nest/')
my_nest.ResetKernel(display=False, 
                    data_path=data_path+'nest/',
                    **{'threads_local': np_local})
import pprint
pp=pprint.pprint
d=my_nest.GetKernelStatus()
if comm.rank()==0:
    print comm.size()
    pp(d)
    import threading
    print threading.active_count()

# comm.obj.
Beispiel #3
0
def plot(file_name, figs, setup, flag, **k):
    nets = ['Net_0', 'Net_1']

    attr = ['firing_rate', 'mean_rates', 'spike_statistic']

    attr2 = ['psd', 'activity_histogram', 'activity_histogram_stat']

    attr_coher = ['phase_diff', 'phases_diff_with_cohere', 'mean_coherence']

    models = ['M1', 'M2', 'FS', 'GI', 'GA', 'ST', 'SN', 'GP']
    models_coher = [
        'GI_GA',
        'GI_GI',
        'GA_GA',
        'GA_ST',
        'GI_ST',
        'GP_GP',
        'ST_ST',
        'GP_ST',
    ]

    # Adding nets no file name
    sd_list = get_storage_list(nets, file_name, '')

    d = {}

    for sd, net in zip(sd_list, nets):

        filt = ([net] + models + models_coher + attr + attr2 + attr_coher)
        dd = load(sd, *filt)

        #             cmp_statistical_test(models, dd)
        d = misc.dict_update(d, dd)

    kw = setup.plot_summed2()
    kw['alphas'] = [1., 1.]
    kw['coherence_xcut'] = [0, 50]
    kw['coherence_color'] = ['grey', 'k']
    kw['coherence_p_conf95_linestyle'] = '--'
    kw['hatchs_ti_ti'] = ['', '']
    kw['label_model'] = 'Black=Model'
    kw['label_exp'] = 'White=Exp., Mallet et al 2008'
    kw['linewidth'] = 1.
    kw['set_text_on_bars'] = False
    kw['top_label'] = False
    kw['phases_diff_with_cohere_colors'] = ['grey', 'k']
    kw['phases_diff_with_cohere_xcut'] = [-numpy.pi * 0.97, numpy.pi**0.97]
    kw['phases_diff_with_cohere_remove_peaks'] = True
    kw['scale'] = 1
    kw['spk_stats_color_axis'] = 1
    kw['spk_stats_colors'] = ['k', 'w']
    kw['spk_stats_colors_ti_ta'] = ['k', 'w']
    kw['xlim_cohere'] = [-1, 51]

    kw.update(k)
    figs.append(oscillation_common.show_summed2(d, **kw))

    kw = setup.plot_summed_STN()
    kw['alphas'] = [1., 1.]
    kw['coherence_color'] = ['grey', 'k']
    kw['coherence_p_conf95_linestyle'] = '--'
    kw['hatchs_ti_ti'] = ['', '']
    kw['label_model'] = 'Black=Model'
    kw['label_exp'] = 'White=Exp., Mallet et al 2008'
    kw['linewidth'] = 1.
    kw['phases_diff_with_cohere_xcut'] = [-numpy.pi * 0.97, numpy.pi**0.97]
    kw['phases_diff_with_cohere_remove_peaks'] = True
    kw['phases_diff_with_cohere_colors'] = ['grey', 'k']
    kw['scale'] = 1
    kw['set_text_on_bars'] = False
    kw['spk_stats_colors'] = ['k', 'w']
    kw['spk_stats_colors_ti_ta'] = ['k', 'w']
    kw['spk_stats_color_axis'] = 1
    kw['top_label'] = False
    kw['xlim_cohere'] = [-1, 51]
    if flag == 'slow_wave':
        kw['ylim_cohere'] = [0, 1.0]
    elif flag == 'beta':
        kw['ylim_cohere'] = [0, 0.25]

    kw['coherence_xcut'] = [0, 50]
    kw.update(k)
    figs.append(oscillation_common.show_summed_STN(d, **kw))

    return figs
    #        '50-ss':[paths[2]+s3.format(1,2.5), nets1],
    #        '100-ss':[paths[2]+s3.format(0,1.0), nets1],
    #        '20-ST-ss':[paths[1]+s2.format(1,5.0), nets2],
    #        '100-ST-ss':[paths[1]+s2.format(0,1.0), nets2]
}

d = {}
for key, val in files.items():
    nets = val[1]
    d_tmp = effect_conns.gather('',
                                nets,
                                models,
                                attrs,
                                dic_keys=[key],
                                file_names=[val[0]])
    misc.dict_update(d, d_tmp)
print d.keys()
pp(d)

from Go_NoGo_compete import show_heat_map

builder = [
    ['10-noss', nets1],
    #         ['25-noss', nets1],
    ['50-noss', nets1],
    #         ['75-noss', nets1],
    ['100-noss', nets1]
]
dd = {}
titles = []
i = 0
Beispiel #5
0
def plot(file_name, figs, setup, flag,  **k):
    nets=['Net_0', 'Net_1']
    
    attr = [
        'firing_rate', 
        'mean_rates', 
        'spike_statistic'
        ]
    
    attr2=['psd',
           'activity_histogram',
           'activity_histogram_stat']
    
    attr_coher = [
                  'phase_diff', 
                  'phases_diff_with_cohere',
                  'mean_coherence'
                 ]
    
    models = ['M1', 'M2', 'FS', 'GI', 'GA', 'ST', 'SN', 'GP']
    models_coher = ['GI_GA', 'GI_GI', 'GA_GA', 'GA_ST', 'GI_ST', 'GP_GP',
                     'ST_ST', 'GP_ST',]
    
    # Adding nets no file name
    sd_list=get_storage_list(nets, file_name, '')
    
    d = {}
    
    for sd, net in zip(sd_list, nets):
        
    
        filt = ([net] 
                + models + models_coher 
                + attr + attr2 + attr_coher)
        dd = load(sd, *filt)
    
            #             cmp_statistical_test(models, dd)
        d = misc.dict_update(d, dd)
    
     
    kw=setup.plot_summed2()
    kw['alphas']=[1.,1.]
    kw['coherence_xcut']=[0,50]
    kw['coherence_color']=['grey', 'k']
    kw['coherence_p_conf95_linestyle']='--'
    kw['hatchs_ti_ti']=['','']
    kw['label_model']='Black=Model'
    kw['label_exp']='White=Exp., Mallet et al 2008'
    kw['linewidth']=1.
    kw['set_text_on_bars']=False
    kw['top_label']=False
    kw['phases_diff_with_cohere_colors']=['grey','k']
    kw['phases_diff_with_cohere_xcut']=[-numpy.pi*0.97, numpy.pi**0.97]
    kw['phases_diff_with_cohere_remove_peaks']=True
    kw['scale']=1
    kw['spk_stats_color_axis']=1
    kw['spk_stats_colors']=['k', 'w']
    kw['spk_stats_colors_ti_ta']=['k','w']
    kw['xlim_cohere']=[-1, 51]
    

    kw.update(k)
    figs.append(oscillation_common.show_summed2(d, **kw))
        
    kw=setup.plot_summed_STN()
    kw['alphas']=[1.,1.]
    kw['coherence_color']=['grey','k']
    kw['coherence_p_conf95_linestyle']='--'
    kw['hatchs_ti_ti']=['','']
    kw['label_model']='Black=Model'
    kw['label_exp']='White=Exp., Mallet et al 2008'
    kw['linewidth']=1.
    kw['phases_diff_with_cohere_xcut']=[-numpy.pi*0.97, numpy.pi**0.97]
    kw['phases_diff_with_cohere_remove_peaks']=True
    kw['phases_diff_with_cohere_colors']=['grey','k']
    kw['scale']=1
    kw['set_text_on_bars']=False
    kw['spk_stats_colors']=['k', 'w']
    kw['spk_stats_colors_ti_ta']=['k','w']
    kw['spk_stats_color_axis']=1
    kw['top_label']=False    
    kw['xlim_cohere']=[-1, 51]
    if flag=='slow_wave':
        kw['ylim_cohere']=[0, 1.0]
    elif flag=='beta':
        kw['ylim_cohere']=[0, 0.25]
        
    kw['coherence_xcut']=[0,50]
    kw.update(k)
    figs.append(oscillation_common.show_summed_STN(d, **kw))
    
    return figs