Skip to content
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

Develop/2.0.4 #40

Merged
merged 5 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions test/test_parameters/fixed_temp0/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
all: generate_data generate_plot view

generate_data: SConstruct
scons

generate_plot: plot_test.py
python plot_test.py > surface.asc

view: SConscript
scons -f $< view
26 changes: 26 additions & 0 deletions test/test_parameters/fixed_temp0/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# SConstruct (Madagascar Script)
#
# Purpose: Parameters test of VFSA process.
#
# Site: https://dirack.github.io
#
# Version 1.0
#
# Programer: Rodolfo A. C. Neves (Dirack) 10/11/2020
#
# Email: rodolfo_profissional@hotmail.com
#
# License: GPL-3.0 <https://www.gnu.org/licenses/gpl-3.0.txt>.

# Madagascar library
from rsf.proj import *

s="surface"
Flow(s,s+'.asc','dd type=float form=native | smooth rect1=5 rect2=5 repeat=1')

Result(s,'grey color=j scalebar=y title=Semblance')

End()
8 changes: 4 additions & 4 deletions test/test_parameters/fixed_temp0/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ Flow('dataCube','gaussianReflector reflectorDip',


oc0=0.
dc0=0.033
nc0=31
dc0=0.01
nc0=100

ont=0.
dnt=3
nnt=31
dnt=1
nnt=100

om0=5
dm0=0.1
Expand Down
27 changes: 2 additions & 25 deletions test/test_parameters/fixed_temp0/plot_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import subprocess
import matplotlib.pyplot as plt
from matplotlib import cm
import numpy as np

oc0=0.
dc0=0.033
Expand Down Expand Up @@ -40,26 +37,6 @@
lc0.append(float(lista[0]))
lnt.append(float(lista[1]))
lsemb.append(float(lista[3]))
#print(str(c0)+' '+str(temp0)+' '+result)

#fig, ax = plt.subplots(subplot_kw={"projection": "3d"})
# Creating figure
fig = plt.figure(figsize =(14, 9))
ax = plt.axes(projection ='3d')
# Plot the surface.
print(lsemb)
x=np.arange(oc0,1.023,dc0)
y=np.arange(ont,nnt*dnt+ont,dnt)
z=np.array(lsemb).reshape(nc0,nnt)
surf = plt.contour(x,y,z, cmap=cm.coolwarm,linewidth=0, antialiased=False)
# Plot the surface.
#surf = ax.plot_surface(x, y, z)
# Creating plot
#surf = ax.plot_surface(x, y, z,
# edgecolor ='none')
print(float(lista[3]))

fig.colorbar(surf, ax = ax,
shrink = 0.5, aspect = 5)

ax.set_title('Surface plot')
plt.show()
print("n1=%d d1=%g o1=%g label1=c0 n2=%d d2=%g o2=%g label2=Iterations data_format=ascii_float in=surface.asc" % (nc0,dc0,oc0,nnt,dnt,ont))
30 changes: 6 additions & 24 deletions test/test_parameters/fixed_trial_moves/Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,10 @@
# Makefile
#
# Purpose: Run parameters test.
#
# Site: https://www.geofisicando.com
#
# Programmer: Rodolfo A C Neves (Dirack) 06/11/2020
#
# Email: rodolfo_profissional@hotmail.com
#
# License: GPL-3.0 <https://www.gnu.org/licenses/gpl-3.0.txt>.
all: generate_data generate_plot view

# Default is to run the test
all: test

# run parameters test with scons to measure execution time
test: parameters_test/SConstruct
@echo "\033[95mRunning parameters test\033[m"
generate_data: SConstruct
scons
@echo ...done

clean:
scons -c

help:
@echo "Run 'make' to run parameters test"
generate_plot: plot_test.py
python plot_test.py > surface.asc

.PHONY: clean help all
view: SConscript
scons -f $< view
28 changes: 28 additions & 0 deletions test/test_parameters/fixed_trial_moves/Makefile bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Makefile
#
# Purpose: Run parameters test.
#
# Site: https://www.geofisicando.com
#
# Programmer: Rodolfo A C Neves (Dirack) 06/11/2020
#
# Email: rodolfo_profissional@hotmail.com
#
# License: GPL-3.0 <https://www.gnu.org/licenses/gpl-3.0.txt>.

# Default is to run the test
all: test

# run parameters test with scons to measure execution time
test: parameters_test/SConstruct
@echo "\033[95mRunning parameters test\033[m"
scons
@echo ...done

clean:
scons -c

help:
@echo "Run 'make' to run parameters test"

.PHONY: clean help all
26 changes: 26 additions & 0 deletions test/test_parameters/fixed_trial_moves/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# SConstruct (Madagascar Script)
#
# Purpose: Parameters test of VFSA process.
#
# Site: https://dirack.github.io
#
# Version 1.0
#
# Programer: Rodolfo A. C. Neves (Dirack) 10/11/2020
#
# Email: rodolfo_profissional@hotmail.com
#
# License: GPL-3.0 <https://www.gnu.org/licenses/gpl-3.0.txt>.

# Madagascar library
from rsf.proj import *

s="surface"
Flow(s,s+'.asc','dd type=float form=native | smooth rect1=5 rect2=5 repeat=1')

Result(s,'grey color=j scalebar=y title=Semblance')

End()
11 changes: 6 additions & 5 deletions test/test_parameters/fixed_trial_moves/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ Flow('dataCube','gaussianReflector reflectorDip',


oc0=0.
dc0=0.033
nc0=31
dc0=0.01
nc0=100

otemp0=0.
dtemp0=0.1
ntemp0=31
dtemp0=0.03
ntemp0=100

om0=5
dm0=0.1
Expand All @@ -77,7 +77,8 @@ for temp0i in range(ntemp0):
# Very Fast Simulated Aneelling Global Optimization (VFSA)
Flow(parameters,'dataCube',
'''
vfsacrsnh om0=%g dm0=%g nm0=%d ot0=%g dt0=%g nt0=%d v0=%g verb=y repeat=1
vfsacrsnh itmax=200
om0=%g dm0=%g nm0=%d ot0=%g dt0=%g nt0=%d v0=%g verb=y repeat=1
half=y
c0=%g temp0=%g
''' % (om0,dm0,nm0,ot0,dt0,nt0,v0,c0,temp0))
Expand Down
27 changes: 2 additions & 25 deletions test/test_parameters/fixed_trial_moves/plot_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import subprocess
import matplotlib.pyplot as plt
from matplotlib import cm
import numpy as np

oc0=0.
dc0=0.033
Expand Down Expand Up @@ -40,26 +37,6 @@
lc0.append(float(lista[0]))
ltemp0.append(float(lista[1]))
lsemb.append(float(lista[3]))
#print(str(c0)+' '+str(temp0)+' '+result)

#fig, ax = plt.subplots(subplot_kw={"projection": "3d"})
# Creating figure
fig = plt.figure(figsize =(14, 9))
ax = plt.axes(projection ='3d')
# Plot the surface.
print(lsemb)
x=np.arange(oc0,1.023,dc0)
y=np.arange(otemp0,ntemp0*dtemp0+otemp0,dtemp0)
z=np.array(lsemb).reshape(nc0,ntemp0)
surf = plt.contour(x,y,z, cmap=cm.coolwarm,linewidth=0, antialiased=False)
# Plot the surface.
#surf = ax.plot_surface(x, y, z)
# Creating plot
#surf = ax.plot_surface(x, y, z,
# edgecolor ='none')
print(float(lista[3]))

fig.colorbar(surf, ax = ax,
shrink = 0.5, aspect = 5)

ax.set_title('Surface plot')
plt.show()
print("n1=%d d1=%g o1=%g label1=c0 n2=%d d2=%g o2=%g label2=temp0 data_format=ascii_float in=surface.asc" % (nc0,dc0,oc0,ntemp0,dtemp0,otemp0))
Loading