def read_phonopy_dat_file(filename):
    """
    read .dat file from phonopy
    for reading yaml see self.read_phonopy_data()
    should be probably combined

    freq - frequency in THz
    tot - total energy for freq
    """
    dos = {'tot': [], 'freq': []}
    with open(filename, 'r') as f:
        f.readline()
        for line in f:
            val = line.split()
            dos['freq'].append(float(val[0]))
            dos['tot'].append(float(val[1]))
    return dos
