Example #1
0
def plot_vnmo(cmp_gather, offsets, vnmo, dt, inc=70,
              vmin=None, vmax=None, aspect='auto'):
    r"""
    Given nmo functions defined by t0 and vnmo, draw
    it over the specified gather using `seismic_image`

    Parameters:

    * cmp_gather : 2D-array
        traces of this gather from near to far-offset
        (nsamples, ntraces)
    * offsets : 1D-array
        off-sets for each cmp in this gather
        in the same sequence as ntraces
    * vnmo : 1D-array
        velocity parameter of all nmo functions for this cmp gather
        must have same size as (nsamples)
    * dt : float
        sample rate
    * inc: int
        plotting option, step in time samples between hyperbolas
        to avoid overlapping totally the seismic image bellow
    * vmin, vmax : float
        min and max values for imshow
    * aspect : float
        matplotlib imshow aspect parameter, ratio between axes


    Returns:

    * cmp_nmo : 2D array
        nmo corrected cmp traces

    """
    ns, nx = cmp_gather.shape

    for i in range(0, ns, inc): # each (t0, vnmo) hyperbola
        t0 = i*dt
        t = np.sqrt(t0**2+(offsets/vnmo[i])**2)
        mpl.seismic_image(cmp_gather, dt, aspect=aspect, vmin=vmin, vmax=vmax)
        mpl.plot(range(nx), t, '+b')
Example #2
0
# fetch sample SEGY data, near-offset marmousi data
url = "http://dl.dropboxusercontent.com/" \
      "s/i287ci4ww3w7gdt/marmousi_nearoffset.segy"
urllib.urlretrieve(url, 'marmousi_nearoffset.segy')
# We'll use the ObsPy library to load the SEGY data"
segyfile = segy.readSEGY('marmousi_nearoffset.segy')
# turn ObsPy Stream in a matrix of traces
# first dimension time, second dimension traces
ntraces = len(segyfile.traces)
nsamples = len(segyfile.traces[0].data)
mtraces = np.zeros((nsamples, ntraces))
i = 0
for tr in segyfile.traces:
    mtraces[:, i] = tr.data[:]
    i += 1
# make plots
mpl.figure()
mpl.subplot(2, 1, 1)
mpl.ylabel('time (seconds)')
mpl.title("Seismic wiggle plot", fontsize=13, family='sans-serif',
          weight='bold')
# plot using wiggle
mpl.seismic_wiggle(mtraces, scale=10**-4)
mpl.subplot(2, 1, 2)
mpl.ylabel('time (seconds)')
mpl.title("Seismic image plot", fontsize=13, family='sans-serif',
          weight='bold')
# plot using image
mpl.seismic_image(mtraces, aspect='auto')
mpl.show()
Example #3
0
vel_l = conv.depth_2_time(velocity, velocity, dt=2e-3, dz=1)
# and we'll assume the density is homogeneous
rho_l = 2200 * np.ones(np.shape(vel_l))
# With that, we can calculate the reflectivity model in time
rc = conv.reflectivity(vel_l, rho_l)
# and finally perform our convolution
synt = conv.convolutional_model(rc, 30, conv.rickerwave, dt=2e-3)

# We can use the utility function in fatiando.vis.mpl to plot the seismogram
fig, axes = plt.subplots(1, 2, figsize=(8, 5))

ax = axes[0]
ax.set_title("Velocity model (in depth)")
tmp = ax.imshow(velocity,
                extent=[0, n_traces, n_samples, 0],
                cmap="copper",
                aspect='auto',
                origin='upper')
fig.colorbar(tmp, ax=ax, pad=0, aspect=50)
ax.set_xlabel('Trace')
ax.set_ylabel('Depth (m)')

ax = axes[1]
ax.set_title("Synthetic seismogram")
mpl.seismic_wiggle(synt[:, ::20], dt=2.e-3, scale=1)
mpl.seismic_image(synt, dt=2.e-3, cmap="RdBu_r", aspect='auto')
ax.set_xlabel('Trace')
ax.set_ylabel('Time (s)')
plt.tight_layout()
plt.show()
Example #4
0
          fontsize=13,
          family='sans-serif',
          weight='bold')
rcs = utils.matrix2stream(rc.transpose(), header={'delta': dt})
mpl.seismic_wiggle(rcs, normalize=True, scale=1.5, ranges=[0, nx])  # rc model
wavelet = signal.ricker(255, 1 / (2 * f * dt))  # create wavelet
samples = signal.filtfilt(wavelet,
                          np.ones(len(wavelet)),
                          rc,
                          axis=0,
                          padlen=len(twt) - 2)  # convolve rc*wavelet
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)')
Example #5
0
dt = 2e-3

# We need to convert the depth model we made above into time
vel_l = conv.depth_2_time(velocity, velocity, dt=dt, dz=1)
# and we'll assume the density is homogeneous
rho_l = 2200*np.ones(np.shape(vel_l))
# With that, we can calculate the reflectivity model in time
rc = conv.reflectivity(vel_l, rho_l)
# and finally perform our convolution
synt = conv.convolutional_model(rc, 30, conv.rickerwave, dt=dt)

