示例#1
0
    return z_sn, z_r


if __name__ == "__main__":

    import matplotlib as mpl
    mpl.use("Agg")
    import matplotlib.pyplot as plt

    with open('frequencies.pypickle', 'rb') as picklefile:
        frequencies_CO2_d = pickle.load(picklefile)
    with open('snapnums_frequencies.pypickle', 'rb') as picklefile:
        snapnums_frequencies_d = pickle.load(picklefile)

    frequencies_CO2_d = mangle_dict_keys(frequencies_CO2_d)
    snapnums_frequencies_d = mangle_dict_keys(snapnums_frequencies_d)

    assert frequencies_CO2_d.keys() == snapnums_frequencies_d.keys()
    for n_qm in frequencies_CO2_d:
        assert frequencies_CO2_d[n_qm].keys() == snapnums_frequencies_d[n_qm].keys()

    # For dictionary access:
    # n_qm, then n_mm

    snapnums = read_snapshot_file("/home/eric/Chemistry/calc.sgr/droplets/inputs_freq/representative_snapshots_3qm")

    z3_sn, z3_f = sort(3, 0, snapnums_frequencies_d, frequencies_CO2_d, snapnums)
    z2_sn, z2_f = sort(2, 0, snapnums_frequencies_d, frequencies_CO2_d, snapnums)
    z1_sn, z1_f = sort(1, 0, snapnums_frequencies_d, frequencies_CO2_d, snapnums)
    z0_sn, z0_f = sort(0, 0, snapnums_frequencies_d, frequencies_CO2_d, snapnums)
示例#2
0
    # Until I come up with a better idea, here's where I mangle some
    # of the keys (253, 254, 255, 256) into 256.

    # Make a copy beforehand...
    frequencies_CO2_d_unmangled = deepcopy(frequencies_CO2_d)
    intensities_CO2_d_unmangled = deepcopy(intensities_CO2_d)
    frequencies_noCT_CO2_d_unmangled = deepcopy(frequencies_noCT_CO2_d)
    intensities_noCT_CO2_d_unmangled = deepcopy(intensities_noCT_CO2_d)
    dipoles_d_unmangled = deepcopy(dipoles_d)
    snapnums_frequencies_d_unmangled = deepcopy(snapnums_frequencies_d)
    snapnums_frequencies_noCT_d_unmangled = deepcopy(snapnums_frequencies_noCT_d)
    snapnums_dipoles_d_unmangled = deepcopy(snapnums_dipoles_d)

    # Do the mangling.
    frequencies_CO2_d = mangle_dict_keys(frequencies_CO2_d)
    intensities_CO2_d = mangle_dict_keys(intensities_CO2_d)
    frequencies_noCT_CO2_d = mangle_dict_keys(frequencies_noCT_CO2_d)
    intensities_noCT_CO2_d = mangle_dict_keys(intensities_noCT_CO2_d)
    dipoles_d = mangle_dict_keys(dipoles_d)
    snapnums_frequencies_d = mangle_dict_keys(snapnums_frequencies_d)
    snapnums_frequencies_noCT_d = mangle_dict_keys(snapnums_frequencies_noCT_d)
    snapnums_dipoles_d = mangle_dict_keys(snapnums_dipoles_d)

    possible_keys = list(range(0, 18, 2)) + [32, 64, 128, 256]

    markers = [
        'o',
        's',
        'D',
        '*',