Exemple #1
0
    def plot_curve(cls, ax, curve, chl, state, infpower=None, *args, **kwargs):

        V = np.linspace(-80,50)*unit('mV')
        #V = StdLimits.get_default_voltage_array().rescale('mV')

        (alpha, beta) = chl.get_alpha_beta_at_voltage(V, state)
        (inf, tau) = InfTauCalculator.alpha_beta_to_inf_tau(alpha, beta)
        infpower = (np.power(inf, infpower) if infpower else None)
        plot_what_lut = {
            Curve.Alpha: (alpha, 'Rate Constant', None),
            Curve.Beta: (beta, 'Rate Constant', None),
            Curve.Inf: (inf, 'Steady-State', None),
            Curve.InfPowered: (infpower, 'Steady-State', None),
            Curve.Tau: (tau, 'Time-Constant', 'ms'),
            }
        (plot_what, y_label, y_unit) = plot_what_lut[curve]

            # print kwargs

        if isinstance(ax, QuantitiesAxisNew):

            ax.plot(V, plot_what, *args, **kwargs)
            ax.set_xlabel('Voltage')
            ax.set_ylabel(y_label)

            if y_unit:
                ax.set_yunit(unit(y_unit))
        else:

            ax.plot(V, plot_what, *args, **kwargs)
            ax.set_xlabel('Voltage (mV)')
            ax.set_ylabel(y_label)
Exemple #2
0
    def plot_inf_tau_curves(cls, ax1, ax2, calciumAlphaBetaBetaChannel, state):

        chl = calciumAlphaBetaBetaChannel

        V = StdLimits.get_default_voltage_array().rescale("mV")

        alpha, beta = cls.getResolvedAlphaBetaCurves(V, chl, state)
        inf, tau = InfTauCalculator.alpha_beta_to_inf_tau(alpha, beta)

        ax1.plot(V, inf)
        ax1.set_xlabel("Voltage")
        ax1.set_ylabel("Inf")

        ax2.setYUnit("ms")
        ax2.plot(V, tau)
        ax2.set_xlabel("Voltage")
        ax2.set_ylabel("Tau")
        def plot_inf_tau_curves(cls, ax1, ax2, calciumAlphaBetaBetaChannel, state):

            chl = calciumAlphaBetaBetaChannel

            V = StdLimits.get_default_voltage_array().rescale("mV")

            alpha, beta = cls.getResolvedAlphaBetaCurves(V, chl, state)
            inf, tau = InfTauCalculator.alpha_beta_to_inf_tau(alpha, beta)

            ax1.plot(V, inf)
            ax1.set_xlabel("Voltage")
            ax1.set_ylabel("Inf")

            ax2.setYUnit("ms")
            ax2.plot(V, tau)
            ax2.set_xlabel("Voltage")
            ax2.set_ylabel("Tau")