Skip to content

Commit 1863208

Browse files
committed
convection
1 parent b1b9e46 commit 1863208

File tree

3 files changed

+77
-14
lines changed

3 files changed

+77
-14
lines changed

user/fomels/Mcnvdip.c

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/* Dip estimation from convection */
2+
/*
3+
Copyright (C) 2025 University of Texas at Austin
4+
5+
This program is free software; you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation; either version 2 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program; if not, write to the Free Software
17+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18+
*/
19+
#include <math.h>
20+
21+
#include <rsf.h>
22+
#include "predict.h"
23+
24+
int main (int argc, char* argv[])
25+
{
26+
int order, n1, n2, i1, i2, nw;
27+
float **conv, *trace, eps;
28+
sf_file cnv, dip;
29+
30+
sf_init(argc, argv);
31+
cnv = sf_input("in");
32+
dip = sf_output("out");
33+
34+
if (SF_FLOAT != sf_gettype(cnv)) sf_error("Need float input");
35+
if (!sf_histint(cnv,"n1",&n1)) sf_error("Need n1= in input");
36+
if (!sf_histint(cnv,"n2",&nw)) sf_error("Need n2= in input");
37+
if (!sf_histint(cnv,"n3",&n2)) sf_error("Need n3= in input");
38+
39+
order = nw/2;
40+
41+
sf_unshiftdim(cnv,dip,2);
42+
43+
if (!sf_getfloat("eps",&eps)) eps=0.01;
44+
/* regularization */
45+
46+
predict_init (n1, n2, eps*eps, order, 1, false);
47+
48+
conv = sf_floatalloc2(n1,nw);
49+
trace = sf_floatalloc(n1);
50+
51+
for (i2=0; i2 < n2; i2++) {
52+
for (i1=0; i1 < n1; i1++) {
53+
trace[i1] = i1;
54+
}
55+
sf_floatread(conv[0],n1*nw,cnv);
56+
predict_step(false,true,trace,conv);
57+
for (i1=0; i1 < n1; i1++) {
58+
trace[i1] = i1 - trace[i1];
59+
}
60+
sf_floatwrite(trace,n1,dip);
61+
}
62+
63+
exit(0);
64+
}
65+
66+
67+

user/fomels/Mcnvpaint.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ int main (int argc, char* argv[])
2525
{
2626
int order, n1, n2, n12, i1, i2, i0, nw;
2727
float **u, ***conv, *trace;
28-
float o1, d1, o2, d2, eps, *time;
28+
float o1, d1, eps, *time;
2929
sf_file cnv, out, seed;
3030

3131
sf_init(argc, argv);
@@ -34,14 +34,10 @@ int main (int argc, char* argv[])
3434

3535
if (SF_FLOAT != sf_gettype(cnv)) sf_error("Need float input");
3636
if (!sf_histint(cnv,"n1",&n1)) sf_error("Need n1= in input");
37-
37+
if (!sf_histint(cnv,"n2",&nw)) sf_error("Need n2= in input");
3838
if (!sf_histint(cnv,"n3",&n2)) sf_error("Need n3= in input");
39-
if (!sf_histfloat(cnv,"o3",&o2)) o2=0.;
40-
if (!sf_histfloat(cnv,"d3",&d2)) d2=1.;
4139

4240
n12 = n1*n2;
43-
44-
if (!sf_histint(cnv,"n2",&nw)) sf_error("Need n2= in input");
4541
order = nw/2;
4642

4743
sf_unshiftdim(cnv,out,2);

user/fomels/SConstruct

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ progs = '''
66
abalance analytical angle angle2 approx arrival bdix beamform1 bil1
77
bilat2 blur boxcascade cbeamform1 causinv ccausint cchebyshevp
88
cfftexpa-dev cfftwave1 cdivn cflow chain2dfft chebvc chebyshev
9-
chebyshevp clpf cltft cltftfft cnvd cnvpaint constperm constpermh
10-
constpermh1 convection cosftwave1 cpef cr ctf2dprec deblur diphase
11-
distance divn dix donut dpeiko eikonal eikonalvti eno2 erf exgr
12-
fedchain fedchain1 fedchain2 fedchain21 fft2 fftexp0 fftexp1 fftexp3
13-
fftexpa fftexp0a fftone ffttest fftwave1 fftwave2 fftwave3 findmin2
14-
focus fpow freqest gaussmooth gbeamform imray interf interp2 interpt
15-
iphase kdsort kdtree kron label legacy lfftexp0 llpf localskew locov
16-
lpf lrmig0 lsfit max2 median mffit mig3 miss3 morph nconv nnint
9+
chebyshevp clpf cltft cltftfft cnvd cnvdip cnvpaint constperm
10+
constpermh constpermh1 convection cosftwave1 cpef cr ctf2dprec deblur
11+
diphase distance divn dix donut dpeiko eikonal eikonalvti eno2 erf
12+
exgr fedchain fedchain1 fedchain2 fedchain21 fft2 fftexp0 fftexp1
13+
fftexp3 fftexpa fftexp0a fftone ffttest fftwave1 fftwave2 fftwave3
14+
findmin2 focus fpow freqest gaussmooth gbeamform imray interf interp2
15+
interpt iphase kdsort kdtree kron label legacy lfftexp0 llpf localskew
16+
locov lpf lrmig0 lsfit max2 median mffit mig3 miss3 morph nconv nnint
1717
nnshape nnshapet nsmooth nsmooth1 ocparcel octentwt ofilp ofsemb ortho
1818
patch pchain pchain1 phaserot pick pick2 pick3 plane poly polyfit
1919
psmig2 regr rdiv rect1 reshape riesz rsin sc seislet1 semblance

0 commit comments

Comments
 (0)