Skip to content

Commit b578b0a

Browse files
authored
adding folder with reproduced figures from Yilmaz' (#311)
* added SConstruct with real data example * added SConstruct with Ray Abma's synthetic data example * Colab Notebook for seismic trace interpolation using machine learning * added google colab notebook for seismic trace interpolation using machine learning * adding folder with reproduced figures from Oz Yilmaz' Seismic Analysis
1 parent af82da2 commit b578b0a

File tree

11 files changed

+924
-0
lines changed

11 files changed

+924
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
from rsf.proj import *
2+
3+
# Fetch & plot dataset
4+
Fetch('elf-stk2.rsf','masha')
5+
Flow('elf','elf-stk2','dd form=native | put unit1=s')
6+
Result('elf','grey')
7+
8+
# Decimate
9+
Flow('decimated','elf','window j2=4 | put d2=53.3333')
10+
Result('decimated','grey')
11+
12+
#Result('original_n_decimated',['elf','decimated'],'SideBySideAniso')
13+
14+
# Zoom-in
15+
Flow('original_w','elf','window max1=1.5 n2=600 | costaper nw1=40')
16+
Flow('decimated_w','decimated','window max1=1.5 n2=150 | costaper nw1=40')
17+
Result('original_w','grey title="Original data"')
18+
Result('decimated_w','grey title="Decimated data"')
19+
20+
#Result('original_n_decimated_w',['elf_w','decimated_w'],'SideBySideAniso')
21+
22+
# T-X interpolation
23+
Flow(['pad_w','mask_w'],'decimated_w','lpad jump=4 mask=${TARGETS[1]}')
24+
Flow(['pef_w','lag_w'],'decimated_w','lpef lag=${TARGETS[1]} a=17,5 jump=4')
25+
Flow('interpolated_w',['pad_w','mask_w','pef_w'],
26+
'miss padin=4 filt=${SOURCES[2]} mask=${SOURCES[1]} prec=n')
27+
Result('interpolated_w','grey')
28+
29+
Flow('pef_aw','pad_w','apef a=15,4 jump=4 rect1=20 rect2=5 niter=200 verb=y')
30+
Flow('interpolated_aw',['pad_w','pef_aw','mask_w'],'miss4 filt=${SOURCES[1]} mask=${SOURCES[2]} verb=y')
31+
Result('interpolated_aw','grey')
32+
33+
## Interpolation error
34+
35+
# F-X interpolation
36+
37+
## Interpolation error
38+
39+
End()
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
from rsf.proj import *
2+
from rsf.recipes.beg import server as private
3+
4+
###########################################################################
5+
6+
for dat in ('curve','linear','random','marm'):
7+
input = 'input.%s.segy' % dat
8+
Fetch(input,'ray',private)
9+
Flow([dat,'./A'+dat,'./B'+dat],input,
10+
'''
11+
segyread tape=$SOURCE read=d hfile=${TARGETS[1]} bfile=${TARGETS[2]}
12+
''',stdin=0)
13+
14+
Flow('linear2','linear','window min1=0.5 max1=2.7 | bandpass fhi=60')
15+
Plot('linear','linear2',
16+
'''
17+
grey yreverse=y transp=y poly=y label2=Position
18+
title=Input
19+
''')
20+
Plot('jlinear','linear2',
21+
'''
22+
window n2=11 f2=23 n1=150 min1=1.35 |
23+
put d1=1 o1=675 label1=Sample unit1= |
24+
wiggle yreverse=y transp=y poly=y label2=Position wherexlabel=t
25+
title=Input wheretitle=b clip=0.0451806 labelsz=5. titlesz=7
26+
labelfat=2 font=2 titlefat=2 screenratio=1.2
27+
''')
28+
29+
# nonstationary PWD
30+
Flow('lindip','linear2','twodip2 order=3 nj1=4 nj2=4 eps=10 gauss=n')
31+
Flow('lindip2','lindip',
32+
'transp | spline n1=240 o1=0 d1=0.25 | transp')
33+
34+
Flow('lin4 linones4','linear2','lpad jump=4 mask=${TARGETS[1]}')
35+
Flow('lindeal','lin4 lindip2 linones4',
36+
'planemis2 dip=${SOURCES[1]} mask=${SOURCES[2]} order=3 verb=y')
37+
Plot('lindeal','grey yreverse=y transp=y poly=y title=Interpolated')
38+
39+
Result('linear-deal','linear lindeal','SideBySideAniso')
40+
41+
# Stationary T-X PEFs
42+
Flow('lpef llag','linear2','lpef lag=${TARGETS[1]} a=10,4 jump=4')
43+
Flow('lscov','lpad lmask lpef',
44+
'miss padin=4 filt=${SOURCES[2]} mask=${SOURCES[1]} prec=n')
45+
Plot('lscov',
46+
'grey yreverse=y transp=y poly=y title="Stationary PEF"')
47+
48+
Result('linear-scomp','linear lscov','SideBySideAniso')
49+
50+
# Nonstationary T-X PEFs
51+
Flow('lpad lmask','linear2','lpad jump=2 mask=${TARGETS[1]}')
52+
Flow('lapef','lpad','apef a=15,4 jump=2 rect1=20 rect2=5 niter=200 verb=y')
53+
Flow('lacov','lpad lapef lmask',
54+
'miss4 filt=${SOURCES[1]} mask=${SOURCES[2]} verb=y')
55+
Plot('lacov',
56+
'''
57+
grey yreverse=y transp=y poly=y label2=Position
58+
title="Adaptive PEF"
59+
''')
60+
61+
Plot('jlacov','lacov',
62+
'''
63+
window n2=22 f2=46 n1=150 min1=1.35 |
64+
put d1=1 o1=675 label1=Sample unit1= |
65+
wiggle yreverse=y transp=y poly=y label2=Position wherexlabel=t
66+
title="Adaptive PEF" wheretitle=b clip=0.0225903 labelsz=5. titlesz=7
67+
labelfat=2 font=2 titlefat=2 screenratio=1.2
68+
''')
69+
70+
Result('linear-comp','linear lacov','SideBySideAniso')
71+
72+
# Stationary F-X PEFs
73+
Flow('lfx','lpad',
74+
'''
75+
spitz norm=n verb=y
76+
''')
77+
Plot('lfx',
78+
'''
79+
grey yreverse=y transp=y poly=y label2=Position
80+
title="Adaptive PEF"
81+
''')
82+
83+
Result('linear-fxcomp','linear lfx','SideBySideAniso')
84+
85+
End()

