Skip to content

Commit

Permalink
Merge pull request #48 from Dirack/develop/2.2.0
Browse files Browse the repository at this point in the history
Develop/2.2.0
  • Loading branch information
Dirack authored Feb 21, 2024
2 parents ed6cee0 + 3cad0f5 commit be22431
Show file tree
Hide file tree
Showing 68 changed files with 461 additions and 310 deletions.
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ Please delete options that are not relevant.
- 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 aditional context if needed**
**Add images bellow and additional context if needed**

Please describe more information and tests that you ran to verify your changes.
Or add descriptive images.

**For new a version deploy (pull request to main branch)**

Please check out the list of manual tests and checks. Add new tests if needed before deploy of a new version.
Merge is only allowed for completed checklist. You can detail those itens in pull request comentaries (this
will suspend merge until all the comentaries are resolved).
Merge is only allowed for completed checklist. You can detail those items in pull request commentaries (this
will suspend merge until all the commentaries are resolved).

- [ ] Verify README.md of this version
- [ ] Verify README.md links
Expand Down
24 changes: 0 additions & 24 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ Fig/
*.x
convgraph
mtconvgraph
vfsacrsnh_lib.h
nhcrssurf_lib.h
dummyfile
9 changes: 6 additions & 3 deletions Mnhcrssurf.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* Build Non-Hyperbolic CRS approximation surface (Fomel and Kazinnik, 2013) for RN, RNIP and BETA parameters given.
Package version: 2.0.1
Programmer: Rodolfo A. C. Neves (Dirack) 19/09/2019
Email: rodolfo_profissional@hotmail.com
Expand All @@ -10,6 +8,7 @@ License: GPL-3.0 <https://www.gnu.org/licenses/gpl-3.0.txt>.
*/

#include "nhcrssurf_lib.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -37,6 +36,7 @@ int main(int argc, char* argv[])
float h; // half-offset
int nc; // number of parameters
int ih, im; // loop counters
char strerr[100]; // Buffer to show error message

/* RSF files I/O */
sf_file in; // Traveltime surface with the output dimensions
Expand Down Expand Up @@ -68,7 +68,8 @@ int main(int argc, char* argv[])
if (!sf_histfloat(in,"d2",&dm)) sf_error("No d2= in input");
if (!sf_histfloat(in,"o2",&om)) sf_error("No o2= in input");

if(!sf_histint(par,"n1",&nc)) sf_error("No n1= in parameters input");
if(!checkParametersFileDimensionN1(par,&nc,strerr))
sf_error("%s",strerr);

if(! sf_getbool("verb",&verb)) verb=0;
/* 1: active mode; 0: quiet mode */
Expand All @@ -92,6 +93,8 @@ int main(int argc, char* argv[])
RNIP = c[1];
BETA = c[2];

if(!checkIfParametersAreTooSmall(v0,RN,RNIP,strerr))
sf_error("%s",strerr);

t = sf_floatalloc2(nh,nm);

