def get_chosen_df(processed_cycler_run, diag_pos):
    """
    This function narrows your data down to a dataframe that contains only the diagnostic cycle number you
    are interested in.

    Args:
        processed_cycler_run (beep.structure.ProcessedCyclerRun)
        diag_pos (int): diagnostic cycle occurence for a specific <diagnostic_cycle_type>. e.g.
        if rpt_0.2C, occurs at cycle_index = [2, 37, 142, 244 ...], <diag_pos>=0 would correspond to cycle_index 2.

    Returns:
        a datarame that only has the diagnostic cycle you are interested in, and there is a column called
        'diagnostic_time[h]' starting from 0 for this dataframe.
    """

    data = processed_cycler_run.diagnostic_interpolated
    hppc_cycle = data.loc[data.cycle_type == "hppc"]
    hppc_cycle = hppc_cycle.loc[hppc_cycle.current.notna()]
    cycles = hppc_cycle.cycle_index.unique()
    diag_num = cycles[diag_pos]

    selected_diag_df = hppc_cycle.loc[hppc_cycle.cycle_index == diag_num]
    selected_diag_df = selected_diag_df.sort_values(by="test_time")
    selected_diag_df["diagnostic_time"] = (selected_diag_df.test_time - selected_diag_df.test_time.min()) / 3600

    return selected_diag_df