# We can use the utility function in fatiando.vis.mpl to plot the seismogram
fig, axes = plt.subplots(1, 2, figsize=(8, 5))

ax = axes[0]
ax.set_title("Velocity model (in depth)")
tmp = ax.imshow(velocity, extent=[0, n_traces, n_samples, 0],
                cmap="copper", aspect='auto', origin='upper')
fig.colorbar(tmp, ax=ax, pad=0, aspect=50)
ax.set_xlabel('Trace')
ax.set_ylabel('Depth (m)')

ax = axes[1]
ax.set_title("Synthetic seismogram")
mpl.seismic_wiggle(synt[:, ::20], dt, scale=1)
mpl.seismic_image(synt, dt, cmap="RdBu_r", aspect='auto')
ax.set_xlabel('Trace')
ax.set_ylabel('Time (s)')
plt.tight_layout()
plt.show()
Example #6
0
rock_grid = 1500.*np.ones((n_samples, n_traces))
rock_grid[300:, :] = 2500.
# synthetic calculation
vel_l = conv.depth_2_time(rock_grid, rock_grid, dt=2.e-3, dz=1.)
rho_l = np.ones(np.shape(vel_l))
rc = conv.reflectivity(vel_l, rho_l)
synt = conv.convolutional_model(rc, 30., conv.rickerwave, dt=2.e-3)
# plot input model
plt.figure()
plt.subplot(3, 1, 1)
plt.ylabel('Depth (m)')
plt.title("Depth Vp model", fontsize=13, family='sans-serif', weight='bold')
plt.imshow(rock_grid, extent=[0, n_traces, n_samples, 0],
           cmap=mpl.pyplot.cm.bwr, aspect='auto', origin='upper')
# plot resulted seismogram using wiggle
plt.subplot(3, 1, 2)
mpl.seismic_wiggle(synt, dt=2.e-3)
mpl.seismic_image(synt, dt=2.e-3, cmap=mpl.pyplot.cm.jet, aspect='auto')
plt.ylabel('time (seconds)')
plt.title("Convolutional seismogram", fontsize=13, family='sans-serif',
          weight='bold')

# plot resulted seismogram using wiggle over Vp model
plt.subplot(3, 1, 3)
mpl.seismic_image(vel_l, dt=2.e-3, cmap=mpl.pyplot.cm.jet, aspect='auto')
mpl.seismic_wiggle(synt, dt=2.e-3)
plt.ylabel('time (seconds)')
plt.title("Convolutional seismogram over Vp model", fontsize=13,
          family='sans-serif', weight='bold')
plt.show()
zimp = np.ones(twtvmodel.shape)*1000.*twtvmodel  # create impedance z = rho*v
rc = (zimp[1:]-zimp[:-1])/(zimp[1:]+zimp[:-1]) # calculate reflection coefs
fig = mpl.figure(figsize=(11, 7))  # plottings
mpl.subplots_adjust(right=0.98, left=0.11, hspace=0.4, top=0.93, bottom=0.13)
mpl.subplot2grid((3, 4), (0, 0), colspan=4)  # plot rc model
mpl.title("Zero-offset section reflection coefficients",
          fontsize=13, family='sans-serif', weight='bold')
rcs = utils.matrix2stream(rc.transpose(), header={'delta': dt})
mpl.seismic_wiggle(rcs, normalize=True, scale=1.5, ranges=[0, nx])  # rc model
wavelet = signal.ricker(255, 1/(2*f*dt))  # create wavelet
samples = signal.filtfilt(wavelet, np.ones(len(wavelet)),
                          rc, axis=0, padlen=len(twt)-2)  # convolve rc*wavelet
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
Example #8
0
rc = conv.reflectivity(vel_l, rho_l)
synt = conv.convolutional_model(rc, 30., conv.rickerwave, dt=2.e-3)
# plot input model
plt.figure()
plt.subplot(3, 1, 1)
plt.ylabel('Depth (m)')
plt.title("Depth Vp model", fontsize=13, family='sans-serif', weight='bold')
plt.imshow(rock_grid,
           extent=[0, n_traces, n_samples, 0],
           cmap=mpl.pyplot.cm.bwr,
           aspect='auto',
           origin='upper')
# plot resulted seismogram using wiggle
plt.subplot(3, 1, 2)
mpl.seismic_wiggle(synt, dt=2.e-3)
mpl.seismic_image(synt, dt=2.e-3, cmap=mpl.pyplot.cm.jet, aspect='auto')
plt.ylabel('time (seconds)')
plt.title("Convolutional seismogram",
          fontsize=13,
          family='sans-serif',
          weight='bold')

# plot resulted seismogram using wiggle over Vp model
plt.subplot(3, 1, 3)
mpl.seismic_image(vel_l, dt=2.e-3, cmap=mpl.pyplot.cm.jet, aspect='auto')
mpl.seismic_wiggle(synt, dt=2.e-3)
plt.ylabel('time (seconds)')
plt.title("Convolutional seismogram over Vp model",
          fontsize=13,
          family='sans-serif',
          weight='bold')