TS++ library: time series library
seifeclass.cc
Go to the documentation of this file.
1 
42 #define TF_SEIFECLASS_CC_VERSION \
43  "TF_SEIFECLASS_CC V1.3"
44 
45 #include<sstream>
46 #include<algorithm>
47 #include<tsxx/seifexx.h>
48 #include<tsxx/seifeclass.h>
50 #include<tfxx/misc.h>
51 
52 namespace ts {
53 
54  namespace seife {
55 
58  const bool& debug) const
59  { lpb(s, s.header.dt, Mt0, Mo); return s; }
60 
63  const bool& debug) const
64  { hpb(s, s.header.dt, Mt0, Mo); return s; }
65 
68  const bool& debug) const
69  { lp2(s, s.header.dt, Mt0, Mh); return s; }
70 
73  const bool& debug) const
74  { hp2(s, s.header.dt, Mt0, Mh); return s; }
75 
78  const bool& debug) const
79  { bp2(s, s.header.dt, Mt0, Mh); return s; }
80 
83  const bool& debug) const
84  { lp1(s, s.header.dt, Mt0); return s; }
85 
88  const bool& debug) const
89  { hp1(s, s.header.dt, Mt0); return s; }
90 
93  const bool& debug) const
94  { integrate(s, s.header.dt, Mt0); return s; }
95 
98  const bool& debug) const
99  { he1(s, s.header.dt, Mt0s, Mt0); return s; }
100 
103  const bool& debug) const
104  { le1(s, s.header.dt, Mt0s, Mt0); return s; }
105 
110  const bool& debug) const
111  {
112  if (debug) { ts::seife::debug_mode_on(); }
113  he2(s, s.header.dt, Mt0s, Mhs, Mt0, Mh);
114  return s;
115  }
116 
121  const bool& debug) const
122  { le2(s, s.header.dt, Mt0s, Mhs, Mt0, Mh); return s; }
123 
126  const bool& debug) const
127  { tid(s, s.header.dt, Mni); return s; }
128 
131  const bool& debug) const
132  { dif(s, s.header.dt, Mt0); return s; }
133 
136  const bool& debug) const
137  { first(s); return s; }
138 
139  /*----------------------------------------------------------------------*/
140 
143  const bool& debug)
144  {
145  std::replace(s.begin(),s.end(),',',' ');
146  typedef ts::filter::Tfilterhandle Tfh;
147  TFXX_debug(debug, "make_seife_filter", "definition: " << s);
148  Tfh fh(new ts::filter::Noop());
149  std::string ID;
150  std::istringstream is(s);
151  is >> ID;
152  TFXX_debug(debug, "make_seife_filter", "ID: " << ID);
153  ts::seife::Tvalue t0, t0s, h, hs;
154  int ni, o;
155  if (ID=="lpb") {
156  is >> t0 >> o;
157  fh=Tfh(new LPB(t0, o));
158  } else if (ID=="hpb") {
159  is >> t0 >> o;
160  fh=Tfh(new HPB(t0, o));
161  } else if (ID=="lp2") {
162  is >> t0 >> h;
163  fh=Tfh(new LP2(t0, h));
164  } else if (ID=="hp2") {
165  is >> t0 >> h;
166  fh=Tfh(new HP2(t0, h));
167  } else if (ID=="bp2") {
168  is >> t0 >> h;
169  fh=Tfh(new BP2(t0, h));
170  } else if (ID=="lp1") {
171  is >> t0;
172  fh=Tfh(new LP1(t0));
173  } else if (ID=="hp1") {
174  is >> t0;
175  fh=Tfh(new HP1(t0));
176  } else if (ID=="le1") {
177  is >> t0s >> t0;
178  fh=Tfh(new LE1(t0s, t0));
179  } else if (ID=="he1") {
180  is >> t0s >> t0;
181  fh=Tfh(new HE1(t0s, t0));
182  } else if (ID=="le2") {
183  is >> t0s >> hs >> t0 >> h;
184  fh=Tfh(new LE2(t0s, hs, t0, h));
185  } else if (ID=="he2") {
186  is >> t0s >> hs >> t0 >> h;
187  TFXX_debug(debug, "make_seife_filter",
188  "he2: "
189  << "t0s=" << t0s
190  << "hs=" << hs
191  << "t0=" << t0
192  << "h=" << h);
193  fh=Tfh(new HE2(t0s, hs, t0, h));
194  } else if (ID=="int") {
195  is >> t0;
196  fh=Tfh(new INT(t0));
197  } else if (ID=="dif") {
198  is >> t0;
199  fh=Tfh(new DIF(t0));
200  } else if (ID=="tid") {
201  is >> ni;
202  fh=Tfh(new TID(ni));
203  } else if (ID=="first") {
204  fh=Tfh(new FIRST());
205  } else if (ID=="DBG") {
206  debug_mode_on();
207  } else {
208  TSXX_UnknownFilterAbort("ts::seife::make_seife_filter", ID);
209  }
210  return(fh);
211  }
212 
214  void print_help(std::ostream& os)
215  {
216  os << TF_SEIFECLASS_CC_VERSION << std::endl;
217  os << seifeclass_usage_text;
218  }
219 
220  } // namespace seife
221 
222 } // namespace ts
223 
224 /* ----- END OF seifeclass.cc ----- */
void le2(const Tseries &s, double dt, double t0s, double hs, double t0, double h)
Definition: seifexx.cc:104
#define TF_SEIFECLASS_CC_VERSION
Definition: seifeclass.cc:42
tfxx::Handle< BasicFilter > Tfilterhandle
handle to pass filters
Definition: filterbase.h:93
void first(const Tseries &s)
Definition: seifexx.cc:117
Ttimeseries operator()(const Ttimeseries &s, const bool &debug=false) const
Definition: seifeclass.cc:77
void lp2(const Tseries &s, double dt, double t0, double h)
Definition: seifexx.cc:63
void dif(const Tseries &s, double dt, double t0)
Definition: seifexx.cc:113
Ttimeseries operator()(const Ttimeseries &s, const bool &debug=false) const
Definition: seifeclass.cc:130
Ttimeseries operator()(const Ttimeseries &s, const bool &debug=false) const
Definition: seifeclass.cc:62
void debug_mode_on()
Definition: seifexx.cc:52
Ttimeseries operator()(const Ttimeseries &s, const bool &debug=false) const
Definition: seifeclass.cc:92
double Tvalue
seife functions use double precision
Definition: seifexx.h:58
make seife functions available for C++ (prototypes)
Ttimeseries operator()(const Ttimeseries &s, const bool &debug=false) const
Definition: seifeclass.cc:125
Ttimeseries operator()(const Ttimeseries &s, const bool &debug=false) const
Definition: seifeclass.cc:120
char seifeclass_usage_text[]
Structure to hold the data samples of a series together with header information to form a time series...
Definition: tsxx.h:83
Ttimeseries operator()(const Ttimeseries &s, const bool &debug=false) const
Definition: seifeclass.cc:67
Ttimeseries operator()(const Ttimeseries &s, const bool &debug=false) const
Definition: seifeclass.cc:102
ts::filter::Tfilterhandle make_seife_filter(std::string s, const bool &debug)
function to generate filter class
Definition: seifeclass.cc:142
All stuff in this library will be placed within namespace ts.
Definition: anyfilter.cc:43
Theader header
data header fields
Definition: tsxx.h:134
void hp2(const Tseries &s, double dt, double t0, double h)
Definition: seifexx.cc:67
void he1(const Tseries &s, double dt, double t0s, double t0)
Definition: seifexx.cc:87
void le1(const Tseries &s, double dt, double t0s, double t0)
Definition: seifexx.cc:91
Ttimeseries operator()(const Ttimeseries &s, const bool &debug=false) const
Definition: seifeclass.cc:97
Ttimeseries operator()(const Ttimeseries &s, const bool &debug=false) const
Definition: seifeclass.cc:135
void bp2(const Tseries &s, double dt, double t0, double h)
Definition: seifexx.cc:71
Ttimeseries operator()(const Ttimeseries &s, const bool &debug=false) const
Definition: seifeclass.cc:72
void print_help(std::ostream &os)
print usage information
Definition: seifeclass.cc:214
#define TSXX_UnknownFilterAbort(M, F)
Definition: filterbase.h:153
Ttimeseries operator()(const Ttimeseries &s, const bool &debug=false) const
Definition: seifeclass.cc:82
void hp1(const Tseries &s, double dt, double t0)
Definition: seifexx.cc:79
void lpb(const Tseries &s, double dt, double t0, int o)
Definition: seifexx.cc:55
no-operation filter
Definition: filterbase.h:115
provide all needed to use BasicFilter with seife code (prototypes)
Ttimeseries operator()(const Ttimeseries &s, const bool &debug=false) const
Definition: seifeclass.cc:57
void hpb(const Tseries &s, double dt, double t0, int o)
Definition: seifexx.cc:59
void lp1(const Tseries &s, double dt, double t0)
Definition: seifexx.cc:75
void tid(const Tseries &s, double dt, int ni)
Definition: seifexx.cc:109
Ttimeseries operator()(const Ttimeseries &s, const bool &debug=false) const
Definition: seifeclass.cc:87
void he2(const Tseries &s, double dt, double t0s, double hs, double t0, double h)
Definition: seifexx.cc:97
Ttimeseries operator()(const Ttimeseries &s, const bool &debug=false) const
Definition: seifeclass.cc:109
void integrate(const Tseries &s, double dt, double t0)
Definition: seifexx.cc:83