<jupyter_start><jupyter_text>data_index = 5path = '/var/tmp/passiveseismic/Rhythm/modeling/'f = open(path + 'bmhsm'+str(data_index)+'.rsf@', 'rb')bm = np.fromfile(f, dtype = 'float32')bm = bm.reshape((nz, nx), order = 'f')plt.figure()plt.imshow(bm)plt.show() plt.close()<jupyter_code>## Path of data
path = '/var/tmp/passiveseismic/Rhythm/modeling/'
## Dimensions
nx = 391
nz = 91
nt = 1501
dims2 = [nz,nx]
dims3 = [nz, nx, nt]
def open_bin(bin_file, dims):

    file = open(path + bin_file, 'rb')
    M = np.fromfile(file, dtype = 'float32')
    M = M.reshape(dims, order = 'f')

    return M
# Generating Matrix Data
def matrix_data(data_index):

    P = 'Pmovie'+str(data_index)+'.rsf@'
    Z = 'Zmovie'+str(data_index)+'.rsf@'
    X = 'Xmovie'+str(data_index)+'.rsf@'

    Vel = 'bmhsm'+str(data_index)+'.rsf@'

    PM = open_bin(P, dims3)
    ZM = open_bin(Z, dims3)
    XM = open_bin(X, dims3)

    VelM = open_bin(Vel, dims2)
    
    return PM, ZM, XM, VelM<jupyter_output><empty_output><jupyter_text>Plot Data<jupyter_code>def plot(data_index):
    
    Wiggle, In_Target, Out_Model_Predict = matrix_data(data_index)
    
    a = np.max(PM)
    b = np.min(PM)


    fig = plt.figure()
    ax = fig.add_subplot(411)
    ax1 = fig.add_subplot(412)
    ax2 = fig.add_subplot(413)
    ax3 = fig.add_subplot(414)
    fig.show()

    i = 0
    ax.imshow(VelM)
    while i<nt:
        ax1.cla()
        ax2.cla()
        ax3.cla()
    
        ax1.imshow(PM[:,:,i])  #, vmax = a-0.5, vmin = b+0.5

        ax2.imshow(XM[:,:,i], cmap = 'gray')  #, vmax = a, vmin = b

        ax3.imshow(ZM[:,:,i], cmap = 'gray')  #, vmax = a, vmin = b

        fig.canvas.draw()

        #time.sleep(1)
        i += 10

    plt.close()
    return
plt.close()
plot(50)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18013468013468015, 'fraction_numerical': 0.02861952861952862, 'mean_word_length': 2.953436807095344, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '356297', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 824, 'n_tokens_neox': 773, 'n_words': 135, 'path': 'plot_test2.ipynb', 'repo_name': 'droxliang/ghw2019_wiggles', 'size': '1782'}