74 "usage: tstest [-c1] [-c2] [-r] [-drop] [-tap] [-ovtap f]" "\n" 75 " or: tstest --help|-h" "\n" 81 "-c1 convolution test 1" "\n" 82 "-c2 convolution test 2" "\n" 83 "-r random noise test" "\n" 84 "-drop drop container test" "\n" 85 "-tap test tapers" "\n" 86 "-ovtap f test OffsetVariableTaper by reading taper from file f" "\n" 91 using namespace tfxx::cmdline;
92 static Declare options[]=
109 {
"ovtap",arg_yes,
"-"},
116 cerr << usage_text << endl;
121 Commandline cmdline(iargc, argv, options);
124 if (cmdline.optset(0))
126 cerr << usage_text << endl;
127 cerr << help_text << endl;
149 aff::Series<double> a(-2,2), b(-3,3), c, d;
151 cout <<
"convolution test 1" << endl;
152 for (
int i=a.f(); i<=a.l(); ++i) { a(i)=i; }
153 for (
int i=b.f(); i<=b.l(); ++i) { b(i)=i; }
171 aff::Series<double> a(-2,2), b(-3,3);
173 cout <<
"convolution test 2" << endl;
174 for (
int i=a.f(); i<=a.l(); ++i) { a(i)=1; }
175 for (
int i=b.f(); i<=b.l(); ++i) { b(i)=1; }
185 cout <<
"test random noise generation" << endl;
196 cout <<
"test drop containers" << endl;
197 aff::Series<int> a(1,108);
198 for (
int i=a.f(); i<=a.l(); ++i) { a(i)=i; }
204 cout <<
"downsampling with gain " << d1.gain() << endl;
205 d1.attach(d2)->attach(d3)->attach(pass)->attach(d1);
206 cout <<
"downsampling with factor " << d1.downsampling_factor() << endl;
207 cout <<
"downsampling with gain " << d1.gain() << endl;
208 d1.initialize(a.size());
209 cout <<
"downsampling with factor " << d1.downsampling_factor() << endl;
210 cout <<
"downsampling with gain " << d1.gain() << endl;
211 for (
int i=a.f(); i<=a.l(); ++i) { d1.drop(a(i)); }
213 DUMP( d1.container() );
218 aff::Series<double> b(1,1000);
219 for (
int i=b.f(); i<=b.l(); ++i) { b(i)=i; }
223 d4.initialize(b.size());
224 for (
int i=b.f(); i<=b.l(); ++i) { d4.drop(b(i)); }
225 DUMP( d4.container() );
232 cout <<
"test taper" << endl;
233 aff::Series<double> a(-5,5);
241 aff::Series<double> b(-50,50);
244 for (
int i=b.f(); i<=b.l(); ++i)
246 cout << i <<
" " << b(i) << endl;
257 const double xmax=90.;
258 const double dx=xmax/n;
260 for (
int i=0; i<n; ++i)
263 cout <<
"x=" << x <<
" t=" << picks.
time(x) <<
"\n";
267 aff::Series<double> b(-50,50);
270 for (
int i=b.f(); i<=b.l(); ++i)
272 cout << i <<
" " << b(i) << endl;
Tdseries dugauss(const int &n)
return gaussian uniform noise (standard dev=1, zero mean)
double time(const double &offset) const
return time for interpolated pick at given offset
void apply(C c) const
apply taper to series container c.
aff::Series< T > convolve(const aff::ConstSeries< T > &a, const aff::ConstSeries< T > &b)
Calculate convolution of two series.
Offset variable taper (refract taper).
virtual int downsampling_factor() const
void help(std::ostream &os)
void print_help(std::ostream &os)
print usage information
aff::Series< double > Tdseries
void print_help(std::ostream &os)
print usage information
Provides a 4-point taper.
Provides a Hanning taper (no parameters):