34 #define DATRW_READBONJER_CC_VERSION \ 35 "DATRW_READBONJER_CC V1.0 " 39 #include<datrwxx/readbonjer.h> 82 while (hot && is.good()) {
84 if (line.substr(0,7)==std::string(
"K2 Stn:"))
89 if (line.substr(0,17)==std::string(
"Event Start Time:"))
91 std::istringstream iss(line.substr(18).c_str());
93 int day, month, year, hour, minute;
95 iss >> month >> c >> day >> c >> year;
96 iss >> c >> hour >> c;
97 iss >> hour >> c >> minute >> c >> seconds;
98 retval.
date=libtime::TAbsoluteTime(year,month,day,hour,minute);
99 retval.
date+=libtime::double2time(seconds);
102 if (line.substr(0,19)==std::string(
"Samples per second:"))
104 retval.
rate=std::atof(line.substr(20).c_str());
107 if (line.substr(0,17)==std::string(
"Number of points:"))
109 retval.
nsamples=std::atoi(line.substr(18).c_str());
112 if (line.substr(0,9)==std::string(
"Filename:"))
117 if (line.substr(0,10)==std::string(
"Component:"))
122 if (line.substr(0,12)==std::string(
"Sensitivity:"))
127 if (line.substr(0,6)==std::string(
"Units:"))
129 retval.
units=line.substr(7);
132 if (mandatory > 7) { hot=
false; }
134 if (mandatory<8)
throw;
138 std::cout <<
"File: " << retval.
filename << std::endl;
139 std::cout <<
"Station: " << retval.
station << std::endl;
140 std::cout <<
"Component: " << retval.
component << std::endl;
141 std::cout <<
"First: " << retval.
date.timestring() << std::endl;
142 std::cout <<
"Rate: " << retval.
rate << std::endl;
143 std::cout <<
"Samples: " << retval.
nsamples << std::endl;
144 std::cout <<
"Sensitivity: " << retval.
sensitivity << std::endl;
145 std::cout <<
"Units: " << retval.
units << std::endl;
158 if (!is.good())
throw;
Tdata readdata(std::istream &is, const header &hd)
function to read the file data
Root namespace of library.
header readheader(std::istream &is, const bool &verbose)
function to read the file header
aff::Series< double > Tdata
we read the data to a vector