Example #1
0
    def plot_details(filename='figure_1.png'):
        par['record_from'] = [
            "vg", "Iapp", "iNap", "iNaf", 'iKv2', 'iKv3', 'iKv4f', 'iKv4s',
            'iCah', 'iSk', 'iKcnq'
        ]
        par_sim['simulation_time'] = 100 * b2.ms
        current_unit = b2.uA
        start_time = time()
        i_stim = [2.0]
        _, ax = plt.subplots(len(i_stim) + 1, figsize=(6, 8), sharex=True)
        # make_grid(nrows, ncols, left, right, hspace, wspace, bottom, top)
        ax = make_grid(3, 1, 0.2, 0.95, 0.18, 0, 0.1, 0.95)
        for ii in range(len(i_stim)):
            input_current = get_step_current(50, 100, b2.ms,
                                             i_stim[ii] * current_unit)
            par['iapp'] = input_current
            st_mon = simulate_GPe_cell(par, par_sim)
            plot_data(st_mon, ax[ii], lw=1, c='k')
            # plot_current(st_mon, ax[-2], current_unit)
            plot_channel_currents(st_mon, ax[1:], current_unit)

        ax[0].set_xlim(75, 90)
        ax[1].set_xlim(75, 90)
        ax[2].set_xlim(75, 90)
        print("Done in {:.3f}".format(time() - start_time))
        plt.savefig(filename)
        plt.close()
Example #2
0
    def simulate_1_gpe_cell():
        start_time = time()
        current_unit = b2.pA
        # Figure 2 ------------------------------------------------------
        fig, ax = plt.subplots(5, figsize=(10, 8))
        i_stim = [20, 0, -0.5, 170.]
        for ii in range(len(i_stim)):

            input_current = get_step_current(0, 1000, b2.ms,
                                             i_stim[ii] * current_unit)
            if ii == 3:
                input_current = get_step_current(100, 250, b2.ms,
                                                 i_stim[ii] * current_unit)
                par_sim['simulation_time'] = 350 * b2.ms

            par_g['i_ext'] = input_current
            st_mon = simulate_GPe_cell(par_g, par_sim)
            plot_data(st_mon, ax[ii], title=str(i_stim[ii]))
            plot_current(st_mon, current_unit, ax[-1], [-1, 22])

        print("Done in {} seconds".format(time() - start_time))
        plt.tight_layout()
        plt.savefig('figure_2.png')
        plt.close()
Example #3
0
 def plot_fig_1e():
     start_time = time()
     fig, ax = plt.subplots(4, figsize=(10, 6), sharex=True)
     t_stim = [300, 450, 600]
     for ii in range(len(t_stim)):
         input_current = get_step_current(500,
                                          500 + t_stim[ii],
                                          b2.ms,
                                          -25 * b2.pA)
         par['i_ext'] = input_current
         st_mon = simulate_STN_cell(par, par_sim)
         plot_data(st_mon, ax[ii])
         plot_current(st_mon, ax[3])
     print("Done in {}".format(time() - start_time))
     plt.tight_layout()
     plt.savefig('figure_1e.png')
     plt.close()
Example #4
0
 def plot_fig_1f():
     current_unit = b2.pA
     start_time = time()
     fig, ax = plt.subplots(4, figsize=(10, 6), sharex=True)
     i_stim = [-20, -30, -40]
     for ii in range(len(i_stim)):
         input_current = get_step_current(500,
                                          800,
                                          b2.ms,
                                          i_stim[ii] * current_unit)
         par['i_ext'] = input_current
         st_mon = simulate_STN_cell(par, par_sim)
         plot_data(st_mon, ax[ii])
         plot_current(st_mon, ax[3], current_unit)
     print("Done in {}".format(time() - start_time))
     plt.tight_layout()
     plt.savefig('figure_1f.png')
     plt.close()
Example #5
0
 def plot():
     current_unit = b2.uA
     start_time = time()
     i_stim = [2, 4, 6]
     _, ax = plt.subplots(len(i_stim)+1, figsize=(10, 6), sharex=True)
     for ii in range(len(i_stim)):
         input_current = get_step_current(200,
                                          700,
                                          b2.ms,
                                          i_stim[ii] * current_unit)
         par['i_ext'] = input_current
         st_mon = simulate_FSI_cell(par, par_sim)
         plot_data(st_mon, ax[ii])
         plot_current(st_mon, ax[3], current_unit)
     print("Done in {:.3f}".format(time() - start_time))
     plt.tight_layout()
     plt.savefig('data/figure_1.png')
     plt.close()
Example #6
0
 def plot(filename="figure_0.png"):
     par['record_from'] = ["vg", "Iapp"]
     par_sim['simulation_time'] = 500.0 * b2.ms
     current_unit = b2.uA
     start_time = time()
     i_stim = [2.0]
     _, ax = plt.subplots(len(i_stim) + 1, figsize=(10, 5), sharex=True)
     for ii in range(len(i_stim)):
         input_current = get_step_current(100, 300, b2.ms,
                                          i_stim[ii] * current_unit)
         par['iapp'] = input_current
         st_mon = simulate_GPe_cell(par, par_sim)
         plot_data(st_mon, ax[ii], lw=1, c='k')
         plot_current(st_mon, ax[-1], current_unit)
         # plot_channel_currents(st_mon, ax[-1], current_unit)
     ax[0].set_xlim(0, 500)
     print("Done in {:.3f}".format(time() - start_time))
     plt.tight_layout()
     plt.savefig(filename)
     plt.close()