Reference

Mousa, W.A. and Al-Shuhail A.A., 2011, Processing of Seismic Reflection Data Using MATLAB, Morgan & Claypool


In [1]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [2]:
from pkprocess import *

In [3]:
trace=read_su('data/Book_Seismic_Data.su')

In [4]:
get_ns(trace),get_ntr(trace),get_dt(trace)


Out[4]:
(1501, 594, 0.002)

In [5]:
print_range(trace)


keyword:: min(loc) ~ max(loc): [first - last]// # of unique keys

tracl:: 1(0) ~ 594(593): [1 - 594]// 594
tracr:: 1(0) ~ 594(593): [1 - 594]// 594
fldr:: 1(0) ~ 18(561): [1 - 18]// 18
tracf:: 1(0) ~ 24(18): [1 - 18]// 24
ep:: 1(0) ~ 18(561): [1 - 18]// 18
cdp:: 202(0) ~ 266(593): [202 - 266]// 65
cdpt:: 1(0) ~ 18(32): [1 - 1]// 18
trid:: 1(0) ~ 1(0): [1 - 1]// 1
offset:: -7040(561) ~ 7040(32): [0 - 0]// 65
gelev:: 2381000(27) ~ 2833000(3): [2825000 - 2408000]// 32
selev:: 2408000(561) ~ 2825000(0): [2825000 - 2408000]// 18
sdepth:: 800000(33) ~ 1000000(0): [1000000 - 1000000]// 2
scalel:: -10000(0) ~ -10000(0): [-10000 - -10000]// 1
scalco:: -10000(0) ~ -1000(5): [-10000 - -1000]// 2
sx:: 0(0) ~ 7040(561): [0 - 7040]// 18
gx:: 0(0) ~ 7040(32): [0 - 7040]// 33
counit:: 1(0) ~ 1(0): [1 - 1]// 1
sut:: 20(231) ~ 35(66): [33 - 23]// 12
ns:: 1501(0) ~ 1501(0): [1501 - 1501]// 1
dt:: 2000(0) ~ 2000(0): [2000 - 2000]// 1

Header information


In [6]:
plot(ntr_per_shot(trace),'o')
xlabel('Shot gather numbers')
ylabel('Number of traces/shot gather')
grid()



In [7]:
plot(get_key(trace,'sx'))
xlabel('Trace number')
ylabel('Sources x-axis locations (ft)')
grid()



In [8]:
plot(get_key(trace,'selev'))
xlabel('Trace number')
ylabel('Sources elevation (ft)')
grid()



In [9]:
plot(get_key(trace,'gelev'))
xlabel('Trace number')
ylabel('Receivers elevation (ft)')
grid()



In [10]:
stacking_chart(trace)


Displaying seismic data


In [11]:
csg8=window(trace,'fldr',8)

In [12]:
plot_wiggle(csg8,perc=99)


min=-519827200.0 max=519827200.0

In [13]:
plot_image(csg8,perc=99)


min=-519827200.0 max=519827200.0

In [14]:
plot_image(csg8,perc=99,cmap='bwr')


min=-519827200.0 max=519827200.0

Trace editing


In [15]:
plot_image(trace,figsize=[15,10],perc=99)


min=-281804800.0 max=278130944.0

In [16]:
for shot in trace_split(trace,'fldr'):
    plot_wiggle(shot)


min=-1073741824.0 max=1073741824.0
min=-1073741824.0 max=1073741824.0
min=-1073741824.0 max=1073741824.0
min=-1073741824.0 max=1073741824.0
min=-1073741824.0 max=1073741824.0
min=-1073741824.0 max=1073741824.0
min=-1073741824.0 max=1073741824.0
min=-1073741824.0 max=1073741824.0
min=-1073741824.0 max=1073741824.0
min=-1073741824.0 max=1073741824.0
min=-1073741824.0 max=1073741824.0
min=-1073741824.0 max=1073741824.0
min=-1073741824.0 max=1073741824.0
min=-1073741824.0 max=1073741824.0
min=-1073741824.0 max=1073741824.0
min=-1073741824.0 max=1073741824.0
min=-1073741824.0 max=1073741824.0
min=-1073741824.0 max=1073741824.0