Expand Down
4 changes: 1 addition & 3 deletions Mvfsacrsnh.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/* Zero offset CRS parameter inversion of RN, RNIP, BETA with Very Fast Simulated Annealing (VFSA) Global Optimization. This program uses the Non-Hyperbolic CRS approximation (Fomel and Kazinnik, 2013) to fit seismic data cube and get the best parameters using semblance criteria.
Package version: 2.1.1
/* Zero offset CRS parameters optimization of RN, RNIP, BETA with Very Fast Simulated Annealing (VFSA) Global Optimization. This program uses the Non-Hyperbolic CRS approximation (Fomel and Kazinnik, 2013) to fit seismic data cube and get the best parameters using semblance criteria.
Programmer: Rodolfo A. C. Neves (Dirack) 13/08/2021
Expand Down
2 changes: 1 addition & 1 deletion debug/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ else
endif
@echo "...done"

# run optimization test with scons to measure execution time
# Generate input data for debug session
generate_data_cube: test_data_cube/SConstruct
@echo "\033[95mGenerate a data cube for tests\033[m"
cd test_data_cube && scons -s -Q
Expand Down
13 changes: 2 additions & 11 deletions debug/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
#### TESTS DIRECTORY OF VFSA PROGRAMS
# Debug directory for vfsa debug sessions with GDB

Those tests run in the program make. There are several
types of tests that can be done:

- Unit tests: Just run the command 'make' to run all unit tests
in the file 'Test\_vfsacrsnh.c'.

- Optimization tests: Run 'make time' to run the optimization
tests and to show execution time of the program with scons.

- GDB debug: Run 'make vfsa.x' to generate the executable vfsa.x
- GDB debug session: Run 'make' or 'make vfsa.x' to generate the executable vfsa.x
to be used in debugging with GNU Debugger (GDB). The 'gdb\_scripts/gdb\_script'
file can be used to load all arguments needed to run the program in GDB. Use
'source gdb\_scripts/gdb\_script' in GDB shell.
Expand Down
15 changes: 15 additions & 0 deletions debug/gdb_scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# GDB scripts for debug

This is a repository of several GNU Debugger (GDB) Scripts for debug sessions using GDB.
You can load those scripts in GDB console or use it as a template to load parameters in GDB.
Use the command inside gdb shell to load args for 'Mvfsacrsnh.c':

```
source gdb_script
```

Or you could load the GDB script when calling gdb to starting a new debug session:

```
gdb --command=gdb_script vfsa.x
```
2 changes: 1 addition & 1 deletion debug/gdb_scripts/gdb_script
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Purpose: Load test parameters in GDB. Use the command
# 'source gdb_script' inside gdb shell to load args.
#
# Site: https://dirack.github.io
# Site: https://www.geofisicando.com
#
# Programmer: Rodolfo A C Neves (Dirack) 04/01/2021
#
Expand Down
5 changes: 3 additions & 2 deletions debug/gdb_scripts/gdb_test
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# gdb_script (GDB Script)
#
# Purpose: Run test in GDB shell.
# Purpose: Load test parameters in GDB. Use the command
# 'source gdb_script' inside gdb shell to load args.
#
# Site: https://dirack.github.io
# Site: https://www.geofisicando.com
#
# Programmer: Rodolfo A C Neves (Dirack) 04/01/2021
#
Expand Down
5 changes: 3 additions & 2 deletions debug/gdb_scripts/gdb_test_mtgraph
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# gdb_script (GDB Script)
#
# Purpose: Run test in GDB shell.
# Purpose: Load test parameters in GDB. Use the command
# 'source gdb_script' inside gdb shell to load args.
#
# Site: https://dirack.github.io
# Site: https://www.geofisicando.com
#
# Programmer: Rodolfo A C Neves (Dirack) 04/01/2021
#
Expand Down
5 changes: 3 additions & 2 deletions debug/gdb_scripts/gdb_test_varlim
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# gdb_script (GDB Script)
#
# Purpose: Run test in GDB shell.
# Purpose: Load test parameters in GDB. Use the command
# 'source gdb_script' inside gdb shell to load args.
#
# Site: https://dirack.github.io
# Site: https://www.geofisicando.com
#
# Programmer: Rodolfo A C Neves (Dirack) 04/01/2021
#
Expand Down
5 changes: 2 additions & 3 deletions debug/test_data_cube/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#### Optimization test of the programs with scons
# Generate data for debug vfsa package

Generate a datacube and run vfsa global optimization to
measure execution time using scons.
Generate a datacube and parameters files for vfsa debug session using scons.
6 changes: 2 additions & 4 deletions debug/test_data_cube/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
#
# SConstruct (Madagascar Script)
#
# Purpose: Optimization test of VFSA process.
# Purpose: Generate data for debug vfsa package
#
# Site: https://dirack.github.io
#
# Version 1.0
# Site: https://www.geofisicando.com
#
# Programer: Rodolfo A. C. Neves (Dirack) 10/11/2020
#
Expand Down
8 changes: 4 additions & 4 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## How to contribute to this project?
# How to contribute to this project?

To contribute to this project, please follow the steps below.

Expand Down Expand Up @@ -34,7 +34,7 @@ The purpose of this nomination rule is to allow the developer to identify the is

The default branch (main or master) and development branch names follow the rules below:

- The development branch is opened by the repository's administrator, and its name is **develop/VERSION** ('VERSION' means the current tag version being developed, example develop/1.1.0 mean this branch is the development branch of the 1.1.0 version)
- The development branch is opened by the repository's administrator, and its name is **develop/VERSION** ('VERSION' means the current tag version being developed, example develop/1.1.0 means this branch is the development branch of the 1.1.0 version)

- The default branch is _main_ (or _master_) and only the repository's administrator can modify it

Expand All @@ -46,7 +46,7 @@ The branch merge follows _gitflow_ rules:

- The branch _master_ receives modifications from _develop_ and bug corrections from _hotfix_

- The branch _develop_ receives modifications from any other branch, include bug corrections from _master_
- The branch _develop_ receives modifications from any other branch, including bug corrections from _master_

## 4. Do clear _commit_ messages (a title with 50 characters and two paragraphs of text)

Expand Down Expand Up @@ -75,7 +75,7 @@ If you add a new file, it is important to add descriptive headers in the top of
#
# Purpose: Test vfsa program in multiple interfaces model.
#
# Site: https://dirack.github.io
# Site: https://www.geofisicando.com
#
# Programmer: Rodolfo A C Neves (Dirack) 26/03/2020
#
Expand Down
2 changes: 1 addition & 1 deletion docs/VERSION.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.1
2.2.0
54 changes: 32 additions & 22 deletions examples/fullParametersOptimization/README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,58 @@
#### Usage examples of sfvfsacrsnh for a set of (t0,m0) pairs
# Usage examples of sfvfsacrsnh for a set of (t0,m0) pairs

In this usage example we use the same gaussian reflector model as input and kirchhoff modeling. We use _sfvfsacrsnh_ to obtain the CRS parameters for a set of (t0,m0) pairs.

### How to run it?
## How to run it?

* Run 'scons' in this directory (it may take some time):

```sh
~$ scons
```

#### Expected outcomes
## Expected outcomes

Scons will generate a parameters cube in 'crsParameters.rsf' file. The optimized parameters
are organized in the current order: RN, RNIP, BETA, Semblance, C0, Temp0, t0, m0.
are organized in the current order: RN, RNIP, BETA, Semblance.
The RN, RNIP and BETA are the zero offset CRS parameters. Semblance is the semblance measure
between the non-hyperbolic CRS traveltime approximation and the seismic data cube in a CMP x
offset window around Central CMP m0. The parameters C0 and Temp0 are the VFSA parameters used
inside the optimization algorithm. And (t0,m0) pair is a time x CMP coordinate around the
zero offset CRS approximation is calculated.
offset window around Central CMP m0.

The parameters cube in 'crsParameters.rsf' file is organized as follows:

```sh
~$ sfin crsParameters.rsf

crsParameters.rsf:
in="/home/dirack/rsfdata/vfsa/usage_examples/fullParametersOptimization/crsParameters.rsf@"
in="/home/rodolfo/rsfdata/vfsa/examples/fullParametersOptimization/crsParameters.rsf@"
esize=4 type=float form=native
n1=8 d1=1 o1=0 label1="parameters" unit1=""
n2=6 d2=1 o2=0 label2="(t0,m0) index" unit2=""
n3=1 d3=1 o3=0 label3="" unit3=""
48 elements 192 bytes
n1=2 d1=0.1 o1=1.1 label1="t0" unit1="s"
n2=3 d2=1 o2=3 label2="m0" unit2="km"
n3=4 d3=1 o3=0 label3="parameters" unit3="RN, RNIP, BETA, Semblance"
```

For each (t0,m0) pair (n2 coordinate) we get 8 parameters (n1 coordinate) as described above:
For each (t0,m0) pair (n1 coordinate, n2 coordinate) we get 4 parameters (n3 coordinate) as described above.

```sh
~$ sfdisfil < crsParameters.rsf col=8
Use the following commands to dump parameters values from parameters cube (values should change from one iteration to another).

- Get RN values:

```
<crsParameters.rsf sfwindow n3=1 f3=0 | sfdisfil col=1
```

0: 2.677 2.228 -0.2981 0.4372 0.5 10 1.1 3
8: 4.815 3.804 -0.2447 0.374 0.5 10 1.2 3
16: 4.768 3.813 -0.2614 0.1921 0.5 10 1.1 4
24: 3.127 1.081 -0.287 0.1964 0.5 10 1.2 4
32: 3.105 1.129 -0.002743 0.9898 0.5 10 1.1 5
40: 3.12 1.168 -0.01008 0.9028 0.5 10 1.2 5
- Get RNIP values:

```
<crsParameters.rsf sfwindow n3=1 f3=1 | sfdisfil col=1
```
- Get BETA values:

```
<crsParameters.rsf sfwindow n3=1 f3=2 | sfdisfil col=1
```
- Get Semblance values:

```
<crsParameters.rsf sfwindow n3=1 f3=3 | sfdisfil col=1
```

4 changes: 1 addition & 3 deletions examples/fullParametersOptimization/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ from rsf.proj import *
import math

__author__="Rodolfo Dirack <rodolfo_profissional@hotmail.com>"
__version__="1.0"
__site__="https://www.geofisicando.com"

Help('''
Expand All @@ -32,9 +31,8 @@ Help('''
global optimization
Author: %s
Version: %s
Site: %s
''' % (__author__,__version__,__site__))
''' % (__author__,__site__))

Help('''
### Kirchhoff modeling ###
Expand Down
11 changes: 4 additions & 7 deletions examples/gaussian_reflector_model/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ In this usage example we use a gaussian reflector model as input and kirchhoff m
seismic data cube (Seismic data organized in CMP x Offset x Time coordinates) from it.

After that we use _sfvfsacrsnh_ to fit the non-hyperbolic CRS traveltime approximation in the reflection traveltime surface
exatracted from the data cube. Finally, we plot these surfaces and approximation error side by side.
exatracted from the data cube. Finally, we plot these surfaces and approximation error side by side using the program _sfnhcrssurf_.

### How to run it?
## How to run it?

* Run 'scons view' in this directory (it may take some time):

```sh
~$ scons view
```

#### Expected outcomes
## Expected outcomes

After the program _scons_ do all the steps in the SConstruct file, you will see the generated surfaces as follow:

Expand All @@ -25,10 +25,7 @@ exatracted from the data cube. Finally, we plot these surfaces and approximation

```sh
~$ sfdisfil <crsParameters.rsf
0: 3.23 0.9706 -0.003872 0.7791 0.5
5: 10 1.1 5
0: 4.725 0.2558 -0.001232 0.5248
```

The first 3 numbers are RN, RNIP and BETA. The fourth one is the semblance (it may change from one running to another).
The fifth and sixth are C0 and Temp0, arbitrary parameters used in vfsa that may change from problem to problem. Finally
t0 (Normal ray traveltime) and m0 (Central CMP of the approximation) are the last ones.
Loading

0 comments on commit be22431

Please sign in to comment.