Esempio n. 1
0
def propane_make_figures(data_dir, species_path=False):
    """
    make figures for propane system
    """
    g_s = global_settings.get_setting(data_dir)

    spe_idx, _, spe_exclude_name = trajectory.get_species_with_top_n_concentration(
        data_dir,
        exclude=None,
        top_n=g_s['top_n_s'],
        traj_max_t=g_s['traj_max_t'],
        tau=g_s['tau'],
        end_t=g_s['end_t'],
        tag=g_s['tag'],
        atoms=[g_s['atom_f']])
    mf.plot_concentrations(data_dir,
                           spe_idx=spe_idx,
                           tau=g_s['tau'],
                           end_t=g_s['end_t'],
                           tag=g_s['tag'],
                           exclude_names=spe_exclude_name,
                           renormalization=True)
    mf.plot_reaction_rates(data_dir,
                           reaction_idx=[1068, 1070, 1072, 1074, 1076],
                           tau=g_s['tau'],
                           end_t=1.0,
                           tag=g_s['tag'])
    for s_i in spe_idx:
        print(spe_idx)
        mf.plot_species_pathway_prob(data_dir,
                                     top_n=g_s['top_n_p'],
                                     exclude_names=spe_exclude_name,
                                     init_spe=g_s['init_s'],
                                     atom_followed=g_s['atom_f'],
                                     tau=g_s['tau'],
                                     end_t=g_s['end_t'],
                                     end_s_idx=s_i,
                                     species_path=species_path)
    mf.plot_reaction_rate_constant(data_dir)
    mf.plot_top_n_spe_concentration(data_dir,
                                    exclude_names=None,
                                    atom_followed=g_s['atom_f'],
                                    end_t=g_s['end_t'],
                                    top_n=10)
Esempio n. 2
0
def get_suffix(data_dir,
               init_spe=None,
               atom_followed=None,
               end_t=None,
               len_threshold=100):
    """
    get suffix
    """
    g_s = global_settings.get_setting(data_dir)
    suffix = ""
    if init_spe is None:
        suffix += "_S" + str(g_s['init_s'])
    else:
        suffix += "_S" + str(init_spe)
    if atom_followed is None:
        suffix += "_" + str(g_s['atom_f'])
    else:
        suffix += "_" + str(atom_followed)
    if end_t is None:
        suffix += "_" + str(g_s['end_t'])
    else:
        suffix += "_" + str(end_t)
    # add mc_n_traj
    suffix += "_" + str(int(g_s['mc_n_traj']))
    # add pi_n_traj
    suffix += "_" + str(int(g_s['pi_n_traj']))
    # add top_n_p
    suffix += "_" + str(int(g_s['top_n_p']))
    # path reg
    if len(suffix) < len_threshold and g_s['path_reg'] is not None:
        suffix += "_include_" + str(valid_name(g_s['path_reg']))
    # no path reg
    if len(suffix) < len_threshold and g_s['no_path_reg'] is not None:
        suffix += "_exclude_" + str(valid_name(g_s['no_path_reg']))

    if len(suffix) > len_threshold:
        suffix = suffix[0:len_threshold]
    if len(suffix) > 0 and suffix[-1] == '_':
        suffix = suffix[0:-1]
    return suffix
Esempio n. 3
0
        if indicator is True:
            rxn_idx_good.append(int(rxn_idx))
            rxn_name_good.append(reaction_info[rxn_idx]['reaction_name'])
            if p_reactant != -1:
                rxn_principal_reactant.append(p_reactant)
    print(rxn_idx_good)
    print(rxn_name_good)
    print(rxn_principal_reactant)
    return rxn_idx_good, rxn_principal_reactant


if __name__ == "__main__":
    DATA_DIR = os.path.abspath(
        os.path.join(os.path.realpath(sys.argv[0]), os.pardir, os.pardir,
                     os.pardir, os.pardir, "SOHR_DATA"))
    G_S = global_settings.get_setting(DATA_DIR)

    # species_count(DATA_DIR)
    reaction_count(DATA_DIR, top_n=100, norm=True)
    # initiation_reaction_count(DATA_DIR)
    # species_cycle(DATA_DIR)
    # print(parse_species_production_path("S114R15S9R15S9", 'S9'))
    # species_production_path(DATA_DIR, spe='OH', top_n=50)
    # print(parse_species_production_reaction("S114R15S9R47S9", 'S9'))
    # species_production_reaction(DATA_DIR, spe='OH', top_n=50)

    # SPE_LIST = [14, 59, 17, 44, 38, 86,  69, 15, 82]
    # for es in SPE_LIST:
    #     path_length_statistics(
    #         DATA_DIR, init_spe=G_S['init_s'], atom_followed=G_S['atom_f'], end_t=G_S['end_t'], end_spe=es)