Ejemplo n.º 1
0
    def plot_results(self, nrnManager, saving_dir):
        for i, var in enumerate(self.param['var_to_plot']):
            secs = self.param['section_to_plot']
            vecs_to_plot = self.build_vecs_to_plot(var, 
                                                   secs, 
                                                   self.manager.refs['VecRef'])
            
            self.manager.plot_vecs(vecs_to_plot, figure_num=i)
            
            if var == 'v':
                plt.ylabel("Voltage [mV]")
                plt.xlabel("Time [ms]")
                plt.ylim(-90) # Setting the minimum limits
                
            elif var == 'cai' or var == 'cali':
                plt.xlabel("Time [ms]")
                plt.ylabel("Concentration [mM]")
            
            elif var == 'ica':
                plt.xlabel("Time [ms]")
                plt.ylabel("Current [nA]")
#                
            fig_file = 'plot_' + var
            plt.savefig(os.path.join(saving_dir, fig_file))
            
        if self.param['bio_on']:  
            from helpers.plotter import EcellPlotter
            ecp = EcellPlotter()
            x_start = self.param['t_equilibrium_ecell']
            x_stop = x_start + self.param['tStop']/1e3

            for stim_spine in self.param['stimulated_spines']:
                spine = nrnManager.spines[stim_spine]
                ecp.plot_timeCourses(spine.ecellMan.timeCourses, save=True, 
                                   dir=saving_dir, name=spine.id, 
                                   x_lims= [x_start, x_stop])
                ecp.plot_weight(spine.ecellMan.timeCourses, dir=saving_dir)
Ejemplo n.º 2
0
    def plot_results(self, nrnManager, saving_dir):
        for i, var in enumerate(self.param['var_to_plot']):
            secs = self.param['section_to_plot']
            vecs_to_plot = self.build_vecs_to_plot(var, secs,
                                                   self.manager.refs['VecRef'])

            self.manager.plot_vecs(vecs_to_plot, figure_num=i)

            if var == 'v':
                plt.ylabel("Voltage [mV]")
                plt.xlabel("Time [ms]")
                plt.ylim(-90)  # Setting the minimum limits

            elif var == 'cai' or var == 'cali':
                plt.xlabel("Time [ms]")
                plt.ylabel("Concentration [mM]")

            elif var == 'ica':
                plt.xlabel("Time [ms]")
                plt.ylabel("Current [nA]")


#
            fig_file = 'plot_' + var
            plt.savefig(os.path.join(saving_dir, fig_file))

        if self.param['bio_on']:
            from helpers.plotter import EcellPlotter
            ecp = EcellPlotter()
            x_start = self.param['t_equilibrium_ecell']
            x_stop = x_start + self.param['tStop'] / 1e3

            for stim_spine in self.param['stimulated_spines']:
                spine = nrnManager.spines[stim_spine]
                ecp.plot_timeCourses(spine.ecellMan.timeCourses,
                                     save=True,
                                     dir=saving_dir,
                                     name=spine.id,
                                     x_lims=[x_start, x_stop])
                ecp.plot_weight(spine.ecellMan.timeCourses, dir=saving_dir)
Ejemplo n.º 3
0
    parameter_file = sys.argv[1]
    param = parameters.ParameterSet(parameter_file)
    
    ## Setting the mat plotlib backend
    import matplotlib
    if param['interactive'] == False:
        matplotlib.use('Agg')
        print "Switching backend to Agg. Batch execution"
    import matplotlib.pyplot as plt
    from helpers.plotter import EcellPlotter
    import helpers
    loader = helpers.Loader()

#    ecellManager = testChangeCalciumValue(interval, caValue)
    if param['running_type'] == 'train':
        ecellManager = testCalciumTrain(param['num_spikes'],
                                        param['delay'],
                                        param['biochemical_filename'])
    

    ecp = EcellPlotter()
    if param['interactive'] == False:
        dir = loader.create_new_dir(prefix=os.getcwd())
        loader.save(ecellManager.timeCourses,  dir, "timeCourses")
        ecp.plot_timeCourses(ecellManager.timeCourses, save=True, dir=dir)
        ecp.plot_weight(ecellManager.timeCourses, dir=dir)
    else:
        ecp.plot_timeCourses(ecellManager.timeCourses)
        ecp.plot_weight(ecellManager.timeCourses)
        plt.show()
Ejemplo n.º 4
0
        sys.exit()

    parameter_file = sys.argv[1]
    param = parameters.ParameterSet(parameter_file)

    ## Setting the mat plotlib backend
    import matplotlib
    if param['interactive'] == False:
        matplotlib.use('Agg')
        print "Switching backend to Agg. Batch execution"
    import matplotlib.pyplot as plt
    from helpers.plotter import EcellPlotter
    import helpers
    loader = helpers.Loader()

    #    ecellManager = testChangeCalciumValue(interval, caValue)
    if param['running_type'] == 'train':
        ecellManager = testCalciumTrain(param['num_spikes'], param['delay'],
                                        param['biochemical_filename'])

    ecp = EcellPlotter()
    if param['interactive'] == False:
        dir = loader.create_new_dir(prefix=os.getcwd())
        loader.save(ecellManager.timeCourses, dir, "timeCourses")
        ecp.plot_timeCourses(ecellManager.timeCourses, save=True, dir=dir)
        ecp.plot_weight(ecellManager.timeCourses, dir=dir)
    else:
        ecp.plot_timeCourses(ecellManager.timeCourses)
        ecp.plot_weight(ecellManager.timeCourses)
        plt.show()