Skip to content

Commit

Permalink
Data cube interpolation to increase m sampling
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
Dirack committed Sep 23, 2019
1 parent 49a9cfd commit 8d9a44f
Show file tree
Hide file tree
Showing 2 changed files with 212 additions and 0 deletions.
175 changes: 175 additions & 0 deletions experiments/interpolation/SConstruct
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# SConstruct (Madagascar Script)
#
# Purpose: Interpolation of modeled data Cube to increase dara sampling.
#
# Site: http://www.dirackslounge.online
#
# Version 1.0
#
# Programer: Rodolfo A. C. Neves (Dirack) 22/09/2019
#
# Email: rodolfo_profissional@hotmail.com
#
# License: GPL-3.0 <https://www.gnu.org/licenses/gpl-3.0.txt>.


# Madagascar library
from rsf.proj import *

# Python math library
import math

# Ploting functions
from graph_scons import *

# Modeling: Gaussian reflector in a velocity linear model
# velocity increases with depth and a 0.5 velocity gradient
Flow('gaussianReflector',None,
'''
math d1=0.01 n1=2001 o1=-5 unit1=km label1=Offset
output="4-3*exp(-(x1-5)^2/9)"
''')

# Velocity Model
Flow('velocityModel','gaussianReflector',
'''
window min1=0 max1=10 |
spray axis=1 n=451 d=0.01 o=0 label=Depth unit=km |
math output="1.5+0.5*x1+0.0*x2"
''')

Flow('reflectorDip','gaussianReflector','math output="2/3*(x1-5)*input" ')

# Kirchoff Modeling
Flow('dataCube','gaussianReflector reflectorDip',
'''
kirmod cmp=y dip=${SOURCES[1]}
nh=161 dh=0.025 h0=0
ns=401 ds=0.025 s0=0
freq=10 dt=0.004 nt=1001
vel=1.5 gradz=0.5 gradx=0.0 verb=y |
put d2=0.0125 label3="CMP" unit3="Km" label2="Offset" unit2="Km" label1=Time unit1=s
''')

m0=5
t0=1.1
v0=1.5

# Very Fast Simulated Aneelling Global Optimization (VFSA)
Flow('crsParameters','dataCube',
'''
vfsacrenh m0=%g v0=%g t0=%g verb=y repeat=2
''' % (m0,v0,t0))

# Aproximation Error
Flow('dataReflectionSurface','dataCube','envelope | max1 | window n1=1 | real')
Plot('dataReflectionSurface',
'''
grey color=j bias=2 scalebar=y barlabel=Time barunit=s barreverse=y
title="Modeled traveltime surface" label1=Half-Offset unit1=km label2=Midpoint unit2=km
''')
Flow('crsAppSurface',['dataReflectionSurface','crsParameters'],
'''
nhcrssurf param=${SOURCES[1]} m0=%g v0=%g t0=%g verb=y
''' % (m0,v0,t0))
Plot('crsAppSurface',
'''
grey color=j bias=2 scalebar=y barlabel=Time barunit=s barreverse=y
title="Non-hyperbolic CRS m0=5Km" label1=Half-Offset unit1=km label2=Midpoint unit2=km
''')

Flow('error',['crsAppSurface','dataReflectionSurface'],
'''
add scale=1,-1 ${SOURCES[1]} |
math output="abs(input)"
''')
Plot('error',
'''
grey color=j scalebar=y barlabel=Time barunit=s barreverse=y
title="Approximation error" label1=Half-Offset unit1=km label2=Midpoint unit2=km
maxval=1 minval=0
''')

Result('errorAndCRSSurfaces',['dataReflectionSurface','crsAppSurface','error'],'SideBySideAniso')


# Build a mask to interleave zero traces with original data traces
Flow('aa',None,'spike n1=401 d1=0.0125 o1=0')
Flow('bb',None,'spike n1=401 d1=0.0125 o1=0 mag=0')
Flow('mask1','bb aa',
'''
interleave axis=1 ${SOURCES[1]} |
dd type=int
''')

Flow('a',None,'spike n1=401 d1=0.0125 o1=0')
Flow('b',None,'spike n1=401 d1=0.0125 o1=0 mag=0')
Flow('mask','a b',
'''
interleave axis=1 ${SOURCES[1]} |
dd type=int
''')
Flow('zeroTraceGather','b',
'''
spray axis=2 n=1001 d=0.0125 |
transp |
put label2=Offset unit2=Km label1=Time unit1=s
''')

# Data Mask with double of traces in CMP (half of CMP sampling)
# Keep the same Time and Offset original data sampling
Flow('mask0','mask',
'''
spray axis=1 n=1001 d=0.004
''')

totalPefIterations = 100
totalInterpolationIterations = 20

offsetGathers = []
for offsetGatherIndex in range(2):

offsetGather = "offsetGather-%i" % offsetGatherIndex
resampledOffsetGather = "resampledOffsetGather-%i" % offsetGatherIndex
interpolatedOffsetGather = "interpolatedOffsetGather-%i" % offsetGatherIndex
pefCoeficients = "pefCoeficients-%i" % offsetGatherIndex

Flow(offsetGather,'dataCube',
'''
window n2=1 f2=%i
''' % (offsetGatherIndex))

Flow(resampledOffsetGather,[offsetGather,'zeroTraceGather'],
'''
interleave axis=2 ${SOURCES[1]}
''')

# Calculate adaptive PEF coeficients
Flow(pefCoeficients,[resampledOffsetGather,'mask0'],
'''
apef jump=2 a=10,2 rect1=50 rect2=2 niter=%g verb=y
maskin=${SOURCES[1]}
''' % (totalPefIterations))

# 4. Interpolation
Flow(interpolatedOffsetGather, [resampledOffsetGather,pefCoeficients,'mask0','mask1'],
'''
miss4 exact=y filt=${SOURCES[1]} mask=${SOURCES[2]} niter=%g verb=y |
put d2=0.0125
''' % (totalInterpolationIterations))

offsetGathers.append(interpolatedOffsetGather)

# Concatenate interpolated sections
Flow('interpolatedDataCube',offsetGathers,
'''
rcat axis=3 ${SOURCES[0:%d]} |
transp plane=23
''' % offsetGatherIndex)



End()
37 changes: 37 additions & 0 deletions experiments/interpolation/graph_scons.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# coding: utf-8
#
# graph_scons.py (Python)
#
# Purpose: Definition of ploting functions.
#
# Site: http://www.dirackslounge.online
#
# Version 1.0
#
# Programer: Rodolfo Dirack 22/08/2019
#
# Email: rodolfo_profissional@hotmail.com
#
# License: GPL-3.0 <https://www.gnu.org/licenses/gpl-3.0.txt>.

def wiggle(title):
return '''
wiggle wheretitle=top yreverse=y transp=y label1=Time unit1=s label2=CMP unit2=km pclip=99.5 title="%s"
''' % title

def grey(title):
return '''
grey label1=Time unit1=s label2=CMP unit2=km pclip=99.5 title="%s"
''' % title

def grey3(title):
return '''
byte |
transp plane=23 |
grey3 flat=n frame1=500 frame3=80 frame2=200
label1=Time unit1=s
label3=Offset unit3=km
label2=CMP unit2=km
title="%s" point1=0.8 point2=0.8
''' % title

0 comments on commit 8d9a44f

Please sign in to comment.