In [17]:
csg12=window(trace,'fldr',12)
plot_wiggle(csg12,perc=99)


min=-323826688.0 max=320598784.0

In [18]:
csg12.data[21,:]=0.
plot_wiggle(csg12,perc=99)


min=-234256864.0 max=246176096.0

In [19]:
csg16=window(trace,'fldr',16)
plot_wiggle(csg16,perc=99)


min=-175529088.0 max=177462128.0

In [20]:
csg16.data[30,:]=0.
plot_wiggle(csg16,perc=99)


min=-122710304.0 max=113283664.0

In [21]:
trace.data[ntr_per_shot(trace)*(12-1)+21,:]=0.
trace.data[ntr_per_shot(trace)*(16-1)+30,:]=0.
plot_image(trace,figsize=[15,10],perc=99)


min=-272696320.0 max=266918752.0

Gain control


In [22]:
csg8=window(trace,'fldr',8)
csg8_tpow=gain(csg8,tpow=2)
csg8_epow=gain(csg8,epow=2)
plot_comp((csg8_tpow,csg8_epow),plot='wiggle',perc=99)


min=-71512778.46384001 max=70024063.97948399
min=-1294617906.703336 max=1292472729.786223

In [23]:
seis_env_dB(csg8,csg8_tpow)



In [24]:
seis_env_dB(csg8,csg8_epow)



In [25]:
trc_gained=gain(trace,tpow=2.)
plot_image(trc_gained,figsize=[15,10],perc=99)


min=-46714072.057344005 max=45979962.794496

In [26]:
for ishot,shot in enumerate(trace_split(trc_gained,'fldr')):
    plot_wiggle(shot)
    xlabel('Trace number - shot %s'%ishot)


min=-189470165.958656 max=173078618.362944
min=-170453078.368 max=184562445.8736
min=-253718775.293632 max=259576023.58688
min=-159359179.1616 max=181674055.85817596
min=-149570315.091968 max=151623401.472
min=-188046361.29075196 max=186160763.89580804
min=-163159197.45843202 max=127861923.23379199
min=-157338060.04633602 max=166338295.23456004
min=-246427061.4528 max=281557494.595584
min=-39052869.894144006 max=45797535.25248
min=-94353726.1824 max=92932421.976064
min=-110251504.82841603 max=97642640.502528
min=-430721034.284544 max=453886469.8654721
min=-98298942.50880001 max=193320299.72480005
min=-86762909.25158401 max=109568858.81286402
min=-111490064.97638401 max=119072205.31359999
min=-267682764.71808004 max=256362741.61561602
min=-73856468.58240001 max=72161255.227392

Frequency filtering


In [27]:
specfx(csg8_tpow)


dt=0.002, fmax=250.0

In [28]:
specfk(csg8_tpow)


dt=0.002, fmax=250.0
dx=0.22, kmax=2.272727272727273

In [29]:
csg8_bp=bpfilter(csg8_tpow,[15.,60.])
csg8_bp.print_log()
plot_comp((csg8_tpow,csg8_bp,csg8_tpow-csg8_bp),plot='wiggle',figsize=[12,10])


read_su: data/Book_Seismic_Data.su
window: key=fldr range=8
gain: tpow=2 epow=0 agc=False agc_gate=0.5 norm=rms
bpfilter: [15.0, 60.0]
min=-157338060.04633602 max=166338295.23456004
min=-96798737.00479527 max=97894882.40254533
min=-190320516.1226228 max=182303332.6017887

In [30]:
plot_comp((csg8_tpow,csg8_bp,csg8_tpow-csg8_bp),plot='specfx',cmap='jet',perc=99,figsize=[12,10])


dt=0.002, fmax=250.0
dt=0.002, fmax=250.0
dt=0.002, fmax=250.0

