Skip to content
Snippets Groups Projects
Commit 9479950d authored by JanThorbecke's avatar JanThorbecke
Browse files

minor bug fix

parent 43a4dd3f
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,7 @@ export OMP_NUM_THREADS=1
file_src=wavelet.su verbose=5 \
file_rcv=$file_rcv \
file_snap=snap.su \
rrcv=1200 arcv=2800 oxrcv=0 ozrcv=0 dphi=2.0 \
arcv=1200 rrcv=2800 oxrcv=0 ozrcv=0 dphi=2.0 \
rec_type_vx=1 rec_type_p=1 rec_int_vx=3 \
dtrcv=0.004 \
xsrc=-1600 zsrc=0 nshot=1 nsrc=1 \
......
......@@ -25,7 +25,8 @@ int recvPar(recPar *rec, float sub_x0, float sub_z0, float dx, float dz, int nx,
float *xrcv1, *xrcv2, *zrcv1, *zrcv2;
int ix0, ix1, iz0, iz1, i, ix, iz, ir, isign, verbose;
float dxrcv, dzrcv, *dxr, *dzr, r, rr;
float rrcv, dphi, oxrcv, ozrcv, arcv, circ, h, a, b, e, s, xr, zr, dr, srun;
float rrcv, dphi, oxrcv, ozrcv, arcv;
double circ, h, a, b, e, s, xr, zr, dr, srun, phase;
float xrange, zrange;
int Nx1, Nx2, Nz1, Nz2, Ndx, Ndz, iarray, nskip, nrec, nh;
int nxrcv, nzrcv, ncrcv, nrcv, max_nrec;
......@@ -62,23 +63,26 @@ int recvPar(recPar *rec, float sub_x0, float sub_z0, float dx, float dz, int nx,
a = MAX(rrcv, arcv);
b = MIN(rrcv, arcv);
e = sqrt(a*a-b*b)/a;
//fprintf(stderr,"a=%f b=%f e=%f\n", a, b, e);
circ = 0.0;
for (ir=0; ir<nh; ir++) {
s = sin(ir*h);
circ += sqrt(1.0-e*e*s*s);
}
//circ = a*h*circ;
circ = a*h*circ;
//fprintf(stderr,"circ = %f circle=%f\n", circ, 2.0*M_PI*rrcv);
/* define distance between receivers on ellipse */
dr = circ/ncrcv;
ix = 0;
srun = 0.0;
if (arcv >= rrcv) phase=0.0;
else phase=0.5*M_PI;
for (ir=0; ir<nh; ir++) {
s = sin(ir*h);
srun += sqrt(1.0-e*e*s*s);
if (srun >= ix*dr ) {
xr = rrcv*cos(ir*h);
zr = arcv*sin(ir*h);
if (a*h*srun >= ix*dr ) {
xr = rrcv*cos(ir*h+phase);
zr = arcv*sin(ir*h+phase);
rec->xr[ix] = oxrcv-sub_x0+xr;
rec->zr[ix] = ozrcv-sub_z0+zr;
rec->x[ix] = NINT(rec->xr[ix]/dx);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment