xseismogram, = mpl.plot([],[],'-k') mpl.xlim(0, duration) mpl.ylim(-0.05, 0.05) mpl.ylabel('Amplitude') mpl.subplot(3, 1, 2) mpl.title('z seismogram') zseismogram, = mpl.plot([],[],'-k') mpl.xlim(0, duration) mpl.ylim(-0.05, 0.05) mpl.ylabel('Amplitude') ax = mpl.subplot(3, 1, 3) mpl.title('time: 0.0 s') wavefield = mpl.imshow(background, extent=area, cmap=mpl.cm.gray_r, vmin=-0.00001, vmax=0.00001) mpl.points(stations, '^b', size=8) mpl.text(500000, 20000, 'Crust') mpl.text(500000, 60000, 'Mantle') fig.text(0.7, 0.31, 'Seismometer') mpl.xlim(area[:2]) mpl.ylim(area[2:][::-1]) mpl.xlabel('x (km)') mpl.ylabel('z (km)') mpl.m2km() times = np.linspace(0, dt*maxit, maxit) # This function updates the plot every few timesteps def animate(i): t, p, s, xcomp, zcomp = simulation.next() mpl.title('time: %0.1f s' % (times[t])) wavefield.set_array((background + p + s)[::-1]) xseismogram.set_data(times[:t+1], xcomp[0][:t+1]) zseismogram.set_data(times[:t+1], zcomp[0][:t+1])
mpl.ylabel('Amplitude') mpl.subplot(3, 1, 2) mpl.title('z seismogram') zseismogram, = mpl.plot([], [], '-k') mpl.xlim(0, duration) mpl.ylim(-0.05, 0.05) mpl.ylabel('Amplitude') ax = mpl.subplot(3, 1, 3) mpl.title('time: 0.0 s') wavefield = mpl.imshow(background, extent=area, cmap=mpl.cm.gray_r, vmin=-0.00001, vmax=0.00001) mpl.points(stations, '^b', size=8) mpl.text(500000, 20000, 'Crust') mpl.text(500000, 60000, 'Mantle') fig.text(0.7, 0.31, 'Seismometer') mpl.xlim(area[:2]) mpl.ylim(area[2:][::-1]) mpl.xlabel('x (km)') mpl.ylabel('z (km)') mpl.m2km() times = np.linspace(0, dt * maxit, maxit) # This function updates the plot every few timesteps def animate(i): t, p, s, xcomp, zcomp = simulation.next() mpl.title('time: %0.1f s' % (times[t])) wavefield.set_array((background + p + s)[::-1])
mpl.ylabel('twt (s)') mpl.title("Zero-offset section amplitude", fontsize=13, family='sans-serif', weight='bold') ax = mpl.subplot2grid((3, 4), (2, 0), colspan=4) # plot vmodel mpl.imshow(vmodel, extent=[0, nx, nz * ds, 0], cmap=mpl.pyplot.cm.bwr, aspect='auto', origin='upper') ax.autoscale(False) mpl.ylabel('depth (m)') stations = [[i, 0] for i in xrange(0, nx, disc)] mpl.points(stations, '^k', size=7) # zero-offset station points mpl.text(250, 120, '2900 m/s') # model velocities mpl.text(450, 315, '2500 m/s') mpl.text(250, 550, '3500 m/s') # thickness by lambda/4 2nd axis ax2 = ax.twiny() ax2.set_frame_on(True) ax2.patch.set_visible(False) ax2.xaxis.set_ticks_position('bottom') ax2.xaxis.set_label_position('bottom') ax2.spines['bottom'].set_position(('outward', 20)) def thick_function_thicknessbyres(x): l4 = 3000 / (f * 4) # average velocity resolution lambda 4 # pinchout thickness expression thick = 0
mpl.ylabel('Amplitude') mpl.subplot(3, 1, 2) mpl.title('Seismogram 2') seismogram2, = mpl.plot([], [], '-k') mpl.xlim(0, duration) mpl.ylim(-0.1, 0.1) mpl.ylabel('Amplitude') ax = mpl.subplot(3, 1, 3) mpl.title('time: 0.0 s') wavefield = mpl.imshow(background, extent=area, cmap=mpl.cm.gray_r, vmin=-0.005, vmax=0.005) mpl.points(stations, '^b', size=8) mpl.text(750000, 20000, 'Crust') mpl.text(740000, 100000, 'Mantle') fig.text(0.82, 0.33, 'Seismometer 2') fig.text(0.16, 0.33, 'Seismometer 1') mpl.ylim(area[2:][::-1]) mpl.xlabel('x (km)') mpl.ylabel('z (km)') mpl.m2km() times = np.linspace(0, dt * maxit, maxit) # This function updates the plot every few timesteps def animate(i): t, u, seismogram = simulation.next() mpl.title('time: %0.1f s' % (times[t])) wavefield.set_array((background + u)[::-1])
mpl.title("Seismogram 1") seismogram1, = mpl.plot([], [], "-k") mpl.xlim(0, duration) mpl.ylim(-0.1, 0.1) mpl.ylabel("Amplitude") mpl.subplot(3, 1, 2) mpl.title("Seismogram 2") seismogram2, = mpl.plot([], [], "-k") mpl.xlim(0, duration) mpl.ylim(-0.1, 0.1) mpl.ylabel("Amplitude") ax = mpl.subplot(3, 1, 3) mpl.title("time: 0.0 s") wavefield = mpl.imshow(background, extent=area, cmap=mpl.cm.gray_r, vmin=-0.005, vmax=0.005) mpl.points(stations, "^b", size=8) mpl.text(750000, 20000, "Crust") mpl.text(740000, 100000, "Mantle") fig.text(0.82, 0.33, "Seismometer 2") fig.text(0.16, 0.33, "Seismometer 1") mpl.ylim(area[2:][::-1]) mpl.xlabel("x (km)") mpl.ylabel("z (km)") mpl.m2km() times = np.linspace(0, dt * maxit, maxit) # This function updates the plot every few timesteps def animate(i): t, u, seismogram = simulation.next() mpl.title("time: %0.1f s" % (times[t])) wavefield.set_array((background + u)[::-1])
seismogram1, = mpl.plot([],[],'-k') mpl.xlim(0, duration) mpl.ylim(-0.1, 0.1) mpl.ylabel('Amplitude') mpl.subplot(3, 1, 2) mpl.title('Seismogram 2') seismogram2, = mpl.plot([],[],'-k') mpl.xlim(0, duration) mpl.ylim(-0.1, 0.1) mpl.ylabel('Amplitude') ax = mpl.subplot(3, 1, 3) mpl.title('time: 0.0 s') wavefield = mpl.imshow(background, extent=area, cmap=mpl.cm.gray_r, vmin=-0.005, vmax=0.005) mpl.points(stations, '^b', size=8) mpl.text(750000, 20000, 'Crust') mpl.text(740000, 100000, 'Mantle') fig.text(0.82, 0.33, 'Seismometer 2') fig.text(0.16, 0.33, 'Seismometer 1') mpl.ylim(area[2:][::-1]) mpl.xlabel('x (km)') mpl.ylabel('z (km)') mpl.m2km() times = np.linspace(0, dt*maxit, maxit) # This function updates the plot every few timesteps def animate(i): t, u, seismogram = simulation.next() mpl.title('time: %0.1f s' % (times[t])) wavefield.set_array((background + u)[::-1]) seismogram1.set_data(times[:t+1], seismogram[0][:t+1]) seismogram2.set_data(times[:t+1], seismogram[1][:t+1])
mpl.ylabel('twt (s)') mpl.subplot2grid((3, 4), (1, 0), colspan=4) # plot zero-offset traces traces = utils.matrix2stream(samples.transpose(), header={'delta': dt}) mpl.seismic_image(traces, cmap=mpl.pyplot.cm.jet, aspect='auto', ranges=[0, nx]) mpl.seismic_wiggle(traces, ranges=[0, nx], normalize=True) mpl.ylabel('twt (s)') mpl.title("Zero-offset section amplitude", fontsize=13, family='sans-serif', weight='bold') ax = mpl.subplot2grid((3, 4), (2, 0), colspan=4) # plot vmodel mpl.imshow(vmodel, extent=[0, nx, nz*ds, 0], cmap=mpl.pyplot.cm.bwr, aspect='auto', origin='upper') ax.autoscale(False) mpl.ylabel('depth (m)') stations = [[i, 0] for i in xrange(0, nx, disc)] mpl.points(stations, '^k', size=7) # zero-offset station points mpl.text(250, 120, '2900 m/s') # model velocities mpl.text(450, 315, '2500 m/s') mpl.text(250, 550, '3500 m/s') # thickness by lambda/4 2nd axis ax2 = ax.twiny() ax2.set_frame_on(True) ax2.patch.set_visible(False) ax2.xaxis.set_ticks_position('bottom') ax2.xaxis.set_label_position('bottom') ax2.spines['bottom'].set_position(('outward', 20)) def thick_function_thicknessbyres(x): l4 = 3000/(f*4) # average velocity resolution lambda 4 # pinchout thickness expression thick = 0 if x > 120: thick = 10 + (x-120)*0.2247