Skip to content

Commit

Permalink
Added TIMEWIN=5 to suppress surface waves
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-koehn committed Apr 2, 2024
1 parent 0477063 commit 9772e1f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/calc_res.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
double calc_res(float **sectiondata, float **section, float **sectiondiff, float **sectiondiffold, int ntr, int ns, int LNORM, double L2, int itest, int sws, int swstestshot, int ntr_glob, int **recpos, int **recpos_loc, float **srcpos, int nsrc_glob, int ishot, int iter){

/* declaration of variables */
extern float DT, DH, OFFSETC, FC, FC_START, FC_END, C_vp, C_rho;
extern float DT, DH, OFFSETC, FC, FC_START, FC_END, C_vp, C_rho, GAMMA, TWLENGTH_MINUS;
extern int REC1, REC2, MYID, MYID_SHOT, ORDER, COMP_WEIGHT;
extern int TRKILL, GRAD_FORM, ENV, N_ORDER;
extern char TRKILL_FILE[STRING_SIZE];
Expand All @@ -26,7 +26,7 @@ float **integrated_section=NULL, **integrated_sectiondata=NULL;
float **integrated_sectiondata_envelope=NULL, **integrated_section_envelope=NULL, **integrated_section_hilbert=NULL;
float ** agc_sectiondata = NULL;
float **dummy_1=NULL, **dummy_2=NULL;
float EPS_LNORM, EPS_LNORM6, tmp, tmp1;
float EPS_LNORM, EPS_LNORM6, tmp, tmp1, t0;

/* NIM objective function parameters */
float Qmod, Qtrue, Q1, Q2, Q3;
Expand Down Expand Up @@ -308,7 +308,7 @@ for(i=1;i<=ntr;i++){
if((TRKILL==1)&&(kill_vector[i]==1))
continue;

if(OFFSET_MUTE){
if(OFFSET_MUTE || (TIMEWIN==5)){

/* calculate source and receiver positions */
xr = recpos[1][recpos_loc[3][i]]*DH;
Expand Down Expand Up @@ -442,6 +442,12 @@ for(i=1;i<=ntr;i++){
}

sectiondiff[i][invtime]=intseis;

/* suppress surface waves */
if(TIMEWIN==5){
t0 = fabs(offset/TWLENGTH_MINUS); /* arrival time of surface wave */
if(j*DT>=t0){sectiondiff[i][invtime] *= exp(-GAMMA*pow(j*DT-t0,2));}
}

}

Expand Down

0 comments on commit 9772e1f

Please sign in to comment.