Commit 144ae0f5 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

proceeding

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 2234
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 62a283c1
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: noisymize.cc,v 1.8 2007-03-02 11:55:28 tforb Exp $
* $Id: noisymize.cc,v 1.9 2007-03-02 11:59:05 tforb Exp $
* \author Thomas Forbriger
* \date 27/06/2006
*
......@@ -23,7 +23,7 @@
#define NOISYMIZE_VERSION \
"NOISYMIZE V1.4 program reads a set of SFF traces, convolves them with white noise and stacks"
#define NOISYMIZE_CVSID \
"$Id: noisymize.cc,v 1.8 2007-03-02 11:55:28 tforb Exp $"
"$Id: noisymize.cc,v 1.9 2007-03-02 11:59:05 tforb Exp $"
#include <fstream>
#include <iostream>
......@@ -251,6 +251,8 @@ int main(int iargc, char* argv[])
Tseries Zseries, Rseries;
// scaling factors
Tseries fac=ts::rnd::dugauss(Zindata.size());
Tseries offfac(Zindata.size());
Tseries traceoffset(Zindata.size());
//
if (!opt.setnoiselength)
{
......@@ -276,25 +278,27 @@ int main(int iargc, char* argv[])
if (offerr < 0.) { offerr=-offerr; }
TFXX_assert((offerr < 1.e-4),
"ERROR: offset of R- and Z-component are inconsistent!");
fac(itrace) *= std::pow(Zoffset, opt.offexp);
traceoffset(itrace)=Zoffset;
offfac(itrace)=std::pow(Zoffset, opt.offexp);
// scaling factor for radial component, since we see only the projection
// of the radial component of all sources on the respective horizonzal
// component
// Hfactor = (int_0^{2*pi} abs(cos(phi)) d phi) / (2 pi)
const double Hfactor=2./M_PI;
// go
double scalefac=fac(itrace)*offfac(itrace);
if (opt.verbose) { cout << "*"; cout.flush(); }
Tseries noise=ts::rnd::dugauss(opt.noiselength);
if (opt.verbose) { cout << "+"; cout.flush(); }
if (initialize_result)
{ Zseries = fac(itrace)*ts::convolve(*Zit, noise); }
{ Zseries = scalefac*ts::convolve(*Zit, noise); }
else
{ Zseries += fac(itrace)*ts::convolve(*Zit, noise); }
{ Zseries += scalefac*ts::convolve(*Zit, noise); }
if (opt.verbose) { cout << "+"; cout.flush(); }
if (initialize_result)
{ Rseries = Hfactor*fac(itrace)*ts::convolve(*Rit, noise); }
{ Rseries = Hfactor*scalefac*ts::convolve(*Rit, noise); }
else
{ Rseries += Hfactor*fac(itrace)*ts::convolve(*Rit, noise); }
{ Rseries += Hfactor*scalefac*ts::convolve(*Rit, noise); }
initialize_result=false;
++Zit;
++Rit;
......@@ -306,7 +310,11 @@ int main(int iargc, char* argv[])
cout << "factors used for scaling:" << endl;
for (itrace=0; itrace<Zindata.size(); itrace++)
{
cout << "trace #" << itrace << ": " << fac(itrace) << endl;
cout << "trace #" << itrace << ": "
<< fac(itrace) << ", "
<< offfac(itrace) << ", "
<< traceoffset(itrace) << "m"
<< endl;
}
}
......
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