TS++ library: time series library
ovtaper.h
Go to the documentation of this file.
1 
36 // include guard
37 #ifndef TSXX_OVTAPER_H_VERSION
38 
39 #define TSXX_OVTAPER_H_VERSION \
40  "TSXX_OVTAPER_H V1.0 "
41 
42 #include <iostream>
43 #include <list>
44 #include <tsxx/tsxx.h>
45 #include <tsxx/tapers.h>
46 #include <tsxx/dttimeseries.h>
47 
48 namespace ts {
49 
50  namespace tapers {
51 
54  namespace ovtaper {
55 
57  struct Pick {
58  Pick(): t(0), x(0) { }
59  Pick(const double& offset): t(0), x(offset) { }
60  double t;
61  double x;
62  }; // struct Pick
63 
64  /*----------------------------------------------------------------------*/
65 
66  inline
67  bool operator<(const Pick& p1, const Pick& p2) { return (p1.x<p2.x); }
68  inline
69  bool operator>(const Pick& p1, const Pick& p2) { return (p1.x>p2.x); }
70 
71  /*----------------------------------------------------------------------*/
72 
74  class Picks {
75  public:
76  typedef std::list<Pick> Tlistofpick;
77  Picks(const bool& debug): Mdebug(debug) { }
79  void read(std::istream& is);
81  Pick pick(const double& offset) const;
83  double time(const double& offset) const;
84  private:
86  bool Mdebug;
89  }; // class Picks
90 
91  } // namespace ovtaper
92 
93  /*----------------------------------------------------------------------*/
94 
101  public:
103  typedef double Tvalue;
108  OffsetVariableTaper(const bool& debug=false)
109  : Mdebug(debug), Mvalid(false),
110  Mt1(debug), Mt2(debug), Mt3(debug), Mt4(debug)
111  { }
112 
120  ts::tapers::FourPoint taper(const double& offset,
121  const double& T0,
122  const double& T) const;
123 
126  void read(std::istream& is);
127 
130  void read(const std::string& filename);
131 
132  ovtaper::Picks t1() const { return Mt1; }
133  ovtaper::Picks t2() const { return Mt2; }
134  ovtaper::Picks t3() const { return Mt3; }
135  ovtaper::Picks t4() const { return Mt4; }
136  private:
138  bool Mdebug;
140  bool Mvalid;
143  }; // class OffsetVariableTaper
144 
145  } // namespace tapers
146 
147 } // namespace ts
148 
149 #endif // TSXX_OVTAPER_H_VERSION (includeguard)
150 
151 /* ----- END OF ovtaper.h ----- */
double time(const double &offset) const
return time for interpolated pick at given offset
Definition: ovtaper.cc:123
ts::tapers::FourPoint taper(const double &offset, const double &T0, const double &T) const
Definition: ovtaper.cc:133
bool Mdebug
produce debug output if true
Definition: ovtaper.h:86
ovtaper::Picks t1() const
Definition: ovtaper.h:132
Tlistofpick Mpicks
picks
Definition: ovtaper.h:88
a sequence of picks
Definition: ovtaper.h:74
Offset variable taper (refract taper).
Definition: ovtaper.h:100
void read(std::istream &is)
Definition: ovtaper.cc:159
OffsetVariableTaper(const bool &debug=false)
Definition: ovtaper.h:108
ts::TDtimeseries Ttimeseries
type of series container
Definition: ovtaper.h:105
Pick pick(const double &offset) const
return interpolated pick for given offset
Definition: ovtaper.cc:90
double Tvalue
type of sample values
Definition: ovtaper.h:103
time series with basic sampling interval header (prototypes)
a single pick
Definition: ovtaper.h:57
ovtaper::Picks Mt1
taper picks
Definition: ovtaper.h:142
bool Mdebug
produce debug output if true
Definition: ovtaper.h:138
Structure to hold the data samples of a series together with header information to form a time series...
Definition: tsxx.h:83
Pick(const double &offset)
Definition: ovtaper.h:59
All stuff in this library will be placed within namespace ts.
Definition: anyfilter.cc:43
bool operator>(const Pick &p1, const Pick &p2)
Definition: ovtaper.h:69
double x
offset
Definition: ovtaper.h:61
ovtaper::Picks t3() const
Definition: ovtaper.h:134
Ttimeseries::Theader Theader
Definition: ovtaper.h:107
basic modules of time series library in C++ (prototypes)
ovtaper::Picks t4() const
Definition: ovtaper.h:135
std::list< Pick > Tlistofpick
Definition: ovtaper.h:76
ovtaper::Picks t2() const
Definition: ovtaper.h:133
Ttimeseries::Tseries Tseries
Definition: ovtaper.h:106
Provides a 4-point taper.
Definition: tapers.h:140
bool operator<(const Pick &p1, const Pick &p2)
Definition: ovtaper.h:67
bool Mvalid
true if taper definition is present
Definition: ovtaper.h:140
Picks(const bool &debug)
Definition: ovtaper.h:77
void read(std::istream &is)
read from file in refract taper file format
Definition: ovtaper.cc:54
provide signal tapers (prototypes)