INNER CODE UNIT · Python

save_kappa

SMTG-Bham/ThermoParser · tp/cli/cli.py:981

def save_kappa(kappa_hdf5, direction, output):
    """Extracts kappa from Phono3py hdf5.

    Saves to text file.
    """

    f = tp.data.load.phono3py(kappa_hdf5, 'ltc')

    units = tp.settings.units()
    header = 'T({})'.format(units['temperature'])
    data = [f['temperature']]
    for d in direction:
        aniso = tp.data.utilities.resolve(f, 'lattice_thermal_conductivity',
                                          direction=d)
        header += ' kappa_{}({})'.format(d, units['lattice_thermal_conductivity'])
        data.append(aniso['lattice_thermal_conductivity'])

    np.savetxt('{}.dat'.format(output), np.transpose(data), header=header)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…