Skip to content

Commit

Permalink
[fix](bug sfnhcrssurf): [WIP] Correct bug related with issue #46
Browse files Browse the repository at this point in the history
The parameters file in sfnhcrssurf should be a vector with at least 3
samples, RN, RNIP and BETA, and n1 should be at least 3.

The v0, RN, RNIP should not be too small
  • Loading branch information
Dirack committed Feb 21, 2024
1 parent c8d3497 commit 5a2f782
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Mnhcrssurf.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ int main(int argc, char* argv[])

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

// Check if parameters file n1 dimension is correct, at least 3 parameters
if(nc < 3) sf_error("Parameters file should have at least 3 parameters but n1=%d",nc);

if(! sf_getbool("verb",&verb)) verb=0;
/* 1: active mode; 0: quiet mode */

Expand All @@ -83,14 +86,15 @@ int main(int argc, char* argv[])
sf_warning("n1=%i",nc);
}

nc=3;
c = sf_floatalloc(nc);
sf_floatread(c,nc,par);

RN = c[0];
RNIP = c[1];
BETA = c[2];

if(fabs(v0) < 0.001 || fabs(RN) < 0.001 || fabs(RNIP) < 0.001)
sf_error("One of the following parameters is too small v0=%f RN=%f RNIP=%f",v0,RN,RNIP);

t = sf_floatalloc2(nh,nm);

Expand Down
4 changes: 2 additions & 2 deletions examples/gaussian_reflector_model/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Flow('dataCube','gaussianReflector reflectorDip',
ns=401 ds=0.025 s0=0
freq=10 dt=0.004 nt=1001
vel=1.5 gradz=0.5 gradx=0.0 verb=y |
put label3="CMP" unit3="Km" label2="Offset" unit2="Km" label1=Time unit1=s
put d2=0.0125 label3="CMP" unit3="Km" label2="Offset" unit2="Km" label1=Time unit1=s
''')

m0=5
Expand All @@ -102,7 +102,7 @@ using non-hyperbolic CRS aproximation and VFSA

Flow('crsParameters','dataCube',
'''
vfsacrsnh om0=%g v0=%g ot0=%g verb=y repeat=10
vfsacrsnh om0=%g v0=%g ot0=%g verb=y repeat=10 | put n1=4 label1="parameters" unit1="RN, RNIP, BETA, Semblance" n4=1 n3=1
''' % (m0,v0,t0))

Help('''
Expand Down

0 comments on commit 5a2f782

Please sign in to comment.