def create_theta_spike(pad, prop0, prop1, theta, f, points, reflectivity_method): ''' Create a 2D array where the first dimension is time and the second is angle. :param pad: pad the array top and bottom in ms :param prop0: rock properties 1 :param prop1: rock properties 1 :param theta: array of angles :param f: the frequency for the wavelet ''' nsamples = (2 * pad) array_amp = np.zeros([nsamples, theta.size]) Rp = reflectivity_method(prop0, prop1, theta) array_amp[pad, :] += Rp r = ricker_alg(.2,points, f) warray_amp = np.zeros([max(array_amp.shape[0], r.shape[0]), array_amp.shape[1]]) for i in range(theta.size): warray_amp[:, i] = np.convolve(array_amp[:, i], r, mode='same') return np.array(warray_amp)
def run_script(args): matplotlib.interactive(False) array_amp = np.zeros([args.time]) array_time = np.arange(args.time) Rpp = args.reflectivity_model(args.Rpp0, args.Rpp1, args.theta1) array_amp[args.time // 2] = Rpp r = ricker_alg(1,128, args.f) warray_amp = np.convolve(array_amp, r, mode='same') fig = plt.figure() ax1 = fig.add_subplot(111) ax1.plot(warray_amp, array_time) plt.title(args.title % locals()) plt.ylabel('time (ms)') plt.xlabel('amplitude') ax = plt.gca() ax.set_ylim(ax.get_ylim()[::-1]) ax.set_xlim(args.xlim) return return_current_figure()
def create_wedge(ntraces, pad, max_thickness, prop0, prop1, theta, f, reflectivity_method): ''' Create a wedge model. :param ntraces: number of traces :param pad: pad the array top and bottom in ms :param max_thickness: The thickest part of the wedge :param prop0: rock properties 1 :param prop1: rock properties 1 :param theta: angle of incidence :param f: the frequency for the wavelet ''' scale = 10 nsamples = (2 * pad + max_thickness) * scale array_amp = np.zeros([nsamples, ntraces]) fwedge = np.floor(np.linspace(pad * scale, (pad + max_thickness) * scale, ntraces, endpoint=False)) wedge = np.array(fwedge, dtype=int) Rp0 = reflectivity_method(prop0, prop1, theta) Rp1 = reflectivity_method(prop1, prop0, theta) array_amp[pad * scale, :] += Rp0 array_amp[wedge, np.arange(ntraces)] += Rp1 r = ricker_alg(0.2, 100 * scale, f) warray_amp = np.zeros([max(array_amp.shape[0], r.shape[0]), array_amp.shape[1]]) for i in range(ntraces): warray_amp[:, i] = np.convolve(array_amp[:, i], r, mode='same') return np.array(warray_amp[::scale, :])