Definition at line 163 of file gsexx_tests.cc.
References GSE2::waveform::TWID2::Fauxid, GSE2::waveform::TWID2::Fchannel, GSE2::waveform::TWID2::Fday, GSE2::waveform::TWID2::Finstype, GSE2::waveform::TWID2::Fmonth, GSE2::waveform::TWID2::Fsamprate, GSE2::waveform::TWID2::Fsamps, GSE2::waveform::TWID2::Fstation, GSE2::waveform::TWID2::Fyear, GSE2::waveform::TDAT2sum::hot(), GSE2::waveform::TWID2::line(), and GSE2::waveform::TWID2::read().
Referenced by main().
165 std::cout << std::endl;
166 std::cout <<
"Test the DAT2 class with CM6 subformat." 168 std::cout <<
"1. write waveform" 171 const int msamples=2000;
173 int indata[msamples];
174 for (
int i=0; i<msamples; i++)
176 data[i]=int(1.e5*std::sin(i*2.*3.141592653*5./(msamples-35)));
186 std::cout << wid2line.
line();
194 std::cerr <<
"ERROR: missed last sample!" << std::endl;
197 std::cout << writer(data[i]);
203 std::ofstream os(
"junk.dat");
204 os << wid2line.
line();
207 while (fwriter.hot())
211 std::cerr <<
"ERROR: missed last sample!" << std::endl;
214 os << fwriter(data[i]);
221 std::cerr <<
"manipulate junk.dat - if you like to..." << std::endl;
235 std::ifstream is(
"junk.dat");
237 newwid2line.
read(is);
239 while (freader.hot())
243 std::cerr <<
"ERROR: missed last sample!" << std::endl;
246 indata[i] =freader(is);
253 std::ofstream os(
"junk2.dat");
254 os << newwid2line.
line();
257 while (fwriter.hot())
261 std::cerr <<
"ERROR: missed last sample!" << std::endl;
264 os << fwriter(indata[i]);