Skip to content

Feature/issue/17 #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 23, 2020
Merged

Feature/issue/17 #18

merged 8 commits into from
Aug 23, 2020

Conversation

Dirack
Copy link
Owner

@Dirack Dirack commented Aug 23, 2020

📤 Pull Request

Description

Now the program sfdiffsim receives velocity input as a command-line parameter. Because the program considers that all the received (t0,m0) pairs in the t0s and m0s files pertain to the same reflector in the stacked section. This is done in order to allow the program to run in a loop, it generates a set of diffraction hyperbolas for a given reflector in each iteration of the loop.

if(!sf_getfloat("v",&v)) sf_error("No v= hyperbolas velocity!");
	/* Hyperbolas velocity (Km/s)*/

Divide velocity by 2 because it uses the exploding reflector model to simulate diffractions in the stacked section.

	/* half medium velocity for diffraction */
	v=v/2;

Add an if condition to check if the calculated time sample is inside the section to avoid segmentation fault errors (it is the calculated time sample index, it can't be major than the number of the time samples in the section, nt0. i is the calculated CMP sample index, it can't be negative and major than the number of CMP samples in the section).

/* Jump to next iteration if its outside of the section */
			if(it >= nt0 || i >= nm0 || i < 0) continue;

Resolve #17

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Add images bellow and additional context if needed

Usage example of the new version of the program in a loop (use sfipick to do an iterative picking for each reflector and simulate diffractions hyperbolas in the stacked section with sfdiffsim).

# 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]} aperture=1
		t0=${SOURCES[1]} m0=${SOURCES[2]} v=%g freq=10 verb=y
		''' % (velocities[i]))

	section = returnedSection

Image of the picking and diffraction simulation step (Available in creVelocityInversion package):

Screenshot from 2020-08-23 17-25-24

Dirack added 8 commits August 21, 2020 12:16
Program sfdiffsim now reads a velocity vector with a sample for each
reflector. Each sample of the velocity vector is assigned to a set of
(t0,m0) pairs in t0s and m0s files. Because of that, t0s and m0s files
now have n2 axis assigned to a given velocity sample in velocity vector.

So, v[0] corresponds to a velocity sample for
(t0[0][0],m0[0][0]),(t0[1][0],m0[1][0]),(t0[2][0],m0[2][0])... pairs

and  v[1] corresponds to a velocity sample for
(t0[0][1],m0[0][1]),(t0[1][1],m0[1][1]),(t0[2][1],m0[2][1])... pairs

and so on...
Modify the program sfdiffsim to receive one velocity each time for
a set of (t0, m0) pairs for a given reflector. It allows the program
to run in a loop, each iteration of the loop receive (t0,m0) pairs
picked above one reflector in the stacked section.
To simulate a stacked section with diffraction hyperbolas someone
should use half of the medium velocity in the hyperbola equation
following the model of a exploding reflector.
A division v=v/2 inside of a loop is a logic error because this
division will be done each loop iteration.
Use pm0 and pt0 directly to calculate hyperbola traveltime
instead of using intermediate steps with m0, it0 and t0.
To avoid segmentation fault errors, check if calculated traveltime
sample is outside the section, if it is the case, jump to the next
itaration. This check will allow the user to pick and generate
hyperbolas closer to the section boundaries
@Dirack Dirack added the enhancement New feature or request label Aug 23, 2020
@Dirack Dirack added this to the V0.1-beta.1 milestone Aug 23, 2020
@Dirack Dirack self-assigned this Aug 23, 2020
@Dirack Dirack linked an issue Aug 23, 2020 that may be closed by this pull request
@Dirack Dirack merged commit 8eae563 into develop/0.1 Aug 23, 2020
@Dirack Dirack deleted the feature/issue/17 branch August 23, 2020 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Modify the way sfdiffsim receives layers velocity input
1 participant