m_bs_qm_frequencies, m_bs_qm_intensities, m_bs_qm_snapnums_f = get_CO2_frequencies_d(outputfiles[CO2_type][method][basis_set][n_qm], do_4fs=True)
                        frequencies[CO2_type][method][basis_set][n_qm] = m_bs_qm_frequencies
                        intensities[CO2_type][method][basis_set][n_qm] = m_bs_qm_intensities
                        snapnums_f[CO2_type][method][basis_set][n_qm] = m_bs_qm_snapnums_f
        print("Parsing dipoles...")
        for CO2_type in CO2_types:
            dipoles[CO2_type] = dict()
            snapnums_d[CO2_type] = dict()
            for method in methods:
                dipoles[CO2_type][method] = dict()
                snapnums_d[CO2_type][method] = dict()
                for basis_set in outputfiles[CO2_type][method]:
                    dipoles[CO2_type][method][basis_set] = dict()
                    snapnums_d[CO2_type][method][basis_set] = dict()
                    for n_qm in (0, ):
                        m_bs_qm_dipoles, m_bs_qm_snapnums_d = get_dipoles_d(outputfiles[CO2_type][method][basis_set][n_qm])
                        dipoles[CO2_type][method][basis_set][n_qm] = m_bs_qm_dipoles
                        snapnums_d[CO2_type][method][basis_set][n_qm] = m_bs_qm_snapnums_d
        with open('frequencies.pypickle', 'wb') as picklefile:
            pickle.dump(frequencies, picklefile)
        with open('intensities.pypickle', 'wb') as picklefile:
            pickle.dump(intensities, picklefile)
        with open('dipoles.pypickle', 'wb') as picklefile:
            pickle.dump(dipoles, picklefile)
        with open('snapnums_frequencies.pypickle', 'wb') as picklefile:
            pickle.dump(snapnums_f, picklefile)
        with open('snapnums_dipoles.pypickle', 'wb') as picklefile:
            pickle.dump(snapnums_d, picklefile)

    elif args.parse_operation == "read":
        print("Reading frequency data from: {}".format(os.path.abspath('frequencies.pypickle')))
Beispiel #2
0
            with open('frequencies.pypickle', 'wb') as picklefile:
                pickle.dump(frequencies_CO2_d, picklefile)
            with open('intensities.pypickle', 'wb') as picklefile:
                pickle.dump(intensities_CO2_d, picklefile)
            with open('frequencies_noCT.pypickle', 'wb') as picklefile:
                pickle.dump(frequencies_noCT_CO2_d, picklefile)
            with open('intensities_noCT.pypickle', 'wb') as picklefile:
                pickle.dump(intensities_noCT_CO2_d, picklefile)
            with open('snapnums_frequencies.pypickle', 'wb') as picklefile:
                pickle.dump(snapnums_frequencies_d, picklefile)
            with open('snapnums_frequencies_noCT.pypickle', 'wb') as picklefile:
                pickle.dump(snapnums_frequencies_noCT_d, picklefile)

        if args.parse_dipoles:
            print("Parsing dipoles...")
            dipoles_0qm, snapnums_dipoles_0qm = get_dipoles_d(filenames_freq_0qm)
            dipoles_1qm, snapnums_dipoles_1qm = get_dipoles_d(filenames_freq_1qm)
            dipoles_2qm, snapnums_dipoles_2qm = get_dipoles_d(filenames_freq_2qm)
            dipoles_3qm, snapnums_dipoles_3qm = get_dipoles_d(filenames_freq_3qm)
            dipoles_d = {
                0: dipoles_0qm,
                1: dipoles_1qm,
                2: dipoles_2qm,
                3: dipoles_3qm,
            }
            snapnums_dipoles_d = {
                0: snapnums_dipoles_0qm,
                1: snapnums_dipoles_1qm,
                2: snapnums_dipoles_2qm,
                3: snapnums_dipoles_3qm,
            }