In [31]:
ns=get_ns(csg8_tpow)
dt=get_dt(csg8_tpow)
tmax=(ns-1)*dt
df=1./tmax
nf=int(ns/2)
af=arange(nf)*df
t1=fft.fft(csg8_tpow.data[0])
t2=fft.fft(csg8_bp.data[0])
plot(af,abs(t1[:nf]),label='before')
plot(af,abs(t2[:nf]),label='after')
legend()
xlabel('Frequency (Hz)')
ylabel('Amplitude')
xlim([0,60])


Out[31]:
(0, 60)

In [32]:
trc_bp=bpfilter(trc_gained,[15.,60.])
trc_bp.print_log()
#trc_bp.write('trace_gain_bpf.sd')


read_su: data/Book_Seismic_Data.su
gain: tpow=2.0 epow=0 agc=False agc_gate=0.5 norm=rms
bpfilter: [15.0, 60.0]

In [33]:
trc=window(trc_bp,'fldr',[4,5,6])
plot_wiggle(trc,figsize=[10,10],perc=99)


min=-41714066.001523264 max=41801699.18213389

In [34]:
plot_image(trc_bp,figsize=[15,10],perc=99)


min=-38276717.00230387 max=39068604.06729285

In [35]:
for shot in trace_split(trc_bp,'fldr'):
    plot_wiggle(shot)


min=-82468644.25033242 max=106120672.92608823
min=-112579782.05906323 max=114248789.97379228
min=-125431576.36472484 max=131376695.21210457
min=-105268086.46748616 max=94071767.39131108
min=-97415309.76377001 max=98196913.51173653
min=-122955640.24969052 max=142291709.98899394
min=-106567963.30812031 max=103115868.6842718
min=-96798737.00479527 max=97894882.40254533
min=-197521773.0410954 max=214322191.41669995
min=-35712186.17523835 max=35307107.20544006
min=-71879612.11707361 max=90959587.60562694
min=-85814488.9354963 max=84746462.86310616
min=-267418054.94891497 max=412944145.90234923
min=-93839582.84735422 max=77993534.85956617
min=-85768286.57166988 max=86095373.2093789
min=-117293346.40078638 max=98818364.36792056
min=-150346900.53670272 max=122570864.66552024
min=-70442844.01213884 max=59451732.037519544

Autocorrelograms


In [36]:
max_lag=0.2
auto=auto_correlation_map(trc,max_lag)
plot_wiggle(auto,figsize=[10,10],perc=95)
ylabel('Time lag (s)')


min=-1.6115883296995904e+17 max=1.6896923811412426e+17
Out[36]:
Text(0,0.5,'Time lag (s)')

Spiking deconvolution


In [37]:
mu=0.1
trc_sd=spiking_decon(trc_bp,max_lag,mu)


Calculating the filter
Applying the filter

In [38]:
plot_image(trc_sd,figsize=[15,10],perc=99)


min=-2.5489127286377403e-12 max=2.5502206085852284e-12

In [39]:
plot_wiggle(window(trc_sd,'fldr',[4,5,6]),figsize=[10,10],perc=99)


min=-2.654876532453571e-12 max=2.57931057011206e-12

Automatic Gain Control


In [40]:
trc_agc=gain(trc_sd,agc=True,agc_gate=0.5,norm='rms')

In [41]:
plot_wiggle(window(trc_agc,'fldr',[4,5,6]),figsize=[10,10],perc=99)


min=-4.103967447365691 max=4.106670000785409

In [42]:
trc_agc.print_log()
#trc_agc.write('trc_gain_bpf_sd_agc.sd')


read_su: data/Book_Seismic_Data.su
gain: tpow=2.0 epow=0 agc=False agc_gate=0.5 norm=rms
bpfilter: [15.0, 60.0]
spiking_decon: max_lag=0.2 mu=0.1
gain: tpow=0 epow=0 agc=True agc_gate=0.5 norm=rms

