62 "usage: sfftest [-D] [-v] [-s] filename ..." "\n" 63 " or: sfftest --help|-h" "\n" 70 "filename ... SFF data files for reading" "\n" 73 "-v verbose mode" "\n" 75 "-n=val display only vale samples at start end end of file" "\n" 76 "-c only count samples" "\n" 80 using namespace tfxx::cmdline;
81 static Declare options[]=
101 cerr << usage_text << endl;
106 Commandline cmdline(iargc, argv, options);
109 if (cmdline.optset(0))
111 cerr << usage_text << endl;
112 cerr << help_text << endl;
118 opt.
debug=cmdline.optset(2);
120 opt.
count=cmdline.optset(4);
121 opt.
nprint=cmdline.int_arg(5);
123 while (cmdline.extra())
125 std::string filename=cmdline.next();
128 std::cout << std::endl;
129 std::cout <<
"file: " << filename << std::endl;
132 std::ifstream ifs(filename.c_str());
136 if (opt.
verbose) { is.free().write(std::cout); }
148 std::cout << is.wid2().line() << std::endl;
153 opt.
nprint < int(iseries.size()/2) ?
154 opt.
nprint : iseries.size()/2;
155 for (
int i=0; i<npr; ++i)
156 { std::cout << i <<
" " << iseries(i) << std::endl; }
157 std::cout <<
" ... " << std::endl;
158 for (
int i=iseries.size()-npr; i<int(iseries.size()); ++i)
159 { std::cout << i <<
" " << iseries(i) << std::endl; }
164 sff::FileHeader fileheader(ifs, opt.
debug);
167 cout <<
"read file header:" << endl;
168 fileheader.write(cout);
169 cout <<
"-----------------" << endl << endl;
174 sff::InputWaveform<Tseries> inputwaveform(ifs, opt.
debug);
177 cout <<
"read trace header:" << endl;
178 inputwaveform.header().writeheader(cout);
179 inputwaveform.header().writetrailer(cout);
180 cout <<
"------------------" << endl << endl;
182 last=inputwaveform.last();
aff::Series< int > Tiseries