Commit 4e2778fb authored by thomas.forbriger's avatar thomas.forbriger
Browse files

[MERGE] (i20_gremlin_example|master) merge recent ovtaper fix

parents 6c4b9695 ce60ea64
......@@ -3,6 +3,8 @@ this is <CHANGELOG>
Recent development in Seitosh (bug fixes, new features, etc)
------------------------------------------------------------
23.03.2016 (9d9866d5c): add toy example for lisousi
25.02.2016 (32a3ac206): fix errors in documentation of lisousi
The offset dependent scaling factor was wrong incorrectly specified in the
......
......@@ -28,12 +28,14 @@
*
*
* REVISIONS and CHANGES
* - 26/01/2012 V1.0 Thomas Forbriger
* - 26/01/2012 V1.1 Thomas Forbriger
* - 19/06/2016 V1.2 make offset variable taper robust in case of picks
* outside seismogram range
*
* ============================================================================
*/
#define TSXX_OVTAPER_CC_VERSION \
"TSXX_OVTAPER_CC V1.0 "
"TSXX_OVTAPER_CC V1.2"
#include <fstream>
#include <sstream>
......@@ -134,10 +136,17 @@ namespace ts {
TSXX_assert(Mvalid,
"OffsetVariableTaper::taper: "
"taper is undefined");
// calculate times in units of the duration of the time series
double t1=(Mt1.time(offset)-T0)/T;
double t2=(Mt2.time(offset)-T0)/T;
double t3=(Mt3.time(offset)-T0)/T;
double t4=(Mt4.time(offset)-T0)/T;
// keep values in bounds of time series
t1 = t1 >= 0. ? t1 : 0.;
t2 = t2 >= 1.e-6 ? t2 : 1.e-6;
t3 = t3 <= .99999 ? t3 : .99999;
t4 = t4 <= 1. ? t4 : 1.;
// initialize taper
ts::tapers::FourPoint fpt(t1, t2, t3, t4);
return(fpt);
} // ts::tapers::FourPoint OffsetVariableTaper::taper(...)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment