def analyse_RmpRiTau_trace(time, soma_voltage, stim_start, stim_end,
    current_amplitude):
    """Analyse the output of the RmpRiTau protocol"""
    import efel
    trace = {}
    trace['T'] = time
    trace['V'] = soma_voltage
    trace['stim_start'] = [stim_start]
    trace['stim_end'] = [stim_end]
    efel_results = efel.getFeatureValues([trace], ['voltage_base',
        'steady_state_voltage_stimend', 'decay_time_constant_after_stim'])
    voltage_base = efel_results[0]['voltage_base'][0]
    ss_voltage = efel_results[0]['steady_state_voltage_stimend'][0]
    dct = efel_results[0]['decay_time_constant_after_stim'][0]
    input_resistance = float(ss_voltage - voltage_base) / current_amplitude
    rmpritau_dict = {}
    rmpritau_dict['Rmp'] = '%.6g' % voltage_base
    rmpritau_dict['Rmp_Units'] = 'mV'
    rmpritau_dict['Rin'] = '%.6g' % input_resistance
    rmpritau_dict['Rin_Units'] = 'MOhm'
    rmpritau_dict['Tau'] = '%.6g' % dct
    rmpritau_dict['Tau_Units'] = 'ms'
    print('Resting membrane potential is %s %s' % (rmpritau_dict['Rmp'],
        rmpritau_dict['Rmp_Units']))
    print('Input resistance is %s %s' % (rmpritau_dict['Rin'],
        rmpritau_dict['Rin_Units']))
    print('Time constant is %s %s' % (rmpritau_dict['Tau'], rmpritau_dict[
        'Tau_Units']))
    import json
    with open('rmp_ri_tau.json', 'w') as rmpritau_json_file:
        json.dump(rmpritau_dict, rmpritau_json_file, sort_keys=True, indent
            =4, separators=(',', ': '))
