Skip to content

Commit

Permalink
Generate simulated diffraction hyperbolas in a loop #2
Browse files Browse the repository at this point in the history
Generate a set of diffraction hyperbolas in a loop. Each iteration
is assigned to a reflector defined in layers vector
  • Loading branch information
Dirack committed Aug 21, 2020
1 parent b797477 commit 0fca09c
Showing 1 changed file with 45 additions and 29 deletions.
74 changes: 45 additions & 29 deletions experiments/algorithmVelocityInversion/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -105,35 +105,51 @@ Flow('velocityCube','stackedSection',
window min2=0 max2=5
''')

# Reflector iterative Picking
Flow('reflectorPickedPoints.txt','stackedSection',
'''
ipick
''')

# Next step is done with 'ascFormat.sh' Shell Script
# please check if the script have permissions to execute
# Build t0 coordinates file (pass 1 to generate t0s file)
Flow('t0s.asc','reflectorPickedPoints.txt',
'''
./ascFormat.sh 1
''')

Flow('t0s','t0s.asc','sfdd form=native')

# Build m0 coordinates file (pass 2 to generate m0s file)
Flow('m0s.asc','reflectorPickedPoints.txt',
'''
./ascFormat.sh 2
''')

Flow('m0s','m0s.asc','sfdd form=native')

# Diffraction simulation in stacked section
Flow(['returnedSection','diffSection'],['stackedSection','t0s','m0s'],
'''
diffsim diff=${TARGETS[1]} t0=${SOURCES[1]} m0=${SOURCES[2]} v=%g freq=10 verb=y
''' % (velocities[0]))
# Loop over reflectors
numberOfReflectors = len(layers)
section = 'stackedSection'

for i in range(numberOfReflectors):

reflectorPickedPoints = 'reflectorPickedPoints-%i.txt' % i
t0sFile = 't0s-%i' % i
t0sAscii = 't0s-%i.asc' %i
m0sFile = 'm0s-%i' % i
m0sAscii = 'm0s-%i.asc' % i
returnedSection = 'returnedSection-%i' % i
diffSection = 'diffSection-%i' % i

# Reflector iterative Picking
Flow(reflectorPickedPoints,section,
'''
ipick
''')

# Next step is done with 'ascFormat.sh' Shell Script
# please check if the script have permissions to execute
# Build t0 coordinates file (pass 1 to generate t0s file)
Flow(t0sAscii,reflectorPickedPoints,
'''
./ascFormat.sh 1 %s
''' % (t0sAscii))

Flow(t0sFile,t0sAscii,'sfdd form=native')

# Build m0 coordinates file (pass 2 to generate m0s file)
Flow(m0sAscii,reflectorPickedPoints,
'''
./ascFormat.sh 2 %s
''' % (m0sAscii))

Flow(m0sFile,m0sAscii,'sfdd form=native')

# Diffraction simulation in stacked section
Flow([returnedSection,diffSection],[section,t0sFile,m0sFile],
'''
diffsim diff=${TARGETS[1]} t0=${SOURCES[1]} m0=${SOURCES[2]} v=%g freq=10 verb=y
''' % (velocities[i]))

section = returnedSection

# Use aliases to split building
# Call it 'scons alias' to build
Expand Down

0 comments on commit 0fca09c

Please sign in to comment.