def plot_fi_curve(ax, label=''):
    io = NWBHDF5IO('fi_curve.nwb', 'r')
    nwbfile = io.read()

    _fi_plot = FIplot(ax)
    ii, ff = FI.get_fi_curve(nwbfile, "control_%g",
                             np.arange(0.03, 0.36, 0.01))
    _fi_plot.plot(ii * 1000, ff, color='black', label='Control')
    ii, ff = FI.get_fi_curve(nwbfile, "km0.5_%g", np.arange(0.03, 0.36, 0.01))
    _fi_plot.plot(ii * 1000, ff, color='pink', label='50% K$_M$')
    ii, ff = FI.get_fi_curve(nwbfile, "km0_%g", np.arange(0.03, 0.36, 0.01))
    _fi_plot.plot(ii * 1000, ff, color='red', label='No K$_M$')

    io.close()
Esempio n. 2
0
def get_rebound_spk(nwbfile,
                    fmtkey,
                    ic_stim,
                    stim_start=5000,
                    stim_end=7000,
                    tshift_init=0,
                    tshift_end=2000,
                    duration=[200, 500, 2000]):

    spk = {}

    for dur in duration:
        ii, ff = FI.get_fi_curve(nwbfile,
                                 fmtkey + '_' + str(dur),
                                 ic_stim,
                                 stim_start=(stim_start + dur),
                                 stim_end=(stim_start + dur + tshift_end),
                                 tshift=0)
        dd = get_deflection(nwbfile,
                            fmtkey + '_' + str(dur),
                            ic_stim,
                            stim_start=stim_start,
                            stim_end=(stim_start + dur))[1]

        spk[dur] = (np.array(dd), np.array(ff))

    print("done")
    return spk
def plot_vm_curve(ax,
                  shift=0.05,
                  stim_start=5000,
                  stim_end=7000,
                  xlim=[5000 - 50, 5760],
                  key='control',
                  color='black',
                  title=''):
    io = NWBHDF5IO('fi_curve.nwb', 'r')
    nwbfile = io.read()

    _fi_plot = VPlot(ax, title=title)

    _ii_rheobase_control = shift + FI.get_rheobase(
        *FI.get_fi_curve(nwbfile, "control_%g", np.arange(0.01, 0.36, 0.01)))
    print("injected current panel A: ", _ii_rheobase_control)
    trace = FI.analysis.read_trace(nwbfile,
                                   "%s_%g" % (key, _ii_rheobase_control),
                                   stim_start=stim_start,
                                   stim_end=stim_end)
    _fi_plot.plot(trace['T'], trace['V'], xlim=xlim, color=color)

    io.close()