import f_time_frequency as tf
import f

#%% microseismic data  ########################################

s1 = np.array(pd.read_csv("data/micro.csv", header=None))
#fig, ax = plt.subplots(figsize=(10,8))
#ax.imshow(s1,interpolation='quadric', aspect='auto',vmax=1000,vmin=-1000)

min_max_scaler = preprocessing.MaxAbsScaler()
s1 = min_max_scaler.fit_transform(s1)

dt = 0.002
nt = s1.shape[0]

fig, ax = f.seisplot_wig(s1, lw=0.8)
ax.set_yticks(np.arange(0, nt + 1, 50))
ax.set_yticklabels(np.arange(0, nt + 1, 50) * dt)
#fig.savefig('fig/micro.pdf', dpi=200)

t = np.arange(400) * dt * 1000
cwtmatr, freqs = tf.spectrum_cwt(t,
                                 s1[:, 13],
                                 wavelet='morl',
                                 widths=200,
                                 cmap='RdBu',
                                 colorscale=1,
                                 contour_dvision=41,
                                 freqmax=100,
                                 figsize=(12, 3),
                                 plot=True,
Esempio n. 2
0
length = int(tw / tinc)
classes = 2

cbar_binary = ListedColormap(["darkgray", "yellow"])

tr_num = 260  # trace number

#%%
Obsfb = f.fb_pick_gather_wholetrace(Obs,
                                    fb_tr_step=10,
                                    method='kmeans',
                                    w=21,
                                    c=2)
fig, ax = f.seisplot_wig(
    Obs,
    inc=10,
    scale=30,
    lw=0.2,
)
#ax.scatter(Obsfb[:,0],Obsfb[:,1], s=30,facecolors='none',edgecolors='r',lw=1)
ax.set_yticks(np.arange(0, nt + 1, 400))
ax.set_yticklabels(np.arange(0, nt + 1, 400) * dt)
ax.set_xticks(np.arange(0, 967, 100))
ax.set_xticklabels(np.arange(0, 967, 100) / 10)
#fig.savefig('fig/obs', dpi=200)

#%% samples generate for one trace

#obs = Obs[:,tr_num]
#fig, axe = plt.subplots(figsize=(12,3))
#axe.plot(np.arange(len(obs)), obs, 'k', lw=1)
#axe.set_ylabel('Amplitude', fontsize=13)