Skip to content

Commit 8d9a44f

Browse files
committed
Data cube interpolation to increase m sampling
CRE gather trajectory in the m,h plane has not well sampled values in m for constant offset gathers. This trajectory is a curve that intercets constant offset Gathers in an arbitrary m position. Use data interpolation to increase CMP data sampling, in order to get traces (a m,h pair point) closer to the correct m,h in the CRE trajectory that intersects a h=constant in a constant offset Gather. In order to do so, interleave zero traces in original data offset Gathers and interpolate each section with adaptative preditive error filters (PEF) method. Concatenate all interpolated section in a resampled data cube (Double of traces in CMP coordinate, half of CMP sampling, keep time and offset sampling same as the original data cube). PEF coeficients calculation step parameters: Jump parameter, jumps every group of 2 traces to faster the data interpolation. a is number of coeficients in time and space, in that order. rect1 is the smothing window in time, rect2 is the smothing window in space. Interpolation step parameters: exact is to keep the original traces and only interpolate the zero traces. mask receives a mask file to inform wich traces to keep (original traces) and wich ones to interpolate (zero ones).
1 parent 49a9cfd commit 8d9a44f

File tree

2 files changed

+212
-0
lines changed

2 files changed

+212
-0
lines changed
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
#
4+
# SConstruct (Madagascar Script)
5+
#
6+
# Purpose: Interpolation of modeled data Cube to increase dara sampling.
7+
#
8+
# Site: http://www.dirackslounge.online
9+
#
10+
# Version 1.0
11+
#
12+
# Programer: Rodolfo A. C. Neves (Dirack) 22/09/2019
13+
#
14+
15+
#
16+
# License: GPL-3.0 <https://www.gnu.org/licenses/gpl-3.0.txt>.
17+
18+
19+
# Madagascar library
20+
from rsf.proj import *
21+
22+
# Python math library
23+
import math
24+
25+
# Ploting functions
26+
from graph_scons import *
27+
28+
# Modeling: Gaussian reflector in a velocity linear model
29+
# velocity increases with depth and a 0.5 velocity gradient
30+
Flow('gaussianReflector',None,
31+
'''
32+
math d1=0.01 n1=2001 o1=-5 unit1=km label1=Offset
33+
output="4-3*exp(-(x1-5)^2/9)"
34+
''')
35+
36+
# Velocity Model
37+
Flow('velocityModel','gaussianReflector',
38+
'''
39+
window min1=0 max1=10 |
40+
spray axis=1 n=451 d=0.01 o=0 label=Depth unit=km |
41+
math output="1.5+0.5*x1+0.0*x2"
42+
''')
43+
44+
Flow('reflectorDip','gaussianReflector','math output="2/3*(x1-5)*input" ')
45+
46+
# Kirchoff Modeling
47+
Flow('dataCube','gaussianReflector reflectorDip',
48+
'''
49+
kirmod cmp=y dip=${SOURCES[1]}
50+
nh=161 dh=0.025 h0=0
51+
ns=401 ds=0.025 s0=0
52+
freq=10 dt=0.004 nt=1001
53+
vel=1.5 gradz=0.5 gradx=0.0 verb=y |
54+
put d2=0.0125 label3="CMP" unit3="Km" label2="Offset" unit2="Km" label1=Time unit1=s
55+
''')
56+
57+
m0=5
58+
t0=1.1
59+
v0=1.5
60+
61+
# Very Fast Simulated Aneelling Global Optimization (VFSA)
62+
Flow('crsParameters','dataCube',
63+
'''
64+
vfsacrenh m0=%g v0=%g t0=%g verb=y repeat=2
65+
''' % (m0,v0,t0))
66+
67+
# Aproximation Error
68+
Flow('dataReflectionSurface','dataCube','envelope | max1 | window n1=1 | real')
69+
Plot('dataReflectionSurface',
70+
'''
71+
grey color=j bias=2 scalebar=y barlabel=Time barunit=s barreverse=y
72+
title="Modeled traveltime surface" label1=Half-Offset unit1=km label2=Midpoint unit2=km
73+
''')
74+
Flow('crsAppSurface',['dataReflectionSurface','crsParameters'],
75+
'''
76+
nhcrssurf param=${SOURCES[1]} m0=%g v0=%g t0=%g verb=y
77+
''' % (m0,v0,t0))
78+
Plot('crsAppSurface',
79+
'''
80+
grey color=j bias=2 scalebar=y barlabel=Time barunit=s barreverse=y
81+
title="Non-hyperbolic CRS m0=5Km" label1=Half-Offset unit1=km label2=Midpoint unit2=km
82+
''')
83+
84+
Flow('error',['crsAppSurface','dataReflectionSurface'],
85+
'''
86+
add scale=1,-1 ${SOURCES[1]} |
87+
math output="abs(input)"
88+
''')
89+
Plot('error',
90+
'''
91+
grey color=j scalebar=y barlabel=Time barunit=s barreverse=y
92+
title="Approximation error" label1=Half-Offset unit1=km label2=Midpoint unit2=km
93+
maxval=1 minval=0
94+
''')
95+
96+
Result('errorAndCRSSurfaces',['dataReflectionSurface','crsAppSurface','error'],'SideBySideAniso')
97+
98+
99+
# Build a mask to interleave zero traces with original data traces
100+
Flow('aa',None,'spike n1=401 d1=0.0125 o1=0')
101+
Flow('bb',None,'spike n1=401 d1=0.0125 o1=0 mag=0')
102+
Flow('mask1','bb aa',
103+
'''
104+
interleave axis=1 ${SOURCES[1]} |
105+
dd type=int
106+
''')
107+
108+
Flow('a',None,'spike n1=401 d1=0.0125 o1=0')
109+
Flow('b',None,'spike n1=401 d1=0.0125 o1=0 mag=0')
110+
Flow('mask','a b',
111+
'''
112+
interleave axis=1 ${SOURCES[1]} |
113+
dd type=int
114+
''')
115+
Flow('zeroTraceGather','b',
116+
'''
117+
spray axis=2 n=1001 d=0.0125 |
118+
transp |
119+
put label2=Offset unit2=Km label1=Time unit1=s
120+
''')
121+
122+
# Data Mask with double of traces in CMP (half of CMP sampling)
123+
# Keep the same Time and Offset original data sampling
124+
Flow('mask0','mask',
125+
'''
126+
spray axis=1 n=1001 d=0.004
127+
''')
128+
129+
totalPefIterations = 100
130+
totalInterpolationIterations = 20
131+
132+
offsetGathers = []
133+
for offsetGatherIndex in range(2):
134+
135+
offsetGather = "offsetGather-%i" % offsetGatherIndex
136+
resampledOffsetGather = "resampledOffsetGather-%i" % offsetGatherIndex
137+
interpolatedOffsetGather = "interpolatedOffsetGather-%i" % offsetGatherIndex
138+
pefCoeficients = "pefCoeficients-%i" % offsetGatherIndex
139+
140+
Flow(offsetGather,'dataCube',
141+
'''
142+
window n2=1 f2=%i
143+
''' % (offsetGatherIndex))
144+
145+
Flow(resampledOffsetGather,[offsetGather,'zeroTraceGather'],
146+
'''
147+
interleave axis=2 ${SOURCES[1]}
148+
''')
149+
150+
# Calculate adaptive PEF coeficients
151+
Flow(pefCoeficients,[resampledOffsetGather,'mask0'],
152+
'''
153+
apef jump=2 a=10,2 rect1=50 rect2=2 niter=%g verb=y
154+
maskin=${SOURCES[1]}
155+
''' % (totalPefIterations))
156+
157+
# 4. Interpolation
158+
Flow(interpolatedOffsetGather, [resampledOffsetGather,pefCoeficients,'mask0','mask1'],
159+
'''
160+
miss4 exact=y filt=${SOURCES[1]} mask=${SOURCES[2]} niter=%g verb=y |
161+
put d2=0.0125
162+
''' % (totalInterpolationIterations))
163+
164+
offsetGathers.append(interpolatedOffsetGather)
165+
166+
# Concatenate interpolated sections
167+
Flow('interpolatedDataCube',offsetGathers,
168+
'''
169+
rcat axis=3 ${SOURCES[0:%d]} |
170+
transp plane=23
171+
''' % offsetGatherIndex)
172+
173+
174+
175+
End()
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# coding: utf-8
2+
#
3+
# graph_scons.py (Python)
4+
#
5+
# Purpose: Definition of ploting functions.
6+
#
7+
# Site: http://www.dirackslounge.online
8+
#
9+
# Version 1.0
10+
#
11+
# Programer: Rodolfo Dirack 22/08/2019
12+
#
13+
14+
#
15+
# License: GPL-3.0 <https://www.gnu.org/licenses/gpl-3.0.txt>.
16+
17+
def wiggle(title):
18+
return '''
19+
wiggle wheretitle=top yreverse=y transp=y label1=Time unit1=s label2=CMP unit2=km pclip=99.5 title="%s"
20+
''' % title
21+
22+
def grey(title):
23+
return '''
24+
grey label1=Time unit1=s label2=CMP unit2=km pclip=99.5 title="%s"
25+
''' % title
26+
27+
def grey3(title):
28+
return '''
29+
byte |
30+
transp plane=23 |
31+
grey3 flat=n frame1=500 frame3=80 frame2=200
32+
label1=Time unit1=s
33+
label3=Offset unit3=km
34+
label2=CMP unit2=km
35+
title="%s" point1=0.8 point2=0.8
36+
''' % title
37+

0 commit comments

Comments
 (0)