8 #include <boost/date_time/posix_time/posix_time.hpp>
13 CsvFormat::CsvFormat()
17 CsvFormat::~CsvFormat()
21 void CsvFormat::GetData(
const std::string filename)
23 ifstream infile(filename.c_str());
25 string line1, line2, line3, line4, line5, line6;
27 vector<double>::iterator outit;
29 infile.getline(dummy,
sizeof(dummy));
30 infile.getline(dummy,
sizeof(dummy));
31 infile.getline(dummy,
sizeof(dummy));
32 infile.getline(dummy,
sizeof(dummy));
33 infile.getline(dummy,
sizeof(dummy));
34 infile.getline(dummy,
sizeof(dummy));
45 Ex.GetData().push_back(number);
46 infile.ignore(256,
',');
49 Ey.GetData().push_back(number);
50 infile.ignore(256,
',');
53 Hx.GetData().push_back(number);
54 infile.ignore(256,
',');
57 Hy.GetData().push_back(number);
58 infile.ignore(256,
',');
61 Hz.GetData().push_back(number);
62 infile.ignore(256,
',');
71 void CsvFormat::WriteData(
const std::string filename)
75 outfile.open(filename.c_str());
76 for (
unsigned int i = 0; i < Ex.GetData().size(); ++i)
79 outfile << setw(10) << boost::posix_time::to_simple_string(t.at(i))
81 outfile << setw(10) << Ex.GetData().at(i) <<
",";
82 outfile << setw(10) << Ey.GetData().at(i) <<
",";
83 outfile << setw(10) << Hx.GetData().at(i) <<
",";
84 outfile << setw(10) << Hy.GetData().at(i) <<
",";
85 outfile << setw(10) << Hz.GetData().at(i) << endl;
95 this->TimeSeries::operator=(source);
102 this->TimeSeries::operator=(source);
108 this->TimeSeries::operator=(source);
111 void CsvFormat::GetData()
This class is the base class for all classes dealing with MT time series.
The basic exception class for all errors that arise in gplib.