5 #include <boost/cast.hpp>
12 LemiTsFormat::LemiTsFormat()
16 LemiTsFormat::~LemiTsFormat()
20 void LemiTsFormat::GetData()
25 void LemiTsFormat::GetData(
const std::string filename)
27 ifstream infile(filename.c_str());
28 double rawsecond, fraction;
29 int year, month, day, hour, minute, second;
30 const double rate = 4.0;
36 infile >> year >> month >> day >> hour >> minute >> rawsecond;
37 second =
static_cast<int> (rawsecond);
38 fraction = rawsecond -
static_cast<int> (rawsecond);
40 boost::gregorian::date(year, month, day),
41 boost::posix_time::time_duration(hour, minute, second));
42 currtime += boost::posix_time::microseconds(
43 boost::numeric_cast<int>(fraction * 1000000));
44 t.push_back(currtime);
48 Hx.GetData().push_back(number);
50 Hy.GetData().push_back(number);
52 Hz.GetData().push_back(number);
53 infile >> number >> number >> number;
54 Ex.GetData().push_back(number);
56 Ey.GetData().push_back(number);
57 infile >> number >> number >> number;
64 Hx.SetSamplerate(rate);
65 Hy.SetSamplerate(rate);
66 Hz.SetSamplerate(rate);
67 Ex.SetSamplerate(rate);
68 Ey.SetSamplerate(rate);
71 void LemiTsFormat::WriteData(
const std::string filename)
78 this->TimeSeries::operator=(source);
84 this->TimeSeries::operator=(source);
90 this->TimeSeries::operator=(source);
98 this->TimeSeries::operator=(source);
This class is the base class for all classes dealing with MT time series.
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.