In [43]:
for shot,sd in zip(trace_split(trace,'fldr'),trace_split(trc_agc,'fldr')):
    plot_comp((shot,sd),plot='wiggle',perc=99)


min=-118322656.0 max=112799536.0
min=-4.2303622406939345 max=4.21142875150486
min=-289739776.0 max=299859968.0
min=-3.9005052188977607 max=3.9021860237194375
min=-298571008.0 max=278525696.0
min=-3.9001263265629387 max=3.8128522429680625
min=-391976960.0 max=359990272.0
min=-4.206883801244892 max=4.155955605136327
min=-316134144.0 max=316894464.0
min=-4.182927752901985 max=4.151998059184208
min=-369672960.0 max=392000768.0
min=-3.97065938728688 max=4.012835189679135
min=-387069440.0 max=392000768.0
min=-4.045555027051227 max=3.796128773730288
min=-519827200.0 max=519827200.0
min=-3.833225000068814 max=3.842731175483017
min=-349849856.0 max=349392128.0
min=-4.065320610903518 max=3.9142744692910347
min=-106767504.0 max=105247696.0
min=-4.490426031317067 max=4.470078835882893
min=-315304960.0 max=323826688.0
min=-4.312427445828934 max=4.017641916683756
min=-234256864.0 max=246176096.0
min=-4.10181838485545 max=3.9339994401888423
min=-315744000.0 max=309026048.0
min=-4.233479962239073 max=4.2676495413358655
min=-310487552.0 max=289739776.0
min=-3.9369337128910304 max=3.9681783735615337
min=-276821760.0 max=306783232.0
min=-4.314176635461447 max=4.2748131867888794
min=-122710304.0 max=113283664.0
min=-4.430965702876673 max=4.362517057681735
min=-144861088.0 max=144869936.0
min=-4.560700737464887 max=4.48353605436748
min=-56633200.0 max=51060736.0
min=-4.475217263270883 max=4.220050064960809

In [44]:
plot_image(trc_agc,figsize=[15,10],perc=99)


min=-4.145243132866924 max=4.076387464174395

CDP sorting


In [45]:
#trc_agc=read('trc_gain_bpf_sd_agc.sd')
trc_sort=trace_sort(trc_agc,('+cdp','-offset'))
cmps=get_key(trc_agc,'cdp')
cmpu=get_key_unique(trc_agc,'cdp')
fold_num = [sum(icmp==cmps) for icmp in cmpu]

stem(cmpu,fold_num,'k-')
xlabel('CMP numbers')
ylabel('Fold')


Out[45]:
Text(0,0.5,'Fold')

In [46]:
trc_sort.print_log()


read_su: data/Book_Seismic_Data.su
gain: tpow=2.0 epow=0 agc=False agc_gate=0.5 norm=rms
bpfilter: [15.0, 60.0]
spiking_decon: max_lag=0.2 mu=0.1
gain: tpow=0 epow=0 agc=True agc_gate=0.5 norm=rms
sort: keys=+cdp,-offset

In [47]:
trc_sort.write("trc_gain_bpf_sd_agc_sort.sd")

Velocity analysis

  1. Open and edit Par_velan_land.py file.
  2. Run Run_velan_land.py. ($ python Run_velan_land.py)
    • Left click: Add a point
    • Right click: Remove a point

In [48]:
trc_nmo=read("trc_gain_bpf_sd_agc_sort_nmo.sd")
trc_nmo.print_log(nmo=True)


