Skip to content
Snippets Groups Projects
util_dataframe.py 950 B
Newer Older
from util import couples320, get_customized_dataframe, get_path_finer_resol
def construct_df(proj=False, ratio_one=False):
    paths = []
vlabarre's avatar
vlabarre committed
    for N, Rb in sorted(couples320):
        if N == 2.9:
            continue
        path = get_path_finer_resol(N, Rb, proj, ratio_one=ratio_one)
        if path is not None:
            paths.append(path)

    if ratio_one:
        path = get_path_finer_resol(N=50, proj=proj, ratio_one=ratio_one)
vlabarre's avatar
vlabarre committed
        if path is not None:
            paths.append(path)
Pierre Augier's avatar
Pierre Augier committed

    if not paths:
        raise Exception(f"No simulations found ({proj = }, {ratio_one = })")

    print(f"Using {len(paths)} simulations")

    df = get_customized_dataframe(paths)

    df["k_max*lambda"] = df["k_max"] * df["lambda"]
    df["E"] = df["EA"] + df["EK"]
    df["ratio Ewaves"] = df["E_waves"] / df["E_waves_norm"]
    df = df[df["k_max*eta"] > 0.4]
vlabarre's avatar
vlabarre committed
df = construct_df(proj=False)
Pierre Augier's avatar
Pierre Augier committed
df_proj = construct_df(proj=True)