def calculate_transition_path_length(tp_df, temperature, trans_type, REMD=False):
    """
    Calculate the length of the transition paths from MD and REMD for a particular
    transition at a given temperature. 
    """
    tp_trans_temp_df = tp_df[(tp_df.temperature == temperature) & (tp_df.type ==trans_type)]
    tp_length = tp_trans_temp_df.stop.values - tp_trans_temp_df.start.values
    if REMD:
       return tp_length, tp_trans_temp_df.fraction
    else:
         return tp_length