Commit d5809e88 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

[FIX] (dccal): fix output of residual time series

Use proper libtsioxx output operators.
parent 9d9866d5
...@@ -33,13 +33,12 @@ ...@@ -33,13 +33,12 @@
* - 24/09/2007 V1.3 gain residual may have a sign * - 24/09/2007 V1.3 gain residual may have a sign
* - 21/01/2011 V1.4 estimate gain precision * - 21/01/2011 V1.4 estimate gain precision
* - 01/02/2014 thof: use new libtsioxx * - 01/02/2014 thof: use new libtsioxx
* - 14/04/2016 thof: use proper libtsioxx output operators
* *
* ============================================================================ * ============================================================================
*/ */
#define DCCAL_VERSION \ #define DCCAL_VERSION \
"DCCAL V2014-02-01 DC calibration" "DCCAL V2016-04-14 DC calibration"
#define DCCAL_CVSID \
"$Id$"
#include <string> #include <string>
#include <iostream> #include <iostream>
...@@ -51,9 +50,10 @@ ...@@ -51,9 +50,10 @@
#include <tfxx/misc.h> #include <tfxx/misc.h>
#include <sffxx.h> #include <sffxx.h>
#include <libtime++.h> #include <libtime++.h>
#include <sffostream.h>
#include <datrwxx/readany.h> #include <datrwxx/readany.h>
#include <datrwxx/writeany.h>
#include <tsioxx/inputoperators.h> #include <tsioxx/inputoperators.h>
#include <tsioxx/outputoperators.h>
#include <aff/subarray.h> #include <aff/subarray.h>
#include <aff/functions/sum.h> #include <aff/functions/sum.h>
#include <aff/functions/sqrsum.h> #include <aff/functions/sqrsum.h>
...@@ -674,14 +674,12 @@ int main(int iargc, char* argv[]) ...@@ -674,14 +674,12 @@ int main(int iargc, char* argv[])
// define full help text // define full help text
char help_text[]= char help_text[]=
{ {
DCCAL_CVSID "\n"
"\n"
"infile SFF data file" "\n" "infile SFF data file" "\n"
"tabfile ASCII table that defines calibration input" "\n" "tabfile ASCII table that defines calibration input" "\n"
"resfile write residuals to resfile" "\n" "resfile write residuals to resfile" "\n"
"logfile write results to logfile" "\n" "logfile write results to logfile" "\n"
"-v be verbose" "\n" "-v be verbose" "\n"
"-type t input file type" "\n" "-type t time series file type" "\n"
"-units u set data file sample units" "\n" "-units u set data file sample units" "\n"
"-gain g set desired differential mode gain" "\n" "-gain g set desired differential mode gain" "\n"
"\n" "\n"
...@@ -768,17 +766,15 @@ int main(int iargc, char* argv[]) ...@@ -768,17 +766,15 @@ int main(int iargc, char* argv[])
datrw::ianystream ins(infs, opt.inputformat); datrw::ianystream ins(infs, opt.inputformat);
std::ifstream tabfs(tabfilename.c_str()); std::ifstream tabfs(tabfilename.c_str());
std::ofstream resfs(resfilename.c_str()); std::ofstream resfs(resfilename.c_str());
sff::SFFostream<Tseries> ress(resfs); datrw::oanystream ress(resfs, opt.inputformat);
std::ofstream logfs(logfilename.c_str()); std::ofstream logfs(logfilename.c_str());
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
if (opt.verbose) if (opt.verbose)
{ {
cout << DCCAL_VERSION << endl; cout << DCCAL_VERSION << endl;
cout << DCCAL_CVSID << endl;
} }
logfs << DCCAL_VERSION << endl; logfs << DCCAL_VERSION << endl;
logfs << DCCAL_CVSID << endl;
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
// initialize calibrator // initialize calibrator
...@@ -804,8 +800,8 @@ int main(int iargc, char* argv[]) ...@@ -804,8 +800,8 @@ int main(int iargc, char* argv[])
Ttimeseries::Tconsttimeseries cts(timeseries, timeseries.header); Ttimeseries::Tconsttimeseries cts(timeseries, timeseries.header);
Results results=calibrator(cts, opt.acqpar); Results results=calibrator(cts, opt.acqpar);
ress << results.residual; ress << results.residual;
if (opt.verbose) { cout << results; } if (opt.verbose) { cout << "\n" << results; }
logfs << results; logfs << "\n" << results;
} // end of cycling through all traces } // end of cycling through all traces
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment