35 #define TF_GSEXX_TWID2_CC_VERSION \ 36 "TF_GSEXX_TWID2_CC V1.2 " 37 #define TF_GSEXX_TWID2_CC_CVSID \ 60 std::string retval(
"NSP");
70 Terror(
"ERROR (TWID2): unknown subformat key!");
77 const int bufsize=135;
79 char charbuf[bufsize];
83 sprintf(charbuf,
"%-4s %4.4i/%2.2i/%2.2i %2.2i:%2.2i:%2.2i.%3.3i " 84 "%-5s %-3s %-4s %-3s %8i %11.6f %10.2e %7.3f %-6s %5.1f %4.1f\n",
89 Fauxid.substr(0,4).c_str(),
90 datatype.substr(0,3).c_str(),
94 std::string retval(charbuf);
102 getline(is, theline);
105 std::string lineID=theline.substr(0,4);
106 if (!GSEIDmatch<TWID2>(lineID))
throw 107 Terror(
"ERROR (TWID2::read): missing WID2 ID!");
109 Fyear =atoi(theline.substr( 5,4).c_str());
110 Fmonth =atoi(theline.substr(10,2).c_str());
111 Fday =atoi(theline.substr(13,2).c_str());
112 Fhour =atoi(theline.substr(16,2).c_str());
113 Fminute =atoi(theline.substr(19,2).c_str());
115 int isec =atoi(theline.substr(22,2).c_str());
116 Fmilsec =atoi(theline.substr(25,3).c_str());
129 Fauxid =theline.substr(39,4);
133 Fsamps =atoi(theline.substr(48,8).c_str());
135 Fsamprate=atof(theline.substr(57,11).c_str());
136 Fcalib =atof(theline.substr(69,10).c_str());
137 Fcalper =atof(theline.substr(80,7).c_str());
139 Fhang =atof(theline.substr(95,5).c_str());
140 Fvang =atof(theline.substr(101,4).c_str());
158 std::time_t nowtime=std::time(NULL);
159 std::tm *now=std::localtime(&nowtime);
160 Fyear=now->tm_year+1900;
GSE++ library: read and write GSE waveform data (prototypes).
All stuff defined by the GSE2 standard.
Base class for all exceptions in this module.