read_su: data/Book_Seismic_Data.su
gain: tpow=2.0 epow=0 agc=False agc_gate=0.5 norm=rms
bpfilter: [15.0, 60.0]
spiking_decon: max_lag=0.2 mu=0.1
gain: tpow=0 epow=0 agc=True agc_gate=0.5 norm=rms
sort: keys=+cdp,-offset
write: trc_gain_bpf_sd_agc_sort.sd
read: trc_gain_bpf_sd_agc_sort.sd
velan_nmo: vmin=5000.0 dv=200 nv=51 cmp_start=205 cmp_end=265 cmp_step=5 max_stretch=10.0 R=4 L=8
write: trc_gain_bpf_sd_agc_sort_nmo.sd
read: trc_gain_bpf_sd_agc_sort_nmo.sd
nmo picks
{205: (array([7566.66666667, 8041.93548387, 9467.74193548]), array([0.25645714, 0.30697143, 0.92868571])), 210: (array([ 5482.79569892,  7932.25806452, 10345.16129032]), array([0.17874286, 0.93645714, 2.06331429])), 215: (array([ 5702.15053763,  7420.43010753, 10345.16129032]), array([0.26422857, 0.9248    , 2.05165714])), 220: (array([ 5446.23655914,  7456.98924731, 11112.90322581]), array([0.12822857, 0.952     , 2.05942857])), 225: (array([ 5263.44086022,  7639.78494624,  7895.69892473, 10491.39784946,
       12940.86021505]), array([0.17874286, 0.62948571, 1.32114286, 2.04777143, 2.38971429])), 230: (array([ 5629.03225806,  6908.60215054,  8955.91397849,  9467.74193548,
       12940.86021505]), array([0.24868571, 0.9248    , 2.08662857, 2.31977143, 2.87542857])), 235: (array([ 5409.67741935,  5921.50537634,  9102.15053763, 11076.34408602,
       13160.21505376]), array([0.18651429, 0.4352    , 2.0672    , 2.3936    , 2.87542857])), 240: (array([ 5519.35483871,  6945.16129032,  8736.55913978,  9906.4516129 ,
       11624.7311828 ]), array([0.18651429, 0.59451429, 2.08662857, 2.40137143, 2.87542857])), 245: (array([ 5446.23655914,  7859.13978495,  9321.50537634, 10089.24731183,
       11697.84946237]), array([0.23314286, 0.96754286, 2.08662857, 2.38582857, 2.87542857])), 250: (array([ 5592.47311828,  6981.72043011,  7822.58064516, 10198.92473118,
       11039.78494624]), array([0.1904    , 0.93645714, 1.36      , 2.09051429, 2.24594286])), 255: (array([ 5409.67741935,  8553.76344086, 11515.05376344]), array([0.07771429, 0.95977143, 2.11382857])), 260: (array([ 5409.67741935,  7493.5483871 ,  8590.32258065, 10527.95698925]), array([0.11657143, 0.93257143, 1.31337143, 2.10217143])), 265: (array([6579.56989247, 7712.90322581, 9540.86021505]), array([0.22537143, 0.54011429, 1.32502857]))}

In [49]:
plot_image(trc_nmo,figsize=[15,10],perc=99)


min=-3.227904860401692 max=3.1748578831607333

Stacking


In [50]:
trc_stk=stack(trc_nmo)
trc_stk.print_log()


read_su: data/Book_Seismic_Data.su
gain: tpow=2.0 epow=0 agc=False agc_gate=0.5 norm=rms
bpfilter: [15.0, 60.0]
spiking_decon: max_lag=0.2 mu=0.1
gain: tpow=0 epow=0 agc=True agc_gate=0.5 norm=rms
sort: keys=+cdp,-offset
write: trc_gain_bpf_sd_agc_sort.sd
read: trc_gain_bpf_sd_agc_sort.sd
velan_nmo: vmin=5000.0 dv=200 nv=51 cmp_start=205 cmp_end=265 cmp_step=5 max_stretch=10.0 R=4 L=8
write: trc_gain_bpf_sd_agc_sort_nmo.sd
read: trc_gain_bpf_sd_agc_sort_nmo.sd
stack

In [51]:
plot_wiggle(trc_stk,perc=99,figsize=[10,10])


min=-17.289774032907275 max=15.130679841916352

In [52]:
plot_image(trc_stk,perc=99,figsize=[10,10])


min=-17.289774032907275 max=15.130679841916352

In [53]:
plot_image(trc_stk,perc=99,cmap='bwr',figsize=[10,10])


