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

ts/wf [WP]: let programs explicitly express type conversion

parent a5316401
...@@ -177,7 +177,8 @@ int main(int iargc, char* argv[]) ...@@ -177,7 +177,8 @@ int main(int iargc, char* argv[])
sff::INFO info; sff::INFO info;
is >> info; is >> info;
if (opt.verbose) { cout << data.header.line() << endl; } if (opt.verbose) { cout << data.header.line() << endl; }
Tts result(ts::correlate(data,data)); Tts result;
result=ts::correlate(data,data);
result /= Tts::Tvalue(data.size()); result /= Tts::Tvalue(data.size());
result.header=data.header; result.header=data.header;
result.header.auxid="corr"; result.header.auxid="corr";
......
...@@ -368,21 +368,20 @@ int main(int iargc, char* argv[]) ...@@ -368,21 +368,20 @@ int main(int iargc, char* argv[])
if (opt.verbose) if (opt.verbose)
{ cout << "prepare output data" << endl; } { cout << "prepare output data" << endl; }
typedef ts::sff::SFFTimeSeries<Tseries> Tsffseries; typedef ts::sff::SFFTimeSeries<Tseries> Tsffseries;
Tsffseries Zoutdata(Zseries), Routdata(Rseries);
Tsffseries::Theader Zheader(Zindata[0].header); Tsffseries::Theader Zheader(Zindata[0].header);
Tsffseries::Theader Rheader(Rindata[0].header); Tsffseries::Theader Rheader(Rindata[0].header);
sff::WID2 wid2line=Zheader.wid2(); sff::WID2 wid2line=Zheader.wid2();
wid2line.nsamples=Zoutdata.size(); wid2line.nsamples=Zseries.size();
wid2line.channel="Z"; wid2line.channel="Z";
Zheader.wid2(wid2line); Zheader.wid2(wid2line);
Zoutdata.header=Zheader; Tsffseries Zoutdata(Zseries, Zheader);;
wid2line=Rheader.wid2(); wid2line=Rheader.wid2();
wid2line.nsamples=Routdata.size(); wid2line.nsamples=Rseries.size();
wid2line.channel="R"; wid2line.channel="R";
Rheader.wid2(wid2line); Rheader.wid2(wid2line);
Routdata.header=Rheader; Tsffseries Routdata(Rseries, Rheader);;
{ {
if (opt.verbose) { cout << "open output file " << filename.Zout << endl; } if (opt.verbose) { cout << "open output file " << filename.Zout << endl; }
......
...@@ -313,9 +313,9 @@ int main(int iargc, char* argv[]) ...@@ -313,9 +313,9 @@ int main(int iargc, char* argv[])
// create a time series to be used in the output of convolved synthetics // create a time series to be used in the output of convolved synthetics
// based on the input synthetics; copy trace header // based on the input synthetics; copy trace header
Tfile::Ttracevector::Ttimeseries cstseries(rdtseries.shape()); Tfile::Ttracevector::Ttimeseries
cstseries.settraceindex(sdtseries.traceindex()); cstseries(Tfile::Ttracevector::Ttimeseries::Tseries(sdtseries.shape()),
cstseries.header=sdtseries.header; sdtseries.header, sdtseries.traceindex());
// place reference in a waveform triple // place reference in a waveform triple
stfinv::WaveformTriple tracetriple; stfinv::WaveformTriple tracetriple;
...@@ -386,7 +386,9 @@ int main(int iargc, char* argv[]) ...@@ -386,7 +386,9 @@ int main(int iargc, char* argv[])
// catch values for stf waveform // catch values for stf waveform
if (itrace==0) if (itrace==0)
{ {
Tfile::Ttracevector::Ttimeseries stftseries(tracetriple.data.shape()); Tfile::Ttracevector::Ttimeseries stftseries;
stftseries
=Tfile::Ttracevector::Ttimeseries::Tseries(tracetriple.data.shape());
stfwaveform.sampling.dt=tracetriple.header.sampling.dt; stfwaveform.sampling.dt=tracetriple.header.sampling.dt;
stfwaveform.sampling.n=tracetriple.header.sampling.n; stfwaveform.sampling.n=tracetriple.header.sampling.n;
...@@ -437,9 +439,9 @@ int main(int iargc, char* argv[]) ...@@ -437,9 +439,9 @@ int main(int iargc, char* argv[])
// create a time series to be used in the output of convolved synthetics // create a time series to be used in the output of convolved synthetics
// based on the input synthetics; copy trace header // based on the input synthetics; copy trace header
Tfile::Ttracevector::Ttimeseries cstseries(sdtseries.shape()); Tfile::Ttracevector::Ttimeseries
cstseries.settraceindex(sdtseries.traceindex()); cstseries(Tfile::Ttracevector::Ttimeseries::Tseries(sdtseries.shape()),
cstseries.header=sdtseries.header; sdtseries.header, sdtseries.traceindex());
// place reference in a waveform triple // place reference in a waveform triple
stfinv::WaveformPair tracepair; stfinv::WaveformPair tracepair;
......
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