Beispiel #1
0
def load_current(data_dir, protocol='rampIV', ramp_amp=3.1):
    '''
    Loads the current from recorded dataset.abs

    protocol: 'rampIV', 'IV', 'Zap20'
    ramp_amp:   steps of 0.05 -0.15

    * ramp_amp for rampIV=3.1, ramp_amp for 'IV'=1
    '''
    v_shift = -16  # shift for accounting for the liquid junction potential

    if protocol == 'Zap20':
        sweep_idx = 0
    else:
        sweep_idx = get_sweep_index_for_amp(ramp_amp, protocol)

    v, t = get_v_and_t_from_heka(data_dir, protocol, sweep_idxs=[sweep_idx])
    v = shift_v_rest(v[0], v_shift)
    t = t[0]
    dt = t[1] - t[0]

    I, t_on, t_off = get_i_inj_from_function(protocol, [sweep_idx], t[-1], dt,
                                             return_discontinuities=False)

    return I[0], v, t, t_on, t_off, dt
observables = {
    'loss.lprobs', 'imputation_values', 'h1.mW', 'h1.mb', 'h2.mW', 'h2.mb',
    'weights.mW', 'weights.mb', 'means.mW0', 'means.mW1', 'means.mb0',
    'means.mb1', 'precisions.mW0', 'precisions.mW1', 'precisions.mb0',
    'precisions.mb1'
}

# Load the current
data_dir = '/home/alteska/Desktop/LFI_DAP/data/rawData/2015_08_26b.dat'  # best cell
protocol = 'rampIV'  # 'IV' # 'rampIV' # 'Zap20'
ramp_amp = 3.1  # steps of 0.05 -0.15
v_shift = -16  # shift for accounting for the liquid junction potential

sweep_idx = get_sweep_index_for_amp(ramp_amp, protocol)

v, t = get_v_and_t_from_heka(data_dir, protocol, sweep_idxs=[sweep_idx])
v = shift_v_rest(v[0], v_shift)
t = t[0]
dt = t[1] - t[0]
I, t_on, t_off = get_i_inj_from_function(protocol, [sweep_idx],
                                         t[-1],
                                         t[1] - t[0],
                                         return_discontinuities=False)
I = I[0]

params, labels = obs_params_gbar(reduced_model=False)

# Set up themodel
dap = DAPcython(-75, params * 10)
U = dap.simulate(dt, t, I)