def get_sets(df_raw, num=0):
    """
    Group raw data into measurement sets conducted at the same temperature.

    Parameters
    ----------
    df_raw : pandas.DataFrame
        Raw measurement data. 
    num : int, optional 
        Number of measurement points per temperature level.
        Default is 0, which means that the number of measurement points 
        within a set is evaluated based on the provided frequency range 
        of the measurement points. The first occurance of the 
        maximum frequency is used to identify the number of measurement points
        per temperature level.

    Returns
    -------
    df_raw : pandas.DataFrame
        Contains additional column `Set` compared to input data frame.

    Notes
    -----
    This function is intended to be used in combination with input files provided
    by the Eplexor software. Hence, it is limited to measurements in the 
    frequency domain.
    """
    iset = -1
    lset = []
    if num == 0: #Identify measurement sets based on frequency range
        num = df_raw['f_set'].idxmax()+1
    for i in range(df_raw.shape[0]):
        if i%num == 0:
            iset += 1
        lset.append(iset)
    df_raw['Set'] = lset
    return df_raw