Commit 9b6fe244 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

ts/wf [WP]: make proper use of output operators

parent 82c62733
......@@ -42,11 +42,12 @@
* - 11/02/2011 V1.6 add definition of traces
* - 20/02/2012 V1.7 read and write any file format (damb)
* trace selecttion requires skip trace (thof)
* - 22/11/2016 V1.8 make use of new output facilities in libtsxx
*
* ============================================================================
*/
#define SIGFIT_VERSION \
"SIGFIT V1.7 fit signal by trial-signals"
"SIGFIT V1.8 fit signal by trial-signals"
#include <fstream>
#include <iostream>
......@@ -63,6 +64,7 @@
#include <tsxx/tsxx.h>
#include <tsxx/innerproduct.h>
#include <tsxx/wid2timeseries.h>
#include <tsxx/wid2tsio.h>
#include <aff/array.h>
#include <aff/dump.h>
#include <aff/seriesoperators.h>
......@@ -652,31 +654,26 @@ int main(int iargc, char* argv[])
}
os << residualFileFree;
}
os << signal.header;
os << signal.series();
os << synthetics.header;
os << synthetics.series();
os << residual.header;
os << residual.series();
os << signal;
os << synthetics;
os << residual;
for (Tbundlevec::const_iterator i=bundlevec.begin();
i!=bundlevec.end(); i++)
{ os << i->header; os << *i; }
for (int i=1; i<=N; ++i)
{
Tbundle psyn=bundlevec[i-1];
psyn=bundlevec[i-1].series()*coeff(i);
psyn=bundlevec[i-1];
psyn *= coeff(i);
char chan[6];
std::sprintf(chan,"s%1.1d", i);
psyn.header.channel=std::string(chan);
os << psyn.header;
os << psyn;
}
os << corrsignal.header;
os << corrsignal.series();
os << corrsynthetics.header;
os << corrsynthetics.series();
os << correction.header;
os << correction.series();
os << corrsignal;
os << corrsynthetics;
os << correction;
}
// calculate rms values
......
......@@ -32,17 +32,19 @@
* - 08/09/2011 V1.1 support format modifiers
* - 30/09/2011 V1.2 support additional time series pairs
* - 19/10/2015 V1.3 provide full usage information from libstfinv
* - 22/11/2016 V1.4 make proper use of output operators
*
* ============================================================================
*/
#define SOUTIFU_VERSION \
"SOUTIFU V1.3 inversion for source wavelet correction filter"
"SOUTIFU V1.4 inversion for source wavelet correction filter"
#include <iostream>
#include <fstream>
#include <tfxx/error.h>
#include <tfxx/commandline.h>
#include <tsioxx/inputoperators.h>
#include <tsioxx/outputoperators.h>
#include <datrwxx/readany.h>
#include <datrwxx/writeany.h>
#include <stfinv/stfinvany.h>
......@@ -312,7 +314,7 @@ int main(int iargc, char* argv[])
// create a time series to be used in the output of convolved synthetics
// based on the input synthetics; copy trace header
Tfile::Ttracevector::Ttimeseries cstseries(rdtseries.shape());
cstseries.Mtraceindex=sdtseries.Mtraceindex;
cstseries.settraceindex(sdtseries.traceindex());
cstseries.header=sdtseries.header;
// place reference in a waveform triple
......@@ -436,7 +438,7 @@ int main(int iargc, char* argv[])
// create a time series to be used in the output of convolved synthetics
// based on the input synthetics; copy trace header
Tfile::Ttracevector::Ttimeseries cstseries(sdtseries.shape());
cstseries.Mtraceindex=sdtseries.Mtraceindex;
cstseries.settraceindex(sdtseries.traceindex());
cstseries.header=sdtseries.header;
// place reference in a waveform triple
......@@ -496,9 +498,7 @@ int main(int iargc, char* argv[])
os << stffile.fileheader.srce();
for (unsigned int itrace=0; itrace<stffile.size(); ++itrace)
{
os << stffile[itrace].header.wid2();
os << stffile[itrace].header.info();
os << stffile[itrace].series();
os << stffile[itrace];
}
} // if (opt.writestf)
......@@ -522,9 +522,7 @@ int main(int iargc, char* argv[])
os << convolvedsynthetics.fileheader.srce();
for (unsigned int itrace=0; itrace<convolvedsynthetics.size(); ++itrace)
{
os << convolvedsynthetics[itrace].header.wid2();
os << convolvedsynthetics[itrace].header.info();
os << convolvedsynthetics[itrace].series();
os << convolvedsynthetics[itrace];
}
} // if (opt.writeconvolved)
......@@ -548,9 +546,7 @@ int main(int iargc, char* argv[])
os << convolvedseries.fileheader.srce();
for (unsigned int itrace=0; itrace<convolvedseries.size(); ++itrace)
{
os << convolvedseries[itrace].header.wid2();
os << convolvedseries[itrace].header.info();
os << convolvedseries[itrace].series();
os << convolvedseries[itrace];
}
} // if (opt.additionalpairs)
......
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