82 while (hot && is.good()) {
84 if (line.substr(0,7)==std::string(
"K2 Stn:"))
86 retval.station=line.substr(8);
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:"))
114 retval.filename=line.substr(10);
117 if (line.substr(0,10)==std::string(
"Component:"))
119 retval.component=line.substr(11);
122 if (line.substr(0,12)==std::string(
"Sensitivity:"))
124 retval.sensitivity=line.substr(13);
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;