Commit c7172e61 authored by Florian Wittkamp's avatar Florian Wittkamp

Automatic offset based tracekill

parent ba1116d6
...@@ -736,6 +736,10 @@ If you use the option "Workflow" (section \ref{sec:workflow}) it is possible to ...@@ -736,6 +736,10 @@ If you use the option "Workflow" (section \ref{sec:workflow}) it is possible to
"Trace killing" : "comment", "Trace killing" : "comment",
"TRKILL" : "0", "TRKILL" : "0",
"TRKILL_FILE" : "./trace_kill/trace_kill", "TRKILL_FILE" : "./trace_kill/trace_kill",
"TRKILL_OFFSET" : "0",
"TRKILL_OFFSET_LOWER" : "20",
"TRKILL_OFFSET_UPPER" : "100",
\end{verbatim}}} \end{verbatim}}}
{\color{red}{\begin{verbatim} {\color{red}{\begin{verbatim}
...@@ -747,6 +751,7 @@ If you don't want to use single traces or a subset of your data, the parameter T ...@@ -747,6 +751,7 @@ If you don't want to use single traces or a subset of your data, the parameter T
If you use the option "Workflow" (section \ref{sec:workflow}) it is possible to define separate files for each workflow stage. They have to be named TRKILL\_FILE\_<workflowstage>.dat. If you don't provide separate files for some or all stages the standard file (TRKILL\_FILE.dat) is used. This means a standard file should exist in any case. If you use the option "Workflow" (section \ref{sec:workflow}) it is possible to define separate files for each workflow stage. They have to be named TRKILL\_FILE\_<workflowstage>.dat. If you don't provide separate files for some or all stages the standard file (TRKILL\_FILE.dat) is used. This means a standard file should exist in any case.
Moreover, you can directly define a offset range that should be killed. Simply set TRKILL\_OFFSET and TRKILL to one and all traces with a offset between TRKILL\_OFFSET\_LOWER and TRKILL\_OFFSET\_UPPER will be killed.
\section{Gradient manipulation} \section{Gradient manipulation}
\subsection{Definition of a gradient taper} \subsection{Definition of a gradient taper}
......
This diff is collapsed.
...@@ -162,6 +162,7 @@ IFOS2D= \ ...@@ -162,6 +162,7 @@ IFOS2D= \
prepare_update_p.c \ prepare_update_p.c \
readmod_viscac.c \ readmod_viscac.c \
time_window_glob.c \ time_window_glob.c \
create_trkill_table.c \
filter_frequencies.c filter_frequencies.c
SNAPMERGE_OBJ = $(SNAPMERGE_SCR:%.c=%.o) SNAPMERGE_OBJ = $(SNAPMERGE_SCR:%.c=%.o)
......
...@@ -2,139 +2,163 @@ ...@@ -2,139 +2,163 @@
* Copyright (C) 2016 For the list of authors, see file AUTHORS. * Copyright (C) 2016 For the list of authors, see file AUTHORS.
* *
* This file is part of IFOS. * This file is part of IFOS.
* *
* IFOS is free software: you can redistribute it and/or modify * IFOS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 2.0 of the License only. * the Free Software Foundation, version 2.0 of the License only.
* *
* IFOS is distributed in the hope that it will be useful, * IFOS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with IFOS. See file COPYING and/or <http://www.gnu.org/licenses/gpl-2.0.html>. * along with IFOS. See file COPYING and/or <http://www.gnu.org/licenses/gpl-2.0.html>.
-----------------------------------------------------------------------------------------*/ -----------------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------ /*------------------------------------------------------------------------
* Calculate energy of measured data * Calculate energy of measured data
* last update 22/03/11, L. Rehor * last update 22/03/11, L. Rehor
* ----------------------------------------------------------------------*/ * ----------------------------------------------------------------------*/
#include "fd.h" #include "fd.h"
double calc_energy(float **sectiondata, int ntr, int ns, float energy, int ntr_glob, int **recpos_loc, int nsrc_glob, int ishot, int iter){ double calc_energy(float **sectiondata, int ntr, int ns, float energy, int ntr_glob, int **recpos_loc, int nsrc_glob, int ishot, int iter, float ** srcpos, int ** recpos){
/* declaration of variables */ /* declaration of variables */
extern float DT; extern float DT;
extern int MYID, USE_WORKFLOW, WORKFLOW_STAGE; extern int MYID, USE_WORKFLOW, WORKFLOW_STAGE;
extern int TRKILL, NORMALIZE, FC, TIMEWIN; extern int TRKILL, NORMALIZE, FC, TIMEWIN;
extern char TRKILL_FILE[STRING_SIZE]; extern char TRKILL_FILE[STRING_SIZE];
extern int VELOCITY; extern int VELOCITY;
int i, j; int i, j;
float energy_dummy, intseis; float energy_dummy, intseis;
int umax=0, h; int umax=0, h;
float intseis_sd; float intseis_sd;
float **intseis_sectiondata=NULL; float **intseis_sectiondata=NULL;
float *picked_times=NULL; float *picked_times=NULL;
intseis_sectiondata = matrix(1,ntr,1,ns); /* declaration of variables for integration */ intseis_sectiondata = matrix(1,ntr,1,ns); /* declaration of variables for integration */
if(TIMEWIN) picked_times = vector(1,ntr); /* declaration of variables for TIMEWIN */ if(TIMEWIN) picked_times = vector(1,ntr); /* declaration of variables for TIMEWIN */
/*extern int MYID;*/ /*extern int MYID;*/
/*printf("MYID: %d; ns=%d\n",MYID,ns); /*printf("MYID: %d; ns=%d\n",MYID,ns);
printf("MYID: %d; ntr=%d\n",MYID,ntr);*/ printf("MYID: %d; ntr=%d\n",MYID,ntr);*/
/* TRACE KILLING */ /* TRACE KILLING */
int ** kill_tmp, *kill_vector; /* declaration of variables for trace killing */ int ** kill_tmp, *kill_vector; /* declaration of variables for trace killing */
char trace_kill_file[STRING_SIZE]; char trace_kill_file[STRING_SIZE];
FILE *ftracekill; FILE *ftracekill;
extern int TRKILL_OFFSET;
if(TRKILL==1){ extern float TRKILL_OFFSET_LOWER;
extern float TRKILL_OFFSET_UPPER;
kill_tmp = imatrix(1,ntr_glob,1,nsrc_glob);
kill_vector = ivector(1,ntr); /*-----------------*/
/* Start Tracekill */
if(USE_WORKFLOW){ /*-----------------*/
sprintf(trace_kill_file,"%s_%i.dat",TRKILL_FILE,WORKFLOW_STAGE); if(TRKILL){
ftracekill=fopen(trace_kill_file,"r"); kill_tmp = imatrix(1,ntr_glob,1,nsrc_glob);
if (ftracekill==NULL){ kill_vector = ivector(1,ntr);
sprintf(trace_kill_file,"%s.dat",TRKILL_FILE);
ftracekill=fopen(trace_kill_file,"r"); if(TRKILL_OFFSET) {
if (ftracekill==NULL){
err(" Trace kill file could not be opened!"); if(MYID==0) {
printf("Automatic offset based TraceKill: Experimental feature");
} }
/* Generate TraceKill file on the fly */
create_trkill_table(kill_tmp,ntr_glob,recpos,nsrc_glob,srcpos,ishot,TRKILL_OFFSET_LOWER,TRKILL_OFFSET_UPPER);
} else {
/* READ TraceKill file from disk */
if(USE_WORKFLOW){
sprintf(trace_kill_file,"%s_%i.dat",TRKILL_FILE,WORKFLOW_STAGE);
ftracekill=fopen(trace_kill_file,"r");
if (ftracekill==NULL){
sprintf(trace_kill_file,"%s.dat",TRKILL_FILE);
ftracekill=fopen(trace_kill_file,"r");
if (ftracekill==NULL){
err(" Trace kill file could not be opened!");
}
}
}else{
sprintf(trace_kill_file,"%s.dat",TRKILL_FILE);
ftracekill=fopen(trace_kill_file,"r");
if (ftracekill==NULL){
err(" Trace kill file could not be opened!");
}
}
for(i=1;i<=ntr_glob;i++){
for(j=1;j<=nsrc_glob;j++){
fscanf(ftracekill,"%d",&kill_tmp[i][j]);
}
}
fclose(ftracekill);
} }
}else{
sprintf(trace_kill_file,"%s.dat",TRKILL_FILE); /* Generate local kill vector */
ftracekill=fopen(trace_kill_file,"r"); h=1;
if (ftracekill==NULL){ for(i=1;i<=ntr;i++){
err(" Trace kill file could not be opened!"); kill_vector[h] = kill_tmp[recpos_loc[3][i]][ishot];
h++;
} }
} }
/*---------------*/
/* End Tracekill */
/*---------------*/
for(i=1;i<=ntr_glob;i++){ /* Integration of measured data */
for(j=1;j<=nsrc_glob;j++){ for(i=1;i<=ntr;i++){
fscanf(ftracekill,"%d",&kill_tmp[i][j]);
} intseis_sd=0;
}
if (VELOCITY==0){ /* only integtration if displacement seismograms are inverted */
fclose(ftracekill); for(j=1;j<=ns;j++){
intseis_sd += sectiondata[i][j];
h=1; intseis_sectiondata[i][j]=intseis_sd*DT;
for(i=1;i<=ntr;i++){ }
kill_vector[h] = kill_tmp[recpos_loc[3][i]][ishot]; }
h++; else{
} for(j=1;j<=ns;j++){
} /* end if(TRKILL)*/ intseis_sectiondata[i][j]=sectiondata[i][j];
}
/* Integration of measured data */ }
for(i=1;i<=ntr;i++){ }
intseis_sd=0; /* TIME WINDOWING */
if(TIMEWIN==1) time_window(intseis_sectiondata, iter, ntr_glob,recpos_loc, ntr, ns, ishot);
if (VELOCITY==0){ /* only integtration if displacement seismograms are inverted */
for(j=1;j<=ns;j++){ /* NORMALIZE TRACES */
intseis_sd += sectiondata[i][j]; if(NORMALIZE==1) normalize_data(intseis_sectiondata,ntr,ns);
intseis_sectiondata[i][j]=intseis_sd*DT;
}
} /* calculate energy of measured data */
else{ for(i=1;i<=ntr;i++){
for(j=1;j<=ns;j++){ if((TRKILL==1)&&(kill_vector[i]==1))
intseis_sectiondata[i][j]=sectiondata[i][j]; continue;
}
} for(j=1;j<=ns;j++){
} energy += intseis_sectiondata[i][j]*intseis_sectiondata[i][j];
}
/* TIME WINDOWING */ }
if(TIMEWIN==1) time_window(intseis_sectiondata, iter, ntr_glob,recpos_loc, ntr, ns, ishot);
energy_dummy=energy;
/* NORMALIZE TRACES */
if(NORMALIZE==1) normalize_data(intseis_sectiondata,ntr,ns); /* printf("\n MYID = %i IN CALC_ENERGY: energy = %10.12f \n",MYID,energy); */
/* free memory for integrated seismogram */
/* calculate energy of measured data */ free_matrix(intseis_sectiondata,1,ntr,1,ns);
for(i=1;i<=ntr;i++){
if((TRKILL==1)&&(kill_vector[i]==1)) /* free memory for time windowing and trace killing */
continue; if(TIMEWIN==1) free_vector(picked_times,1,ntr);
if(TRKILL==1){
for(j=1;j<=ns;j++){ free_imatrix(kill_tmp,1,ntr_glob,1,nsrc_glob);
energy += intseis_sectiondata[i][j]*intseis_sectiondata[i][j]; free_ivector(kill_vector,1,ntr);}
}
} return energy_dummy;
energy_dummy=energy;
/* printf("\n MYID = %i IN CALC_ENERGY: energy = %10.12f \n",MYID,energy); */
/* free memory for integrated seismogram */
free_matrix(intseis_sectiondata,1,ntr,1,ns);
/* free memory for time windowing and trace killing */
if(TIMEWIN==1) free_vector(picked_times,1,ntr);
if(TRKILL==1){
free_imatrix(kill_tmp,1,ntr_glob,1,nsrc_glob);
free_ivector(kill_vector,1,ntr);}
return energy_dummy;
} /* end of function */ } /* end of function */
This diff is collapsed.
This diff is collapsed.
...@@ -2,75 +2,97 @@ ...@@ -2,75 +2,97 @@
* Copyright (C) 2016 For the list of authors, see file AUTHORS. * Copyright (C) 2016 For the list of authors, see file AUTHORS.
* *
* This file is part of IFOS. * This file is part of IFOS.
* *
* IFOS is free software: you can redistribute it and/or modify * IFOS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 2.0 of the License only. * the Free Software Foundation, version 2.0 of the License only.
* *
* IFOS is distributed in the hope that it will be useful, * IFOS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with IFOS. See file COPYING and/or <http://www.gnu.org/licenses/gpl-2.0.html>. * along with IFOS. See file COPYING and/or <http://www.gnu.org/licenses/gpl-2.0.html>.
-----------------------------------------------------------------------------------------*/ -----------------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------ /*------------------------------------------------------------------------
* Calculate number of killed traces * Calculate number of killed traces
* last update 11/07/12, L. Groos * last update 11/07/12, L. Groos
* ----------------------------------------------------------------------*/ * ----------------------------------------------------------------------*/
#include "fd.h" #include "fd.h"
void count_killed_traces(int ntr, int swstestshot, int ntr_glob, int **recpos_loc, int nsrc_glob, int ishot, int* ptr_killed_traces, int* ptr_killed_traces_testshots){ void count_killed_traces(int ntr, int swstestshot, int ntr_glob, int **recpos_loc, int nsrc_glob, int ishot, int* ptr_killed_traces, int* ptr_killed_traces_testshots,float ** srcpos, int ** recpos){
/* declaration of variables */ /* declaration of variables */
extern int USE_WORKFLOW, WORKFLOW_STAGE; extern int USE_WORKFLOW, WORKFLOW_STAGE;
extern char TRKILL_FILE[STRING_SIZE]; extern char TRKILL_FILE[STRING_SIZE];
int i,j,h; extern int TRKILL_OFFSET;
extern float TRKILL_OFFSET_LOWER;
extern float TRKILL_OFFSET_UPPER;
/* declaration of variables for trace killing */ extern int MYID;
int ** kill_tmp, *kill_vector; int i,j,h;
char trace_kill_file[STRING_SIZE];
FILE *ftracekill;
/* declaration of variables for trace killing */
int ** kill_tmp, *kill_vector;
kill_tmp = imatrix(1,ntr_glob,1,nsrc_glob); char trace_kill_file[STRING_SIZE];
kill_vector = ivector(1,ntr); FILE *ftracekill;
if(USE_WORKFLOW){
sprintf(trace_kill_file,"%s_%i.dat",TRKILL_FILE,WORKFLOW_STAGE); kill_tmp = imatrix(1,ntr_glob,1,nsrc_glob);
ftracekill=fopen(trace_kill_file,"r"); kill_vector = ivector(1,ntr);
if (ftracekill==NULL){
if(TRKILL_OFFSET) {
if(MYID==0) {
printf("Automatic offset based TraceKill: Experimental feature");
}
/* Generate TraceKill file on the fly */
create_trkill_table(kill_tmp,ntr_glob,recpos,nsrc_glob,srcpos,ishot,TRKILL_OFFSET_LOWER,TRKILL_OFFSET_UPPER);
} else {
/* READ TraceKill file from disk */
if(USE_WORKFLOW){
sprintf(trace_kill_file,"%s_%i.dat",TRKILL_FILE,WORKFLOW_STAGE);
ftracekill=fopen(trace_kill_file,"r");
if (ftracekill==NULL){
sprintf(trace_kill_file,"%s.dat",TRKILL_FILE);
ftracekill=fopen(trace_kill_file,"r");
if (ftracekill==NULL){
err(" Trace kill file could not be opened!");
}
}
}else{
sprintf(trace_kill_file,"%s.dat",TRKILL_FILE); sprintf(trace_kill_file,"%s.dat",TRKILL_FILE);
ftracekill=fopen(trace_kill_file,"r"); ftracekill=fopen(trace_kill_file,"r");
if (ftracekill==NULL){ if (ftracekill==NULL){
err(" Trace kill file could not be opened!"); err(" Trace kill file could not be opened!");
} }
} }
}else{
sprintf(trace_kill_file,"%s.dat",TRKILL_FILE); for(i=1;i<=ntr_glob;i++){
ftracekill=fopen(trace_kill_file,"r"); for(j=1;j<=nsrc_glob;j++){
if (ftracekill==NULL){ fscanf(ftracekill,"%d",&kill_tmp[i][j]);
err(" Trace kill file could not be opened!"); }
} }
fclose(ftracekill);
} }
for(i=1;i<=ntr_glob;i++){
for(j=1;j<=nsrc_glob;j++){ h=1;
fscanf(ftracekill,"%d",&kill_tmp[i][j]); for(i=1;i<=ntr;i++){
} kill_vector[h] = kill_tmp[recpos_loc[3][i]][ishot];
} if (kill_vector[h]==1) *ptr_killed_traces=*ptr_killed_traces+1;
if ((kill_vector[h]==1) && (swstestshot==1)) *ptr_killed_traces_testshots=*ptr_killed_traces_testshots+1;
fclose(ftracekill); h++;
}
h=1;
for(i=1;i<=ntr;i++){
kill_vector[h] = kill_tmp[recpos_loc[3][i]][ishot];
if (kill_vector[h]==1) *ptr_killed_traces=*ptr_killed_traces+1;
if ((kill_vector[h]==1) && (swstestshot==1)) *ptr_killed_traces_testshots=*ptr_killed_traces_testshots+1;
h++;
}
} }
/*-----------------------------------------------------------------------------------------
* Copyright (C) 2016 For the list of authors, see file AUTHORS.
*
* This file is part of IFOS.
*
* IFOS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 2.0 of the License only.
*
* IFOS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with IFOS. See file COPYING and/or <http://www.gnu.org/licenses/gpl-2.0.html>.
-----------------------------------------------------------------------------------------*/
#include "fd.h"
void create_trkill_table(int ** killtable, int ntr_glob, int **recpos, int nsrc_glob, float **srcpos, int ishot, float kill_offset_lower, float kill_offset_upper) {
/* Local variables */
int s, r;
float offset=0.0;
/* extern variables */
extern float DH;
extern int MYID;
/*------------------*/
/* clear kill table */
/*------------------*/
for(s=1;s>=nsrc_glob;s++){
for (r=1; r<=ntr_glob; r++) {
killtable[r][s]=0;
}
}
/*---------------------*/
/* Generate Killtable */
/*---------------------*/
for(s=1;s<=nsrc_glob;s++){
for (r=1; r<=ntr_glob; r++) {
/* calculate Offset for current reciever and source */
offset=fabs(sqrt((srcpos[1][s]-recpos[1][r]*DH)*(srcpos[1][s]-recpos[1][r]*DH)+(srcpos[2][s]-recpos[2][r]*DH)*(srcpos[2][s]-recpos[2][r]*DH)));
/* If offset lies inside the bound kill */
if( offset>kill_offset_lower && offset<kill_offset_upper ) {
killtable[r][s]=1;
}
}
}
}
...@@ -86,6 +86,14 @@ void exchange_par(void){ ...@@ -86,6 +86,14 @@ void exchange_par(void){
extern int ACOUSTIC; extern int ACOUSTIC;
extern int VERBOSE; extern int VERBOSE;
extern int TRKILL_STF_OFFSET;
extern float TRKILL_STF_OFFSET_LOWER;
extern float TRKILL_STF_OFFSET_UPPER;
extern int TRKILL_OFFSET;
extern float TRKILL_OFFSET_LOWER;
extern float TRKILL_OFFSET_UPPER;
// Parameter for inversion of SH waves and joint inversion // Parameter for inversion of SH waves and joint inversion
extern int WAVETYPE; extern int WAVETYPE;
extern int SOURCE_SHAPE_SH; extern int SOURCE_SHAPE_SH;
...@@ -209,6 +217,11 @@ void exchange_par(void){ ...@@ -209,6 +217,11 @@ void exchange_par(void){
fdum[64]=WOLFE_C1_SL; fdum[64]=WOLFE_C1_SL;
fdum[65]=WOLFE_C2_SL; fdum[65]=WOLFE_C2_SL;
fdum[66]=TRKILL_STF_OFFSET_LOWER;
fdum[67]=TRKILL_STF_OFFSET_UPPER;
fdum[68]=TRKILL_OFFSET_LOWER;
fdum[69]=TRKILL_OFFSET_UPPER;
/***********/ /***********/
/* Integer */ /* Integer */
/***********/ /***********/
...@@ -360,6 +373,9 @@ void exchange_par(void){ ...@@ -360,6 +373,9 @@ void exchange_par(void){
idum[112]=TAPER_STF; idum[112]=TAPER_STF;
idum[113]=TW_IND; idum[113]=TW_IND;
idum[114]=TRKILL_OFFSET;
idum[115]=TRKILL_STF_OFFSET;
} /** if (MYID == 0) **/ } /** if (MYID == 0) **/
if (MYID != 0) FL=vector(1,L); if (MYID != 0) FL=vector(1,L);
...@@ -484,6 +500,11 @@ void exchange_par(void){ ...@@ -484,6 +500,11 @@ void exchange_par(void){
WOLFE_C1_SL=fdum[64]; WOLFE_C1_SL=fdum[64];
WOLFE_C2_SL=fdum[65]; WOLFE_C2_SL=fdum[65];
TRKILL_STF_OFFSET_LOWER=fdum[66];
TRKILL_STF_OFFSET_UPPER=fdum[67];
TRKILL_OFFSET_LOWER=fdum[68];
TRKILL_OFFSET_UPPER=fdum[69];
/***********/ /***********/
/* Integer */ /* Integer */
/***********/ /***********/
...@@ -638,6 +659,8 @@ void exchange_par(void){ ...@@ -638,6 +659,8 @@ void exchange_par(void){
TAPER_STF=idum[112]; TAPER_STF=idum[112];
TW_IND=idum[113]; TW_IND=idum[113];
TRKILL_OFFSET=idum[114];
TRKILL_STF_OFFSET=idum[115];
MPI_Bcast(&FL[1],L,MPI_FLOAT,0,MPI_COMM_WORLD); MPI_Bcast(&FL[1],L,MPI_FLOAT,0,MPI_COMM_WORLD);
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#define fsign(x) ((x<0.0)?(-1):1) #define fsign(x) ((x<0.0)?(-1):1)
#define PI (3.141592653589793) #define PI (3.141592653589793)
#define NPAR 119 #define NPAR 120
#define STRING_SIZE 74 #define STRING_SIZE 74
#define STRING_SIZE2 256 #define STRING_SIZE2 256
#define REQUEST_COUNT 4 #define REQUEST_COUNT 4
...@@ -67,15 +67,15 @@ void calc_mat_change(float ** waveconv, float ** waveconv_rho, float ** waveco ...@@ -67,15 +67,15 @@ void calc_mat_change(float ** waveconv, float ** waveconv_rho, float ** waveco
void calc_mat_change_test(float ** waveconv, float ** waveconv_rho, float ** waveconv_u, float ** rho, float ** rhonp1, float ** pi, float ** pinp1, float ** u, float ** unp1, int iter, void calc_mat_change_test(float ** waveconv, float ** waveconv_rho, float ** waveconv_u, float ** rho, float ** rhonp1, float ** pi, float ** pinp1, float ** u, float ** unp1, int iter,
int epstest, int FORWARD_ONLY, float eps_scale, int itest, int nfstart, float ** u_start, float ** pi_start, float ** rho_start,int wavetype_start,float **bfgsmod,int bfgsnum,int bfgspar,float Vs_avg,float Vp_avg,float rho_avg,int LBFGS_iter_start); int epstest, int FORWARD_ONLY, float eps_scale, int itest, int nfstart, float ** u_start, float ** pi_start, float ** rho_start,int wavetype_start,float **bfgsmod,int bfgsnum,int bfgspar,float Vs_avg,float Vp_avg,float rho_avg,int LBFGS_iter_start);
double calc_res(float **sectiondata, float **section, float **sectiondiff, float **sectiondiffold, int ntr, int ns, int LNORM, float L2, int itest, int sws, int swstestshot, int ntr_glob, int **recpos_loc, int nsrc_glob, int ishot, int iter); double calc_res(float **sectiondata, float **section, float **sectiondiff, float **sectiondiffold, int ntr, int ns, int LNORM, float L2, int itest, int sws, int swstestshot, int ntr_glob, int **recpos_loc, int nsrc_glob, int ishot, int iter, float ** srcpos, int ** recpos);
double calc_misfit(float **sectiondata, float **section, int ntr, int ns, int LNORM, float L2, int itest, int sws, int swstestshot, int ntr_glob, int **recpos_loc, int nsrc_glob, int ishot, int iter); double calc_misfit(float **sectiondata, float **section, int ntr, int ns, int LNORM, float L2, int itest, int sws, int swstestshot,int ntr_glob, int **recpos_loc, int nsrc_glob, int ishot, int iter, float ** srcpos, int ** recpos);
float calc_opt_step(float * L2t, float ** waveconv, float ** gradp, float * epst, int sws, float C_vp); float calc_opt_step(float * L2t, float ** waveconv, float ** gradp, float * epst, int sws, float C_vp);
float calc_opt_step_test(float * L2t, float ** waveconv, float ** gradp, float * epst, int sws, float C_vp); float calc_opt_step_test(float * L2t, float ** waveconv, float ** gradp, float * epst, int sws, float C_vp);
double calc_energy(float **sectiondata, int ntr, int ns, float energy, int ntr_glob, int **recpos_loc, int nsrc_glob, int ishot, int iter); double calc_energy(float **sectiondata, int ntr, int ns, float energy, int ntr_glob, int **recpos_loc, int nsrc_glob, int ishot, int iter, float ** srcpos, int ** recpos);
void checkfd(FILE *fp, float ** prho, float ** ppi, float ** pu, float ** ptaus, float ** ptaup, float * peta, float *hc, float **srcpos, int nsrc, int **recpos, int ntr); void checkfd(FILE *fp, float ** prho, float ** ppi, float ** pu, float ** ptaus, float ** ptaup, float * peta, float *hc, float **srcpos, int nsrc, int **recpos, int ntr);
...@@ -94,7 +94,9 @@ void comm_ini(float ** bufferlef_to_rig, float ** bufferrig_to_lef, ...@@ -94,7 +94,9 @@ void comm_ini(float ** bufferlef_to_rig, float ** bufferrig_to_lef,
void conv_FD(float * temp_TS, float * temp_TS1, float * temp_conv, int ns); void conv_FD(float * temp_TS, float * temp_TS1, float * temp_conv, int ns);
void count_killed_traces(int ntr, int swstestshot, int ntr_glob, int **recpos_loc, int nsrc_glob, int ishot, int* ptr_killed_traces, int* ptr_killed_traces_testsshots); void count_killed_traces(int ntr, int swstestshot, int ntr_glob, int **recpos_loc, int nsrc_glob, int ishot, int* ptr_killed_traces, int* ptr_killed_traces_testshots,float ** srcpos, int ** recpos);
void create_trkill_table(int ** killtable, int ntr_glob, int **recpos, int nsrc_glob, float **srcpos, int ishot, float kill_offset_lower, float kill_offset_upper);
float exchange_L2(float L2, int sw, int bcast_l2); float exchange_L2(float L2, int sw, int bcast_l2);
......
...@@ -104,10 +104,18 @@ float WOLFE_C2_SL; ...@@ -104,10 +104,18 @@ float WOLFE_C2_SL;
int TRKILL; int TRKILL;
char TRKILL_FILE[STRING_SIZE]; char TRKILL_FILE[STRING_SIZE];
int TRKILL_OFFSET;
float TRKILL_OFFSET_LOWER;
float TRKILL_OFFSET_UPPER;
/* trace kill STF variables */ /* trace kill STF variables */
int TRKILL_STF; int TRKILL_STF;
char TRKILL_FILE_STF[STRING_SIZE]; char TRKILL_FILE_STF[STRING_SIZE];
int TRKILL_STF_OFFSET;
float TRKILL_STF_OFFSET_LOWER;
float TRKILL_STF_OFFSET_UPPER;
int TIMEWIN, NORMALIZE; int TIMEWIN, NORMALIZE;
float TWLENGTH_PLUS, TWLENGTH_MINUS, GAMMA; float TWLENGTH_PLUS, TWLENGTH_MINUS, GAMMA;
char PICKS_FILE[STRING_SIZE]; char PICKS_FILE[STRING_SIZE];
......
...@@ -77,9 +77,17 @@ void read_par_json(FILE *fp, char *fileinp){ ...@@ -77,9 +77,17 @@ void read_par_json(FILE *fp, char *fileinp){
extern int TRKILL; extern int TRKILL;
extern char TRKILL_FILE[STRING_SIZE]; extern char TRKILL_FILE[STRING_SIZE];
extern int TRKILL_OFFSET;
extern float TRKILL_OFFSET_LOWER;
extern float TRKILL_OFFSET_UPPER;
extern int TRKILL_STF; extern int TRKILL_STF;
extern char TRKILL_FILE_STF[STRING_SIZE]; extern char TRKILL_FILE_STF[STRING_SIZE];
extern int TRKILL_STF_OFFSET;
extern float TRKILL_STF_OFFSET_LOWER;
extern float TRKILL_STF_OFFSET_UPPER;
extern int TAPER_STF; extern int TAPER_STF;