def plot_shotrecord(rec, model, t0, tn, colorbar=True):
"""
Plot a shot record (receiver values over time).
:param rec: Receiver data with shape (time, points)
:param model: :class:`Model` object that holds the velocity model.
:param t0: Start of time dimension to plot
:param tn: End of time dimension to plot
"""
scale = np.max(rec) / 10.
extent = [model.origin[0], model.origin[0] + 1e-3*model.domain_size[0],
1e-3*tn, t0]
plot = plt.imshow(rec, vmin=-scale, vmax=scale, cmap=cm.gray, extent=extent)
plt.xlabel('X position (km)')
plt.ylabel('Time (s)')
# Create aligned colorbar on the right
if colorbar:
ax = plt.gca()
divider = make_axes_locatable(ax)
cax = divider.append_axes("right", size="5%", pad=0.05)
plt.colorbar(plot, cax=cax)
plt.show()
评论列表
文章目录