Skip to content
Snippets Groups Projects
Commit e03786c8 authored by Arash Rezaei Nevisi's avatar Arash Rezaei Nevisi
Browse files

error regarding defult value for max offset fixed

parent e2c65653
No related branches found
No related tags found
No related merge requests found
......@@ -242,22 +242,35 @@ void time_window(float **sectiondata1, float **sectiondata2, int **recpos_loc, i
for(i=1;i<=ntr_loc;i++){
if ((gv->OFFSET_MIN_MUTE > 0) || (gv->OFFSET_MAX_MUTE > 0)) {
if (gv->OFFSET_MIN_MUTE > 0) {
// Compute receiver physical coordinates.
nxrec = (recpos_loc[1][i] - 1 + gv->POS[1] * gv->NX) * gv->DX;
nzrec = (recpos_loc[3][i] - 1 + gv->POS[3] * gv->NZ) * gv->DZ;
// if the receiver is within the offset window around the source.
if (((nxrec > nxsrc - gv->OFFSET_MIN_MUTE) && (nxrec < nxsrc + gv->OFFSET_MIN_MUTE) &&
(nzrec > nzsrc - gv->OFFSET_MIN_MUTE) && (nzrec < nzsrc + gv->OFFSET_MIN_MUTE)) ||
((nxrec < nxsrc - gv->OFFSET_MAX_MUTE) || (nxrec > nxsrc + gv->OFFSET_MAX_MUTE) ||
(nzrec < nzsrc - gv->OFFSET_MAX_MUTE) || (nzrec > nzsrc + gv->OFFSET_MAX_MUTE))) {
if ((nxrec > nxsrc - gv->OFFSET_MIN_MUTE) && (nxrec < nxsrc + gv->OFFSET_MIN_MUTE) &&
(nzrec > nzsrc - gv->OFFSET_MIN_MUTE) && (nzrec < nzsrc + gv->OFFSET_MIN_MUTE)) {
for (int j = 1; j < gv->NT; j++) {
sectiondata1[i][j] = 0;
sectiondata2[i][j] = 0;
}
}
}
}
if (gv->OFFSET_MAX_MUTE > 0) {
// Compute receiver physical coordinates.
nxrec = (recpos_loc[1][i] - 1 + gv->POS[1] * gv->NX) * gv->DX;
nzrec = (recpos_loc[3][i] - 1 + gv->POS[3] * gv->NZ) * gv->DZ;
// if the receiver is outside the maximum offset respect to the source location.
if ((nxrec < nxsrc - gv->OFFSET_MAX_MUTE) || (nxrec > nxsrc + gv->OFFSET_MAX_MUTE) ||
(nzrec < nzsrc - gv->OFFSET_MAX_MUTE) || (nzrec > nzsrc + gv->OFFSET_MAX_MUTE)) {
for (int j = 1; j < gv->NT; j++) {
sectiondata1[i][j] = 0;
sectiondata2[i][j] = 0;
}
}
}
......
......@@ -484,8 +484,10 @@ void writepar(GlobVar *gv)
log_info("STA/LTA method: Threshold -> %f \n", gv->THRESHOLD_STALTA);
log_info("Window length above the first arrival -> %f sec\n", gv->TW_TOP);
log_info("Window length below the first arrival -> %f sec\n", gv->TW_BOT);
if ((gv->OFFSET_MIN_MUTE > 0) || (gv->OFFSET_MAX_MUTE > 0)){
if (gv->OFFSET_MIN_MUTE > 0){
log_info("Offset Mute: minimum offset allowed -> %f meter\n", gv->OFFSET_MIN_MUTE );
}
if (gv->OFFSET_MAX_MUTE > 0){
log_info("Offset Mute: maximum offset allowed -> %f meter\n", gv->OFFSET_MAX_MUTE);
}
if (gv->BAD_TRACE_THRESHOLD > 0){
......
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