Beispiel #1
0
def setup_stress_to_spike(data):
    data['spike_time'], data['fr_inst'] = stress_to_fr_inst(
        data['fine_time'], data['fine_stress'], MC_GROUPS, **params)
    data['interp_time'], data['interp_stress'] = get_interp_stress(
        interp_static_displ)
    data['extrap_time'], data['extrap_stress'] = get_interp_stress(
        extrap_static_displ)
Beispiel #2
0
def setup_stress_to_spike(data):
    data['spike_time'], data['fr_inst'] = stress_to_fr_inst(
        data['fine_time'], data['fine_stress'], MC_GROUPS, **params)
    data['interp_time'], data['interp_stress'] = get_interp_stress(
        interp_static_displ)
    data['extrap_time'], data['extrap_stress'] = get_interp_stress(
        extrap_static_displ)
Beispiel #3
0
def get_data_dicts(stim, animal=None, rec_dict=None):
    if rec_dict is None:
        rec_dict = load_rec(animal)
    # Read recording data
    rec_fr_inst = rec_dict['fr_inst_list'][stim]
    rec_spike_time = rec_dict['spike_time_list'][stim]
    rec_fr_roll = rec_dict['fr_roll_list'][stim]
    static_displ = rec_dict['static_displ_list'][stim]
    rec_data_dict = {
        'rec_spike_time': rec_spike_time,
        'rec_fr_inst': rec_fr_inst,
        'rec_fr_roll': rec_fr_roll}
    # Read model data
    time, stress = get_interp_stress(static_displ)
    max_time = rec_dict['max_time_list'][stim]
#    stretch_coeff = 1 + 0.25 * static_displ / REF_DISPL
    stretch_coeff = 1 + 0.4 * static_displ / REF_DISPL
    stress = adjust_stress_ramp_time(time, stress, max_time, stretch_coeff)
    mod_data_dict = {
        'groups': MC_GROUPS,
        'time': time,
        'stress': stress}
    fit_data_dict = dict(list(rec_data_dict.items()) +
                         list(mod_data_dict.items()))
    data_dicts = {
        'rec_data_dict': rec_data_dict,
        'mod_data_dict': mod_data_dict,
        'fit_data_dict': fit_data_dict}
    return data_dicts
Beispiel #4
0
def get_data_dicts(stim, animal=None, rec_dict=None):
    if rec_dict is None:
        rec_dict = load_rec(animal)
    # Read recording data
    rec_fr_inst = rec_dict['fr_inst_list'][stim]
    rec_spike_time = rec_dict['spike_time_list'][stim]
    rec_fr_roll = rec_dict['fr_roll_list'][stim]
    static_displ = rec_dict['static_displ_list'][stim]
    rec_data_dict = {
        'rec_spike_time': rec_spike_time,
        'rec_fr_inst': rec_fr_inst,
        'rec_fr_roll': rec_fr_roll
    }
    # Read model data
    time, stress = get_interp_stress(static_displ)
    max_time = rec_dict['max_time_list'][stim]
    #    stretch_coeff = 1 + 0.25 * static_displ / REF_DISPL
    stretch_coeff = 1 + 0.4 * static_displ / REF_DISPL
    stress = adjust_stress_ramp_time(time, stress, max_time, stretch_coeff)
    mod_data_dict = {'groups': MC_GROUPS, 'time': time, 'stress': stress}
    fit_data_dict = dict(
        list(rec_data_dict.items()) + list(mod_data_dict.items()))
    data_dicts = {
        'rec_data_dict': rec_data_dict,
        'mod_data_dict': mod_data_dict,
        'fit_data_dict': fit_data_dict
    }
    return data_dicts
Beispiel #5
0
def test_get_interp_stress(load_data):
    interp_time, interp_stress = get_interp_stress(interp_static_displ)
    extrap_time, extrap_stress = get_interp_stress(extrap_static_displ)
    assert np.allclose(interp_stress, load_data['interp_stress'])
    assert np.allclose(extrap_stress, load_data['extrap_stress'])
def test_get_interp_stress(load_data):
    interp_time, interp_stress = get_interp_stress(interp_static_displ)
    extrap_time, extrap_stress = get_interp_stress(extrap_static_displ)
    assert np.allclose(interp_stress, load_data['interp_stress'])
    assert np.allclose(extrap_stress, load_data['extrap_stress'])