book/yilmaz/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This document aims to reproduce the synthetic data examples presented on Öz Yilmaz' Seismic Data Analysis, Volume I.

book/yilmaz/SConstruct

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from rsf.book import *
2+
from rsf.tex import Paper
3+
4+
chapters=Split(
5+
'''
6+
fourier1d
7+
''')
8+
9+
Book(chapters,
10+
author='TCCS Apocrypha',
11+
title="Reproducing Oz Yilmaz' Seismic Data Analysis")
12+
13+
Paper('intro')
14+
15+
End(options='book',
16+
use='graphicx,color,amsmath,amssymb,amsbsy,hyperref,listings,framed,tabularx')

book/yilmaz/fourier1d/SConstruct

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from rsf.tex import *
2+
3+
End(color='all')
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
from rsf.proj import *
2+
3+
"""
4+
This SCons script aims to reproduce Fig 1.1-7 to Fig 1.1-10, presented in Öz Yilmaz' Seismic Data Analysis, Vol 1.
5+
6+
The first three frames show sinusoidal functions with different frequencies:
7+
* 1: Frequency - 25 Hz
8+
* 2: Frequency - 75 Hz
9+
* 3: Frequency - 150 Hz
10+
11+
The fourth frame shows the composition of two sinusoids with frequencies:
12+
* 1: Frequency - 12.5 Hz
13+
* 2: Frequency - 75 Hz
14+
15+
All the functions above are sampled at three different rates:
16+
* 1: Sampling rate - 2 ms
17+
* 2: Sampling rate - 4 ms
18+
* 3: Sampling rate - 8 ms
19+
20+
The original figures exemplified aliasing: the consequence of sampling below the Nyquist rate.
21+
22+
*For some reason, the original figures appear to be "smoother" than they should.
23+
"""
24+
25+
# Sinusoid parameters
26+
frequency = [25,75,150] # frequencies in Hz
27+
samplingrate = [0.002,0.004,0.008] # sampling rates in seconds
28+
29+
for i in range(3):
30+
for j in range(3):
31+
jrate = samplingrate[j]
32+
# Produce sinusoid
33+
Flow('sinusoid%g-%gms'%(i+1,jrate*1000),None,
34+
'''
35+
math n1=%g d1=%f o1=0
36+
output="sin(x1*%f*2*(2*asin(1)))" |
37+
put label1="Time" unit1="s"
38+
'''%(1/jrate+1,jrate,frequency[i])) # pi is defined as 2*asin(1)
39+
Plot('sinusoid%g-%gms'%(i+1,jrate*1000),
40+
'graph title="Sinusoid %g, sampling rate = %g ms" screenratio=0.75 min1=0 max1=1 min2=-1 max2=1'%(i+1,jrate*1000))
41+
Result('sinusoid%g-%gms'%(i+1,jrate*1000),
42+
'graph title="Sinusoid %g, sampling rate = %g ms" screenratio=0.5 min1=0 max1=1 min2=-1 max2=1'%(i+1,jrate*1000))
43+
44+
# Recovering Amplitude spectra through FFT
45+
## Fourier transform
46+
fftwindow = int(0.4/jrate) # we window N full cycles
47+
Flow('fourier%g-%gms'%(i+1,jrate*1000),'sinusoid%g-%gms'%(i+1,jrate*1000),'window n1=%g | fft1'%fftwindow)
48+
49+
## Amplitude spectra
50+
Flow('fampspectra%g-%gms'%(i+1,jrate*1000),'fourier%g-%gms'%(i+1,jrate*1000),
51+
'''
52+
math output="2*abs(input)/%g" | real | put label1="Frequency" unit1="Hz"
53+
'''%fftwindow) # normalized by 2/N
54+
Plot('fampspectra%g-%gms'%(i+1,jrate*1000),
55+
'graph title="Amplitude Spectrum" screenratio=1 min1=0 max1=250 min2=0 max2=1')
56+
Result('fampspectra%g-%gms'%(i+1,jrate*1000),
57+
'graph title="Amplitude Spectrum %g" screenratio=1 min1=0 max1=250 min2=0 max2=1'%(i+1))
58+
59+
## Plot side by side
60+
Plot('subplot%g-%gms'%(i+1,jrate*1000),'sinusoid%g-%gms fampspectra%g-%gms'%(i+1,jrate*1000,i+1,jrate*1000),
61+
'SideBySideAniso')
62+
Result('subplot%g-%gms'%(i+1,jrate*1000),'sinusoid%g-%gms fampspectra%g-%gms'%(i+1,jrate*1000,i+1,jrate*1000),
63+
'SideBySideAniso')
64+
65+
Plot('frame%g'%(i+1),['subplot%g-%gms'%(i+1,samplingrate[j]*1000) for j in range(3)],'OverUnderAniso')
66+
Result('frame%g'%(i+1),['subplot%g-%gms'%(i+1,samplingrate[j]*1000) for j in range(3)],'OverUnderAniso')
67+
68+
# Composite signal
69+
for j in range(3):
70+
jrate = samplingrate[j]
71+
# Produce sinusoid
72+
Flow('sinusoid4-%gms'%(jrate*1000),None,
73+
'''
74+
math n1=%g d1=%f o1=0
75+
output="sin(x1*12.5*2*(2*asin(1)))+sin(x1*75*2*(2*asin(1)))" |
76+
put label1="Time" unit1="s"
77+
'''%(1/jrate+1,jrate)) # pi is defined as 2*asin(1)
78+
Plot('sinusoid4-%gms'%(jrate*1000),
79+
'graph title="Sinusoid %g, sampling rate = %g ms" screenratio=0.75 min1=0 max1=1 min2=-1 max2=1'%(i+1,jrate*1000))
80+
Result('sinusoid4-%gms'%(jrate*1000),
81+
'graph title="Sinusoid %g, sampling rate = %g ms" screenratio=0.5 min1=0 max1=1 min2=-1 max2=1'%(i+1,jrate*1000))
82+
83+
# Recovering Amplitude spectrum through FFT
84+
## Fourier transform
85+
fftwindow = int(0.4/jrate) # we window N full cycles
86+
Flow('fourier4-%gms'%(jrate*1000),'sinusoid4-%gms'%(jrate*1000),'window n1=%g | fft1'%fftwindow)
87+
88+
## Amplitude spectrum
89+
Flow('fampspectra4-%gms'%(jrate*1000),'fourier4-%gms'%(jrate*1000),
90+
'''
91+
math output="2*abs(input)/%g" | real | put label1="Frequency" unit1="Hz"
92+
'''%fftwindow) # normalized by 2/N
93+
Plot('fampspectra4-%gms'%(jrate*1000),
94+
'graph title="Amplitude Spectrum" screenratio=1 min1=0 max1=250 min2=0 max2=1')
95+
Result('fampspectra4-%gms'%(jrate*1000),
96+
'graph title="Amplitude Spectrum %g" screenratio=1 min1=0 max1=250 min2=0 max2=1'%(i+1))
97+
98+
## Plot side by side
99+
Plot('subplot4-%gms'%(jrate*1000),'sinusoid4-%gms fampspectra4-%gms'%(jrate*1000,jrate*1000),
100+
'SideBySideAniso')
101+
Result('subplot4-%gms'%(jrate*1000),'sinusoid4-%gms fampspectra4-%gms'%(jrate*1000,jrate*1000),
102+
'SideBySideAniso')
103+
104+
Plot('frame4',['subplot4-%gms'%(samplingrate[j]*1000) for j in range(3)],'OverUnderAniso')
105+
Result('frame4',['subplot4-%gms'%(samplingrate[j]*1000) for j in range(3)],'OverUnderAniso')
106+
107+
End()

0 commit comments

Comments
 (0)