7 #include <boost/cast.hpp>
13 BirrpAsciiFormat::BirrpAsciiFormat()
16 BirrpAsciiFormat::~BirrpAsciiFormat()
20 void BirrpAsciiFormat::GetData(
const std::string filename)
22 ifstream infile(filename.c_str());
23 double currex, currey, currhx, currhy, currhz;
24 const double birrp_samplerate = 1.0;
27 boost::posix_time::time_duration(12, 0, 0));
31 infile >> currex >> currey >> currhx >> currhy >> currhz;
34 Ex.GetData().push_back(currex);
35 Ey.GetData().push_back(currey);
36 Hx.GetData().push_back(currhx);
37 Hy.GetData().push_back(currhy);
38 Hz.GetData().push_back(currhz);
39 t.push_back(basetime);
40 basetime += boost::posix_time::seconds(
41 boost::numeric_cast<int>(birrp_samplerate));
49 Hx.SetSamplerate(birrp_samplerate);
50 Hy.SetSamplerate(birrp_samplerate);
51 Hz.SetSamplerate(birrp_samplerate);
52 Ex.SetSamplerate(birrp_samplerate);
53 Ey.SetSamplerate(birrp_samplerate);
56 void BirrpAsciiFormat::WriteData(
const std::string filename)
58 ofstream outfile(filename.c_str());
61 const size_t exsize = Size();
63 exit = Ex.GetData().begin();
64 eyit = Ey.GetData().begin();
65 hxit = Hx.GetData().begin();
66 hyit = Hy.GetData().begin();
67 hzit = Hz.GetData().begin();
69 while (exit != Ex.GetData().end())
72 outfile << setw(20) << *exit <<
" ";
73 outfile << setw(20) << *eyit <<
" ";
74 outfile << setw(20) << *hxit <<
" ";
75 outfile << setw(20) << *hyit <<
" ";
76 outfile << setw(20) << *hzit << endl;
89 this->TimeSeries::operator=(source);
97 this->TimeSeries::operator=(source);
104 this->TimeSeries::operator=(source);
This class is the base class for all classes dealing with MT time series.
std::vector< double >::iterator tdatait
boost::posix_time::ptime ttime
We use the boost library time functionality for time types and store the time for each point in a vec...
The basic exception class for all errors that arise in gplib.