def loop_over_analyzed_data_for_figs(N_CELLS=30):

    FIG_LIST = []

    for i in range(1, N_CELLS + 1):

        ##### LOADING THE DATA #####
        data = np.load('../data/cell' + str(i) + '.npz')

        ##### FITTING OF THE PHENOMENOLOGICAL THRESHOLD #####
        # two-steps procedure, see template_and_fitting.py
        # need SI units !!!
        P = fitting_Vthre_then_Fout(data['Fout'], 1e-3*data['muV'],\
                                    1e-3*data['sV'], data['TvN'],\
                                    data['muGn'], data['Gl'], data['Cm'],
                                    data['El'], print_things=False)

        ##### PLOTTING #####
        # see plotting_tools.py
        # need non SI units (electrophy units) !!!
        FIG = make_3d_and_2d_figs(P,\
                data['Fout'], data['s_Fout'], data['muV'],\
                data['sV'], data['TvN'], data['muGn'],\
                data['Gl'], data['Cm'], data['El'], 'cell'+str(i))

        FIG.savefig('../figures/cell' + str(i) + '.png', format='png')

        FIG_LIST.append(FIG)

    return FIG_LIST
def loop_over_analyzed_data_for_figs(N_CELLS=30):

    FIG_LIST = []
    
    for i in range(1, N_CELLS+1):

        ##### LOADING THE DATA #####
        data = np.load('../data/cell'+str(i)+'.npz')
        
        ##### FITTING OF THE PHENOMENOLOGICAL THRESHOLD #####
        # two-steps procedure, see template_and_fitting.py
        # need SI units !!!
        P = fitting_Vthre_then_Fout(data['Fout'], 1e-3*data['muV'],\
                                    1e-3*data['sV'], data['TvN'],\
                                    data['muGn'], data['Gl'], data['Cm'],
                                    data['El'], print_things=False)
        
        ##### PLOTTING #####
        # see plotting_tools.py
        # need non SI units (electrophy units) !!!
        FIG = make_3d_and_2d_figs(P,\
                data['Fout'], data['s_Fout'], data['muV'],\
                data['sV'], data['TvN'], data['muGn'],\
                data['Gl'], data['Cm'], data['El'], 'cell'+str(i))

        FIG.savefig('../figures/cell'+str(i)+'.png', format='png')

        FIG_LIST.append(FIG)
        
    return FIG_LIST
def produce_reduced_data():

    CELLS = []

    OUTPUT = np.zeros((8, 30))
    for i in range(1, 31):
        data = np.load('../data_firing_response/cell' + str(i) + '.npz')

        P = fitting_Vthre_then_Fout(data['Fout'], 1e-3*data['muV'],\
                                    1e-3*data['sV'], data['TvN'],\
                                    data['muGn'], data['Gl'], data['Cm'],
                                    data['El'], print_things=True)

        E = get_mean_encoding_power(P, data['El'], data['Gl'], data['Cm'])

        CELLS.append({'Gl':data['Gl'], 'Cm':data['Cm'],\
                      'Tm':data['Cm']/data['Gl'], 'P':P, 'E':E})
        OUTPUT[:4, i - 1] = P
        OUTPUT[4:, i - 1] = E
        print(data['Gl'], data['Cm'])

    np.save('reduced_data.npy', CELLS)

    return OUTPUT
     Stimulate a reconstructed cell with a shotnoise and study Vm dynamics
     """
    ,formatter_class=argparse.RawTextHelpFormatter)
    
    parser.add_argument("NEURON",\
                        help="Choose a cell (e.g. 'cell1') or a model of neuron (e.g. 'LIF')", default='LIF')

    args = parser.parse_args()
    
    data = np.load('../data/'+args.NEURON+'.npz')

    ##### FITTING OF THE PHENOMENOLOGICAL THRESHOLD #####
    # two-steps procedure, see template_and_fitting.py
    # need SI units !!!
    P = fitting_Vthre_then_Fout(data['Fout'], 1e-3*data['muV'],\
                                1e-3*data['sV'], data['TvN'],\
                                data['muGn'], data['Gl'], data['Cm'],
                                data['El'], print_things=True)

    print data['TvN_exp']
    
    
    ##### PLOTTING #####
    # see plotting_tools.py
    # need non SI units (electrophy units) !!!
    FIG = make_3d_and_2d_figs(P,\
            data['Fout'], data['s_Fout'], data['muV'],\
            data['sV'], data['TvN'], data['muGn'],\
            data['Gl'], data['Cm'], data['El'], args.NEURON)


    plt.show()
Exemple #5
0
    parser = argparse.ArgumentParser(
        description=""" 
     Stimulate a reconstructed cell with a shotnoise and study Vm dynamics
     """,
        formatter_class=argparse.RawTextHelpFormatter)

    parser.add_argument("NEURON",\
                        help="Choose a cell (e.g. 'cell1') or a model of neuron (e.g. 'LIF')", default='LIF')

    args = parser.parse_args()

    data = np.load('data/' + args.NEURON + '.npz')

    ##### FITTING OF THE PHENOMENOLOGICAL THRESHOLD #####
    # two-steps procedure, see template_and_fitting.py
    # need SI units !!!
    P = fitting_Vthre_then_Fout(data['Fout'], 1e-3*data['muV'],\
                                1e-3*data['sV'], data['TvN'],\
                                data['muGn'], data['Gl'], data['Cm'],
                                data['El'], print_things=True)

    ##### PLOTTING #####
    # see plotting_tools.py
    # need non SI units (electrophy units) !!!
    FIG = make_3d_fig(P,\
                      data['Fout'], data['s_Fout'], data['muV'],\
                      data['sV'], data['TvN'], data['muGn'],\
                      data['Gl'], data['Cm'], data['El'], args.NEURON)

    plt.show()