import re


def get_frequencies(filename, header_row):
    """Read the used frequencies in header of DAS-1 SIP data set.

    Parameters
    ----------
    filename : str
        input filename
    header_row : int
        row number of header row

    Returns
    -------
    frequencies : list
        Contains the measured frequencies

    """

    fid = open(filename, 'r')
    lines = fid.readlines()
    freq_header = lines[header_row + 1].split('Hz')[:-1]
    frequencies = [re.sub(r"[^\d\.]", "", part) for part in freq_header]
    fid.close()
    return frequencies