Exemplo n.º 1
0
# In[ ]:

#---matrices---#

BWH_Keys, BWH_Ps = [], []

for d_ in depths_:
    print(f"\t current depth={d_}..")
    segments_ = gbc.bumps_with_flat(d_)

    scatter_ = lambda x, y: gbc.billiard_cell(
        init_angle_=x, position_=y, angle_only_=True, boundary_=segments_)

    P, theta_partition = gbc.finite_P(scatter_=scatter_,
                                      entry_N=2 * (10**4),
                                      theta_N=500)

    BWH_Ps.append(P)
    BWH_Keys.append(d_)

BWH_Keys, BWH_Ps = np.array(BWH_Keys), np.array(BWH_Ps)

# In[15]:

np.save(file=BWHole_path_ + "keys.npy", arr=BWH_Keys, allow_pickle=False)
np.save(file=BWHole_path_ + "p_mats.npy", arr=BWH_Ps, allow_pickle=False)
np.save(file=BWHole_path_ + "theta_partition.npy",
        arr=theta_partition,
        allow_pickle=False)
##---paths---#
BWWall_path_ = "../newdat/bumps_with_wall_redo_part1_high_K/"
if not os.path.isdir(BWWall_path_):
    print("directory created for bumps with wall part1")
    os.mkdir(BWWall_path_)

BumpWall_Keys, BumpWall_Ps = [], []
for h_ in heights_:
    print(f"\t current width={w_} height={h_}...")
    segments_ = gbc.bumps_with_wall_redo(radius_=r_,
                                         wall_width_=w_,
                                         wall_height_=h_)

    scatter_ = lambda x, y: gbc.billiard_cell(
        init_angle_=x, position_=y, angle_only_=True, boundary_=segments_)

    P, theta_partition = gbc.finite_P(scatter_=scatter_,
                                      entry_N=3 * (10**4),
                                      theta_N=500,
                                      scale_=cell_len)

    BumpWall_Ps.append(P)
    BumpWall_Keys.append(np.array([h_, r_, w_]))
BumpWall_Keys, BumpWall_Ps = np.array(BumpWall_Keys), np.array(BumpWall_Ps)

np.save(file=BWWall_path_ + "keys.npy", arr=BumpWall_Keys, allow_pickle=False)
np.save(file=BWWall_path_ + "p_mats.npy", arr=BumpWall_Ps, allow_pickle=False)
np.save(file=BWWall_path_ + "theta_partition.npy",
        arr=theta_partition,
        allow_pickle=False)
        print(f"directory created at {BWWall_path_}")
        os.mkdir(BWWall_path_)

    print(f"Entry Sampling {int(mult_*(10**3))}...")

    BumpWall_Keys, BumpWall_Ps = [], []
    for d_ in dims_:
        print(f"\t current dimension={d_}...")
        segments_ = gbc.bumps_family(2)

        scatter_ = lambda x, y: gbc.billiard_cell(
            init_angle_=x, position_=y, angle_only_=True, boundary_=segments_)

        #print("starting on P...")
        P, theta_partition = gbc.finite_P(scatter_=scatter_,
                                          entry_N=int(mult_ * (10**3)),
                                          theta_N=d_)

        BumpWall_Ps.append(P)
        BumpWall_Keys.append(d_)

    # convert to numpy array
    BumpWall_Keys, BumpWall_Ps = np.array(BumpWall_Keys), np.array(BumpWall_Ps)

    # save out files
    np.save(file=BWWall_path_ + "keys.npy",
            arr=BumpWall_Keys,
            allow_pickle=True)
    np.save(file=BWWall_path_ + "p_mats.npy",
            arr=BumpWall_Ps,
            allow_pickle=True)