min=-17.289774032907275 max=15.130679841916352

Surface-consistent static correction


In [54]:
cmp_start=205
cmp_end=255
lags=20
trc_static=scr_static(trc_nmo,cmp_start,cmp_end,lags)


cmp num= 205
cmp num= 206
cmp num= 207
cmp num= 208
cmp num= 209
cmp num= 210
cmp num= 211
cmp num= 212
cmp num= 213
cmp num= 214
cmp num= 215
cmp num= 216
cmp num= 217
cmp num= 218
cmp num= 219
cmp num= 220
cmp num= 221
cmp num= 222
cmp num= 223
cmp num= 224
cmp num= 225
cmp num= 226
cmp num= 227
cmp num= 228
cmp num= 229
cmp num= 230
cmp num= 231
cmp num= 232
cmp num= 233
cmp num= 234
cmp num= 235
cmp num= 236
cmp num= 237
cmp num= 238
cmp num= 239
cmp num= 240
cmp num= 241
cmp num= 242
cmp num= 243
cmp num= 244
cmp num= 245
cmp num= 246
cmp num= 247
cmp num= 248
cmp num= 249
cmp num= 250
cmp num= 251
cmp num= 252
cmp num= 253
cmp num= 254
cmp num= 255

In [55]:
trc_stk_static=stack(trc_static)
trc_stk_static.print_log()


read_su: data/Book_Seismic_Data.su
gain: tpow=2.0 epow=0 agc=False agc_gate=0.5 norm=rms
bpfilter: [15.0, 60.0]
spiking_decon: max_lag=0.2 mu=0.1
gain: tpow=0 epow=0 agc=True agc_gate=0.5 norm=rms
sort: keys=+cdp,-offset
write: trc_gain_bpf_sd_agc_sort.sd
read: trc_gain_bpf_sd_agc_sort.sd
velan_nmo: vmin=5000.0 dv=200 nv=51 cmp_start=205 cmp_end=265 cmp_step=5 max_stretch=10.0 R=4 L=8
write: trc_gain_bpf_sd_agc_sort_nmo.sd
read: trc_gain_bpf_sd_agc_sort_nmo.sd
scr_static: cmp_start=205 cmp_end=255 maxlags=20
stack

In [56]:
plot_comp((trc_stk,trc_stk_static,trc_stk_static-trc_stk),plot='wiggle',perc=99,figsize=[12,10])


min=-17.289774032907275 max=15.130679841916352
min=-20.326767232282222 max=18.446381899232673
min=-8.383141951418681 max=8.555414443345585

Stolt migration


In [57]:
# distance in feet
v=10000.
dx=110.
trc_mig=stolt_mig(trc_stk_static,v,dx)

In [58]:
plot_wiggle(trc_mig,perc=99,figsize=[10,10])


min=-20.20290199064957 max=18.335454032966165

In [59]:
plot_wiggle(trc_mig-trc_stk_static,perc=99,figsize=[10,10])


min=-2.9301204424149145 max=2.912737984197851

In [60]:
trc_mig.print_log()


read_su: data/Book_Seismic_Data.su
gain: tpow=2.0 epow=0 agc=False agc_gate=0.5 norm=rms
bpfilter: [15.0, 60.0]
spiking_decon: max_lag=0.2 mu=0.1
gain: tpow=0 epow=0 agc=True agc_gate=0.5 norm=rms
sort: keys=+cdp,-offset
write: trc_gain_bpf_sd_agc_sort.sd
read: trc_gain_bpf_sd_agc_sort.sd
velan_nmo: vmin=5000.0 dv=200 nv=51 cmp_start=205 cmp_end=265 cmp_step=5 max_stretch=10.0 R=4 L=8
write: trc_gain_bpf_sd_agc_sort_nmo.sd
read: trc_gain_bpf_sd_agc_sort_nmo.sd
scr_static: cmp_start=205 cmp_end=255 maxlags=20
stack
stold_mig: v=10000.0 dx=110.0

In [ ]: