Commit 62a283c1 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: 2233
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent d89117fa
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: noisymize.cc,v 1.7 2007-03-02 11:26:47 tforb Exp $
* $Id: noisymize.cc,v 1.8 2007-03-02 11:55:28 tforb Exp $
* \author Thomas Forbriger
* \date 27/06/2006
*
......@@ -16,13 +16,14 @@
* - 11/07/2006 V1.1 keep result of full convolution length
* - 26/02/2007 V1.2 report factors
* - 02/03/2007 V1.3 scale with offset
* V1.4 special scaling for horizontal component
*
* ============================================================================
*/
#define NOISYMIZE_VERSION \
"NOISYMIZE V1.3 program reads a set of SFF traces, convolves them with white noise and stacks"
"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.7 2007-03-02 11:26:47 tforb Exp $"
"$Id: noisymize.cc,v 1.8 2007-03-02 11:55:28 tforb Exp $"
#include <fstream>
#include <iostream>
......@@ -276,6 +277,11 @@ int main(int iargc, char* argv[])
TFXX_assert((offerr < 1.e-4),
"ERROR: offset of R- and Z-component are inconsistent!");
fac(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
if (opt.verbose) { cout << "*"; cout.flush(); }
Tseries noise=ts::rnd::dugauss(opt.noiselength);
......@@ -286,9 +292,9 @@ int main(int iargc, char* argv[])
{ Zseries += fac(itrace)*ts::convolve(*Zit, noise); }
if (opt.verbose) { cout << "+"; cout.flush(); }
if (initialize_result)
{ Rseries = fac(itrace)*ts::convolve(*Rit, noise); }
{ Rseries = Hfactor*fac(itrace)*ts::convolve(*Rit, noise); }
else
{ Rseries += fac(itrace)*ts::convolve(*Rit, noise); }
{ Rseries += Hfactor*fac(itrace)*ts::convolve(*Rit, noise); }
initialize_result=false;
++Zit;
++Rit;
......
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