Esempio n. 1
0
def run_short_squares(cell_id,
                      model_type,
                      neuron_config,
                      pulses,
                      total_time=1000.0,
                      dt=0.005):
    """Generates a series of square injection currents

    Parameters
    ----------
    cell_id : ID of cell speciment
    model_type : LIF, LIF-R, LIF-R-ASC, LIF-ASC, LIF-R-ASC-A
    pulse_time : A list of tuples (start_time (ms), end_time (ms), amplitude (Amps))
    """
    ret = {}

    amp_times = [0.0]
    amp_values = [0.0]
    for p in pulses:
        amp_times += [p[0], p[0] + p[1]]
        amp_values += [p[2], 0.0]

    output = runNestModel(model_type, neuron_config, amp_times, amp_values, dt,
                          total_time)

    ret['times'] = output[0]
    ret['voltages'] = output[1]
    ret['spike_times'] = output[2]

    I = plotter.get_step_trace(amp_times, amp_values, dt, total_time)
    ret['I'] = I
    ret['dt'] = dt

    return ret
Esempio n. 2
0
def run_long_square(cell_id,
                    model_type,
                    neuron_config,
                    pulse_time,
                    amplitude,
                    total_time=1000.0,
                    dt=0.005):
    """Generates a single long constant injection current

    Parameters
    ----------
    cell_id : ID of cell speciment
    model_type : LIF, LIF-R, LIF-R-ASC, LIF-ASC, LIF-R-ASC-A
    pulse_time : A tuple 0 <= (start_time, end_time) <= total_time, in ms
    ampltiude : Amps of input current
    """
    ret = {}

    amp_times = [0.0, pulse_time[0], pulse_time[1]]
    amp_values = [0.0, amplitude, 0.0]
    output = runNestModel(model_type, neuron_config, amp_times, amp_values, dt,
                          total_time)

    ret['times'] = output[0]
    ret['voltages'] = output[1]
    ret['spike_times'] = output[2]

    I = plotter.get_step_trace(amp_times, amp_values, dt, total_time)
    ret['I'] = I
    ret['dt'] = dt

    return ret