Skip to content

Commit 0b7f51b

Browse files
authored
Merge pull request #60 from Dirack/develop/2.1
Develop/2.1
2 parents 61eaaf5 + b9cc6ab commit 0b7f51b

27 files changed

+5364
-562
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ checkpoints
3131
*.jp2
3232
.ipynb_checkpoints/
3333
*.asc
34+
*.x
35+
*.deploy

.travis.yml

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,50 @@
1+
language: bash
2+
os: linux
3+
dist: xenial
4+
env:
5+
global:
6+
- UNIT_TEST=true
7+
- MODELING_GAUSS=true
8+
- MODELING_MULTI=true
9+
- DEPLOY=false
110
git:
211
depth: 1
312
branches:
413
only:
514
- master
615
- /^develop.*$/
7-
- teste
16+
- test
817
jobs:
918
include:
10-
- stage: modeling
11-
script: ./test_travis_docker.sh test_gaussianModelBuild
12-
- script: ./test_travis_docker.sh test_multiLayerModelBuild
13-
- stage: deploy
14-
script: echo "TODO deploy"
19+
- stage: Unit test
20+
name: Unit test
21+
if: env(UNIT_TEST)=true
22+
script: ./TDD/test_travis_docker.sh 'make'
23+
- stage: Modeling
24+
name: Gaussian Reflector
25+
if: env(MODELING_GAUSS)=true
26+
script: ./TDD/test_travis_docker.sh 'python -m unittest test_gaussianModelBuild'
27+
- if: env(MODELING_MULTI)=true
28+
script: ./TDD/test_travis_docker.sh 'python -m unittest test_multiLayerModelBuild'
29+
name: Multi Layer
30+
- stage: Deploy
31+
name: Deploy
32+
if: env(DEPLOY)=true
33+
script: echo "Deploy"
34+
before_deploy:
35+
- git config --local user.name "dirack"
36+
- git config --local user.email "[email protected]"
37+
- export TRAVIS_TAG=$(cat VERSION.md)
38+
- deploy/build_tag_message.sh
39+
- git tag -a $TRAVIS_TAG -F tag.deploy
40+
deploy:
41+
provider: releases
42+
token: $GITHUB_TOKEN
43+
skip_cleanup: true
44+
draft: true
45+
script: 'git push --tag'
46+
on:
47+
repo: Dirack/creGatherStack
48+
branch:
49+
- master
50+
- test

