RecCalc.h

Go to the documentation of this file.
00001 #ifndef CRECFUNC_H
00002 #define CRECFUNC_H
00003 #include "SeismicDataComp.h"
00004 #include "ResPkModel.h"
00005 #include "TsSpectrum.h"
00006 #include <string>
00007 
00008 namespace gplib
00009   {
00010     /** \addtogroup seistools Seismic data analysis and modeling */
00011     /* @{ */
00012 
00013     //! This class is used to calculate receiver functions from seismic data
00014     class RecCalc
00015       {
00016     public:
00017       //! There are several ways to calculate receiver functions
00018       enum trfmethod
00019         {
00020         specdiv, iterdecon
00021         };
00022     private:
00023       //! The method we want to use to calculate the receiver function
00024       trfmethod method;
00025       //! For spectral division we need an object to calculate spectra
00026       TsSpectrum Spectrum;
00027       //! The waterlevel to fill in spectral holes
00028       double c;
00029       //! The width of the gaussian filter to smooth the receiver functions
00030       double sigma;
00031       //! Shift the data to move the initial correlation peak
00032       int shift;
00033       //! Should the receiver function be normalized to maximum amplitude
00034       bool normalize;
00035       //! The components used for the receiver function calculation
00036       SeismicDataComp RadComp;
00037       SeismicDataComp VerComp;
00038       //! Calculate the receiver function with the spectral division waterlevel method
00039       void SpectralDivision(const SeismicDataComp &RComp,
00040           const SeismicDataComp &VComp, SeismicDataComp &Receiver);
00041       //! Calculate the receiver function by iterative convolution
00042       void IterativeDeconvolution(const SeismicDataComp &RComp,
00043           const SeismicDataComp &VComp, SeismicDataComp &Receiver);
00044     public:
00045       //! Get the radial component, mostly needed for synthetic data
00046       const SeismicDataComp &GetRadComp()
00047         {
00048           return RadComp;
00049         }
00050       const SeismicDataComp &GetVerComp()
00051         {
00052           return VerComp;
00053         }
00054       //! Change whether the output receiver function is normalized to a maximum amplitude of 1
00055       void SetNormalize(const bool what)
00056         {
00057           normalize = what;
00058         }
00059       //! The three Synth*Parallel methods provide alternative acces to the steps in CalcRecSynth for safe parallel execution
00060       void SynthPreParallel(const std::string &filename, ResPkModel &Model,
00061           SeismicDataComp &Receiver, const bool cleanfiles = false);
00062       //! All operations that are safe to execute in parallel
00063       void SynthSafeParallel(const std::string &filename, ResPkModel &Model,
00064           SeismicDataComp &Receiver, const bool cleanfiles = false);
00065       //! Operations of the synthetic receiver function calculation that are not safe in parallel and hafe to be executed after the parallel part
00066       void SynthPostParallel(const std::string &filename, ResPkModel &Model,
00067           SeismicDataComp &Receiver, const bool cleanfiles = false);
00068       //! Calculate Receiver functions from two data components
00069       void CalcRecData(const SeismicDataComp &RadComp,
00070           const SeismicDataComp &VerComp, SeismicDataComp &Receiver);
00071       //! Calculate synthetic receiver funtions from a model
00072       void CalcRecSynth(const std::string &filename, ResPkModel &Model,
00073           SeismicDataComp &Receiver, const bool cleanfiles = false);
00074       RecCalc& operator=(const RecCalc& source);
00075       //! The constructor takes the essential parameters that shouldn't change during different calculations
00076       RecCalc(const int myshift, const double mysigma, const double myc,
00077           const bool multicalc = false, const trfmethod themethod = iterdecon);
00078       RecCalc(const RecCalc &Old);
00079       virtual ~RecCalc();
00080       };
00081   /* @} */
00082   }
00083 #endif // CRECFUNC_H

Generated on Tue May 4 16:52:15 2010 for GPLIB++ by  doxygen 1.5.8