Commit f1c8bbab authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

procedding with ovtaper

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 4486
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent b0104226
......@@ -50,8 +50,14 @@ namespace ts {
const double& T0,
const double& T) const
{
TSXX_abort("OffsetVariableTaper::taper not yet implemented");
ts::tapers::FourPoint fpt;
TSXX_assert(Mvalid,
"OffsetVariableTaper::taper: "
"taper is undefined");
double t1=(Mt1.time(offset)-T0)/T;
double t2=(Mt1.time(offset)-T0)/T;
double t3=(Mt1.time(offset)-T0)/T;
double t4=(Mt1.time(offset)-T0)/T;
ts::tapers::FourPoint fpt(t1, t2, t3, t4);
return(fpt);
} // ts::tapers::FourPoint OffsetVariableTaper::taper(...)
......@@ -61,7 +67,11 @@ namespace ts {
*/
void OffsetVariableTaper::read(std::istream& is)
{
TSXX_abort("OffsetVariableTaper::read not yet implemented");
Mt1.read(is);
Mt2.read(is);
Mt3.read(is);
Mt4.read(is);
Mvalid=true;
} // void OffsetVariableTaper::read(std::istream& is)
/*----------------------------------------------------------------------*/
......
......@@ -50,6 +50,38 @@ namespace ts {
namespace tapers {
/*! \brief bits and pieces required by OffsetVariableTaper
*/
namespace ovtaper {
//! a single pick
struct Pick {
//! time and offset
double t,x;
}; // struct Pick
/*----------------------------------------------------------------------*/
//! a sequence of picks
class Picks {
public:
typedef std::list<Pick> Tlistofpick;
Picks(const bool& debug): Mdebug(debug) { }
//! read from file in refract taper file format
void read(std::istream& is);
//! return time for given offset (with interpolation)
double time(const double& offset) const;
private:
//! produce debug output if true
bool Mdebug;
//! picks
Tlistofpick Mpicks;
}; // class Picks
} // namespace ovtaper
/*----------------------------------------------------------------------*/
/*! \brief Offset variable taper (refract taper).
*
* This class handles FourPoint tapers varying with receiver offset as can
......@@ -63,7 +95,10 @@ namespace ts {
typedef ts::TDtimeseries Ttimeseries;
typedef Ttimeseries::Tseries Tseries;
typedef Ttimeseries::Theader Theader;
OffsetVariableTaper(): Mvalid(false) { }
OffsetVariableTaper(const bool& debug)
: Mdebug(debug), Mvalid(false),
Mt1(debug), Mt2(debug), Mt3(debug), Mt4(debug)
{ }
/*! return specific four point taper
*
......@@ -84,8 +119,12 @@ namespace ts {
*/
void read(const std::string& filename);
private:
//! produce debug output if true
bool Mdebug;
//! true if taper definition is present
bool Mvalid;
//! taper picks
ovtaper::Picks Mt1, Mt2, Mt3, Mt4;
}; // class OffsetVariableTaper
} // namespace tapers
......
......@@ -32,11 +32,12 @@
* - 27/06/2006 V1.1 did not work anymore; deleted old code and filled
* with convolution test
* - 21/11/2006 V1.2 test drop containers
* - 28/01/2012 V1.3 test OffsetVariableTaper
*
* ============================================================================
*/
#define TSTEST_VERSION \
"TSTEST V1.2 test time series modules"
"TSTEST V1.3 test time series modules"
#define TSTEST_CVSID \
"$Id$"
......@@ -56,6 +57,8 @@ struct Options {
bool convtest1, convtest2;
bool randomnoise;
bool droptest, tapertest;
bool ovtapertest;
std::string ovtaperfile;
}; // struct Options
int main(int iargc, char* argv[])
......@@ -65,18 +68,19 @@ int main(int iargc, char* argv[])
char usage_text[]=
{
TSTEST_VERSION "\n"
"usage: tstest [-c1] [-c2] [-r] [-drop] [-tap]" "\n"
"usage: tstest [-c1] [-c2] [-r] [-drop] [-tap] [-ovtap f]" "\n"
" or: tstest --help|-h" "\n"
};
// define full help text
char help_text[]=
{
"-c1 convolution test 1" "\n"
"-c2 convolution test 2" "\n"
"-r random noise test" "\n"
"-drop drop container test" "\n"
"-tap test tapers" "\n"
"-c1 convolution test 1" "\n"
"-c2 convolution test 2" "\n"
"-r random noise test" "\n"
"-drop drop container test" "\n"
"-tap test tapers" "\n"
"-ovtap f test OffsetVariableTaper by reading taper from file f" "\n"
"\n"
TSTEST_CVSID
};
......@@ -99,6 +103,8 @@ int main(int iargc, char* argv[])
{"drop",arg_no,"-"},
// 6: taper test
{"tap",arg_no,"-"},
// 7: OffsetVariableTaper test
{"ovtap",arg_yes,"-"},
{NULL}
};
......@@ -127,6 +133,8 @@ int main(int iargc, char* argv[])
opt.randomnoise=cmdline.optset(4);
opt.droptest=cmdline.optset(5);
opt.tapertest=cmdline.optset(6);
opt.ovtapertest=cmdline.optset(7);
opt.ovtaperfile=cmdline.string_arg(7);
/*======================================================================*/
......
Markdown is supported
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