CHANGELOG.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## UNRELEASED - Contribute with the next version
9+
10+
## [v2.2.0](https://github.com/Dirack/creGatherStack/compare/v2.1.0-beta.1...develop/2.2) - 2020-10-11
11+
12+
## RELEASED
13+
14+
## [v2.1.0-beta.1](https://github.com/Dirack/creGatherStack/releases/tag/v2.1.0-beta.1) (Beta) - 2020-10-11
15+
16+
## Added
17+
18+
- New program rnip2vmrs to estimate VRMS from RNIP values Resolve [#54](https://github.com/Dirack/creGatherStack/issues/54) [25136ea](https://github.com/Dirack/creGatherStack/commit/25136ea) [6a7b0c9](https://github.com/Dirack/creGatherStack/commit/6a7b0c9)
19+
20+
- Use sfrnip2vrms program in all experiments [#55](https://github.com/Dirack/creGatherStack/issues/55) [e031436](https://github.com/Dirack/creGatherStack/commit/e031436)
21+
22+
## Modified
23+
24+
- CRE Gather stack is now a function of creGatherStack.py recipe, and allow CDS option Resolve [#59](https://github.com/Dirack/creGatherStack/issues/59) [af9c8db](https://github.com/Dirack/creGatherStack/commit/af9c8db)
25+
26+
- Unit test directory: TDD directory [39eace3](https://github.com/Dirack/creGatherStack/commit/39eace3)
27+
28+
## Changed
29+
30+
- Update README with references to the changelog and wiki instead of the release history section [475e679](https://github.com/Dirack/creGatherStack/commit/475e679)
31+
32+
## [v2.0.0](https://github.com/Dirack/creGatherStack/releases/tag/v2.0) (Stable) - 2020-09-21
33+
34+
### Added
35+
36+
- Travis CI test [43a01fe](https://github.com/Dirack/creGatherStack/commit/43a01fe)
37+
- Travis CI automatic test Resolve [#8](https://github.com/Dirack/creGatherStack/issues/8) [43a58c3](https://github.com/Dirack/vfsa/commit/43a58c3)
38+
- Establish kimodel.py and pefInterpolation.py as dependencies Resolve [#43](https://github.com/Dirack/creGatherStack/issues/43) [44d8eb9](https://github.com/Dirack/vfsa/commit/44d8eb9)
39+
- Define aperture=20 for sfgetcregather and correct bug Resolve [#49](https://github.com/Dirack/creGatherStack/issues/49) [feb03c1](https://github.com/Dirack/vfsa/commit/feb03c1) [405199d](https://github.com/Dirack/vfsa/commit/405199d)
40+
- Use explicit dependency to avoid building errors Resolve [#44](https://github.com/Dirack/creGatherStack/issues/44) [35aa3c9](https://github.com/Dirack/vfsa/commit/35aa3c9)
41+
- Allow experiments SConstructs to receive parameters from the command line [6edd9ef](https://github.com/Dirack/creGatherStack/commit/6edd9ef)
42+
43+
## [v1.0.0-beta.1](https://github.com/Dirack/creGatherStack/releases/tag/v1.0-beta.1) (Beta) - 2020-09-12
44+
45+
### Added
46+
47+
- New usage example: Multi-layer model, in pull request [#42](https://github.com/Dirack/creGatherStack/issues/42) Resolve [#37](https://github.com/Dirack/vfsa/issues/37) [cf1568e](https://github.com/Dirack/vfsa/commit/cf1568e)
48+
49+
## Removed
50+
51+
- Remove pefInterpolation example Resolve [#45](https://github.com/Dirack/creGatherStack/issues/45) [c095796](https://github.com/Dirack/vfsa/commit/c095796)
52+
53+
## Fixed
54+
55+
- Avoid CMP coordinate to get out of of model bounds correct bug [#38](https://github.com/Dirack/creGatherStack/issues/38) [3f6b469](https://github.com/Dirack/vfsa/commit/3f6b469) [72ed7c1](72ed7c1)
56+
57+
- Avoid segmentation fault in sfvfsacrsnh, correct bug [#39](https://github.com/Dirack/creGatherStack/issues/39) [ed9043d](https://github.com/Dirack/vfsa/commit/ed9043d)
58+
59+
## [v0.1.2-alpha.1](https://github.com/Dirack/creGatherStack/releases/tag/v0.1.2-alpha.1) (Development) - 2020-09-12
60+
61+
- Test CRE stacking with CDS condition applied to the Non-hyperbolic CRS approximation [#26](https://github.com/Dirack/creGatherStack/issues/26) [d20c1c1](https://github.com/Dirack/vfsa/commit/d20c1c1)
62+
63+
- Test of the CRE stacking using CRE traveltime approximation [#26](https://github.com/Dirack/creGatherStack/issues/26) [1a0e765](https://github.com/Dirack/vfsa/commit/1a0e765)
64+
65+
## [v0.1.1-alpha.1](https://github.com/Dirack/creGatherStack/releases/tag/v0.1.2-alpha.1) (Development) - 2020-04-21
66+
67+
## Added
68+
69+
- CRE stacking with CDS condition (RNIP=RN) in non-hyperbolic traveltime approximation [#3](https://github.com/Dirack/creGatherStack/issues/3) [4ad17bb](https://github.com/Dirack/vfsa/commit/4ad17bb)
70+
71+
- Define functions in creStack.py to modeling and interpolation steps [#9](https://github.com/Dirack/creGatherStack/issues/9) [73a38c0](https://github.com/Dirack/vfsa/commit/73a38c0)
72+
73+
## Removed
74+
75+
- Delete useless usage examples Resolve [#34](https://github.com/Dirack/creGatherStack/issues/34) [0fe314e](https://github.com/Dirack/vfsa/commit/0fe314e)
76+
77+
- Remove vfsa programs from package, establish them as a dependency Resolve [#22](https://github.com/Dirack/creGatherStack/issues/22) [d2f9ddf](https://github.com/Dirack/vfsa/commit/d2f9ddf)
78+
79+
## [v0.1.0-alpha.1](https://github.com/Dirack/creGatherStack/releases/tag/v0.1.2-alpha.1) (Development) - 2020-04-21
80+
81+
## Added
82+
83+
- Gaussian reflector Kirchoff modeling [aff870d](https://github.com/Dirack/creGatherStack/commit/aff870d)
84+
85+
- zero offset CRS parameters optimization with VFSA [14fcbdf](https://github.com/Dirack/creGatherStack/commit/14fcbdf)
86+
87+
- PEF interpolation of the data cube to increase CMP sampling [8d9a44f](https://github.com/Dirack/creGatherStack/commit/8d9a44f)
88+
89+
- Program _sfcretrajec_ to calculate CRE trajectory for RNIP and BETA [8b54e94](https://github.com/Dirack/creGatherStack/commit/8b54e94)
90+
91+
- Program _sfgetcregather_ to build the CRE Gather [2872fdd](https://github.com/Dirack/creGatherStack/commit/2872fdd)
92+
93+
- Program _sfgetcretimecurve_ to build the CRE traveltime curve [da8b919](https://github.com/Dirack/creGatherStack/commit/da8b919)
94+
95+
- Program _sfcrestack_ to CRE stacking [5c4e633](https://github.com/Dirack/creGatherStack/commit/5c4e633)
96+
97+
- Jupyter Notebook of the Kirchhoff modeling step [40ac351](https://github.com/Dirack/creGatherStack/commit/40ac351)
98+
99+
- Scratch of a reproducible paper for modeling step [494faf2](https://github.com/Dirack/creGatherStack/commit/494faf2)
100+
101+
## Fixed
102+
103+
- Correct bug in alpha parameter bounds in the program Mcretrajec.c [699f169](https://github.com/Dirack/creGatherStack/commit/699f169)
104+

Mrnip2vrms.c

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/* Version 1.0 - Estimate root mean square velocity (VRMS) from RNIP
2+
3+
This program is based on multifocus formula that allows to estimate
4+
VRMS from RNIP: vrms = sqrt(2*RNIP*v0/t0)
5+
6+
Reference: Diffraction imaging by multifocusing, Berkovitch A.,
7+
Belfer I., Hassin Y., and Landa E., 2009.
8+
9+
Programer: Rodolfo A C Neves (Dirack) 21/09/2020
10+
11+
12+
13+
License: GPL-3.0 <https://www.gnu.org/licenses/gpl-3.0.txt>.
14+
*/
15+
16+
#include "rnip2vrms_lib.h"
17+
#include <rsf.h>
18+
/*^*/
19+
20+
int main(int argc,char* argv[]){
21+
22+
bool verb; // Verbose parameter
23+
int nt0; // Number of t0's in stacked section
24+
float dt0; // Time sampling in stacked section
25+
float ot0; // Origin of the time axis in stacked section
26+
int nm0; // Number of CMP's in stacked section
27+
float dm0; // CMP sampling in stacked section
28+
float om0; // Origin of the CMP axis in stacked section
29+
float v0; // Near surface velocity
30+
float** rnip; // (t0,m0,rnip) section
31+
float** vrmsSection; // (t0,m0,VRMS) section
32+
33+
sf_file in,out;
34+
sf_init(argc,argv);
35+
36+
in = sf_input("in");
37+
out = sf_output("out");
38+
39+
/* Read coordinates of the stacked section file */
40+
if(!sf_histint(in,"n1",&nt0)) sf_error("No n1= in input");
41+
if(!sf_histfloat(in,"d1",&dt0)) sf_error("No d1= in input");
42+
if(!sf_histfloat(in,"o1",&ot0)) sf_error("No o1= in input");
43+
if(!sf_histint(in,"n2",&nm0)) sf_error("No n2= in input");
44+
if(!sf_histfloat(in,"d2",&dm0)) sf_error("No d2= in input");
45+
if(!sf_histfloat(in,"o2",&om0)) sf_error("No o2= in input");
46+
47+
if(!sf_getbool("verb",&verb)) verb=0;
48+
/*1: verbose; 0: quiet*/
49+
50+
if(!sf_getfloat("v0",&v0)) v0=1.5;
51+
/* Near surface velocity (Km/s) */
52+
53+
if(verb){
54+
sf_warning("Input file (Rnip Section)");
55+
sf_warning("nt0=%f dt0=%f ot0=%f",nt0,dt0,ot0);
56+
sf_warning("nm0=%f dm0=%f om0=%f",nm0,dm0,om0);
57+
sf_warning("Command line parameters");
58+
sf_warning("v0=%f",v0);
59+
}
60+
61+
/* Load rnip values */
62+
rnip = sf_floatalloc2(nt0,nm0);
63+
sf_floatread(rnip[0],nm0*nt0,in);
64+
vrmsSection = sf_floatalloc2(nt0,nm0);
65+
66+
/* Calculate VRMS from RNIP */
67+
vrmsSection = calculateVrmsSectionForRnipVector(rnip,nt0,ot0,dt0,nm0,v0);
68+
69+
/* Output the VRMS section */
70+
sf_floatwrite(vrmsSection[0],nt0*nm0,out);
71+
}

README.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
[Developed to Madagascar package, version 3.0.](http://www.ahay.org/wiki/Main_Page)
66

7-
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Build Status](https://travis-ci.org/Dirack/creGatherStack.svg?branch=master)](https://travis-ci.org/Dirack/creGatherStack)
7+
[![Github release](https://img.shields.io/github/v/release/Dirack/creGatherStack)](https://github.com/Dirack/creGatherStack/releases/latest) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Madagascar](https://img.shields.io/badge/Madagascar-v3.0-blue)](https://github.com/ahay/src/tree/master) [![Build Status](https://travis-ci.org/Dirack/creGatherStack.svg?branch=master)](https://travis-ci.org/Dirack/creGatherStack)
88

99
![Interpolated CRE Gather](https://github.com/Dirack/creGatherInterpolation/blob/master/images/hugeStackedSection.jpeg)
1010

@@ -96,30 +96,27 @@ _For more examples and details, please refer to the [Wiki](https://github.com/Di
9696
We also have many SConstruct examples in this repository in the
9797
[experiments directory](https://github.com/Dirack/creGatherStack/tree/master/experiments)
9898

99-
## Release History
99+
## Release History and Versions
100100

101-
* [v2.0](https://github.com/Dirack/creGatherStack/releases/tag/v2.0) - (Stable)
102-
103-
* [v1.0-beta.1](https://github.com/Dirack/creGatherStack/releases/tag/v1.0-beta.1) - (Beta)
104-
105-
* [v0.1.2-alpha.1](https://github.com/Dirack/creGatherStack/releases/tag/v0.1.2-alpha.1) - (Development)
106-
107-
[See the complete history decription in our wiki](https://github.com/Dirack/creGatherStack/wiki/Release-history)
101+
This package version is referenced in VERSION.md file, and you can see the [complete release history in our wiki](https://github.com/Dirack/creGatherStack/wiki/Release-history) or in the CHANGELOG.md file.
108102

109103
## Meta
110104

105+
[main page](https://github.com/Dirack/creGatherStack)
106+
111107
Rodolfo Dirack – [@dirack](https://github.com/Dirack)[email protected]
112108

113109
Distributed under the GPL3 license. See ``LICENSE`` for more information.
114110

115-
[creGatherStack main page](https://github.com/Dirack/creGatherStack)
116-
117111
## Contributing
118112

119-
1. Fork it (<https://github.com/Dirack/creGatherStack/fork>)
120-
2. Create your feature branch (`git checkout -b feature/fooBar`)
121-
3. Commit your changes (`git commit -am 'Add some fooBar'`)
122-
4. Push to the branch (`git push origin feature/fooBar`)
123-
5. Create a new Pull Request
113+
In order to contribute with this project you should follow the list of steps bellow, please check out ["How to contribute with this project?"](https://github.com/Dirack/creGatherStack/wiki/Contribute) in our Wiki for more details.
114+
115+
1. Create an issue to your request or choose an issue already defined
116+
2. Fork this project in https://github.com/Dirack/creGatherStack/fork
117+
3. Create a branch for your contribution (name it using gitflow)
118+
4. Do clear _commit_ messages (a title with 50 characters and two paragraphs of text)
119+
5. _Push_ your contribution to this repository
120+
6. Create a new Pull Request with a clear description of your contribution
124121

125-
###### Important contribution tip: The commit history should be clear, with commit mesages around one or two paraghraps describing your modifications. Pull Requests with unsatisfactory commit history will be rejected.
122+
###### Important: The commit history should be clear, with commit mesages around one or two paraghraps describing your modifications. Pull Requests with unsatisfactory commit history will be rejected.

SConstruct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import bldutil
55
# Put your name programs in progs variable
66
# without 'M' preffix and '.c' extension
77
progs = '''
8-
crestack cretrajec getcregather getcretimecurve
8+
crestack cretrajec getcregather getcretimecurve rnip2vrms
99
'''
1010

1111
try: # distributed version

TDD/Makefile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Makefile
2+
#
3+
# Purpose: Run c test with Unity Unity.
4+
#
5+
# Site: https://dirack.github.io
6+
#
7+
# Version 1.0
8+
#
9+
# Programer: Rodolfo A C Neves (Dirack) 21/09/2020
10+
#
11+
12+
#
13+
# License: GPL-3.0 <https://www.gnu.org/licenses/gpl-3.0.txt>.
14+
15+
# Uncomment the line below to run on a CENTOS system. Or call make as 'make CENTOS=1'
16+
#CENTOS=1
17+
18+
all: Test_rnip2vrms_lib.x
19+
20+
%.x: %.c
21+
ifdef CENTOS
22+
gcc -I$$RSFSRC/include -I/usr/include/openblas -L$$RSFSRC/lib $< ../rnip2vrms_lib.c Unity/unity.c -o $@ -lm -lrsf -lopenblas -g
23+
./$@
24+
rm $@
25+
else
26+
gcc -I$$RSFSRC/include -L$$RSFSRC/lib $< ../rnip2vrms_lib.c Unity/unity.c -o $@ -lm -lrsf
27+
./$@
28+
rm $@
29+
endif

0 commit comments

Comments
 (0)