GPLIB++
Public Member Functions | Protected Member Functions | Friends | List of all members
gplib::C1DRecObjective Class Reference

Calculate the misfit between observed receiver function for a given 1D model by calculating a synthetic receiver function from that model. More...

#include <C1DRecObjective.h>

Inheritance diagram for gplib::C1DRecObjective:
Inheritance graph
[legend]

Public Member Functions

virtual C1DRecObjectiveclone () const
 return a pointer to a copy of the current object More...
 
void SetTimeWindow (const double start, const double end)
 Set the time window used for misfit calculations, start and end are in seconds. More...
 
void SetErrorLevel (const double level)
 Set the errorlevel for fit, this is relative to the maximum amplitude, not for each individual data point. More...
 
void SetPoisson (const double ratio)
 Set poisson's ratio, at the moment the same for all layers, used for calculating P-velocity. More...
 
virtual void WriteData (const std::string &filename)
 Write the synthetic data to a sac file with name filename, makes only sense after calculating the misfit. More...
 
void WriteModel (const std::string &filename)
 Write the current model to ascii file for calculations. More...
 
void WritePlot (const std::string &filename)
 Write the current model to ascii file for plotting. More...
 
virtual void PreParallel (const ttranscribed &member)
 We have to write runfiles before parallel execution. More...
 
virtual double PostParallel (const ttranscribed &member)
 We also clean up files serially. More...
 
virtual void SafeParallel (const ttranscribed &member)
 Calculate the misfit between the data calculated from model vector member and measured data given in the constructor. More...
 
 C1DRecObjective (const C1DRecObjective &Old)
 
C1DRecObjectiveoperator= (const C1DRecObjective &source)
 
 C1DRecObjective (boost::shared_ptr< const SeismicDataComp > TheRecData, int myshift, double mysigma, double myc, double myslowness, RecCalc::trfmethod method=RecCalc::specdiv, bool normalized=true, ResPkModel::WaveType InWave=ResPkModel::PWave)
 The constructor needs a few essential parameters. More...
 
virtual ~C1DRecObjective ()
 
- Public Member Functions inherited from gplib::PlottableObjective
 PlottableObjective ()
 
 PlottableObjective (const PlottableObjective &Old)
 
PlottableObjectiveoperator= (const PlottableObjective &source)
 
virtual ~PlottableObjective ()
 
- Public Member Functions inherited from gplib::GeneralObjective
void SetFitExponent (const int x)
 Set the Fit exponent. More...
 
int GetFitExponent ()
 Get the Fit exponent. More...
 
double GetRMS ()
 Get the current RMS. More...
 
const std::string & GetParallelID ()
 Derived classes need to read the ParallelId for their forward calculations. More...
 
void SetParallelID (const std::string &s)
 We need to set the parallel ID outside the Objective function object. More...
 
const tmisfitGetMisfit ()
 Return the misfit vector. More...
 
const tdataGetSynthData ()
 Return the current synthetic data. More...
 
double CalcPerformance (const ttranscribed &member)
 For serial execution CalcPerformance calls the three Parallel functions for more convenient use. More...
 
 GeneralObjective ()
 
 GeneralObjective (const GeneralObjective &Old)
 
GeneralObjectiveoperator= (const GeneralObjective &source)
 
virtual ~GeneralObjective ()
 

Protected Member Functions

const SeismicDataCompGetObservedData ()
 
- Protected Member Functions inherited from gplib::GeneralObjective
double CalcMisfit (const double measured, const double predicted, const double measerror, const double errorlevel, const int index)
 
void SetRMS (const double x)
 
tmisfitSetMisfit ()
 Only derived classes can write access the Misfit. More...
 
void SetMisfit (const tmisfit &LocalMisfit)
 
tdataSetSynthData ()
 Only derived classes can write access the Synthetic data. More...
 
void SetSynthData (const tdata &LocalSynthData)
 

Friends

class AbsVelRecObjective
 

Detailed Description

Calculate the misfit between observed receiver function for a given 1D model by calculating a synthetic receiver function from that model.

The constructor takes a few essential parameters that are expected not to change during the program (in most cases inversion), e.g. the data to fit. See also C1DRecObjective for the necessary constructor parameters.

There are two ways to calculate the Misfit for a given model, either calling GeneralObjective::CalcPerformance, or, for parallel programs, calling the three function PreParallel, SafeParallel and PostParallel in that order. In both cases you have to give the parameter #member, which is a ttranscribed of size 2n, where n is the number of layers of the model. The first n entries are the layer thicknesses in km and the last n entries are the S-wave velocities in km/s. Densities and P-Wave velocities are calculated from S-Velocities by hard-coded relationships.

Definition at line 22 of file C1DRecObjective.h.

Constructor & Destructor Documentation

gplib::C1DRecObjective::C1DRecObjective ( const C1DRecObjective Old)

Definition at line 49 of file C1DRecObjective.cpp.

Referenced by clone().

gplib::C1DRecObjective::C1DRecObjective ( boost::shared_ptr< const SeismicDataComp TheRecData,
int  myshift,
double  mysigma,
double  myc,
double  myslowness,
RecCalc::trfmethod  method = RecCalc::specdiv,
bool  normalized = true,
ResPkModel::WaveType  InWave = ResPkModel::PWave 
)

The constructor needs a few essential parameters.

Parameters
TheRecDataShared pointer to the measured receiver function
myshiftthe time shift used for calculating the measured receiver function
mysigmasigma used for calculating the measured receiver function
mycwater level used for calculating the measured receiver function
myslownessslowness used for calculating the measured receiver function
methodThe method used to calculate the observed data. Can be specdiv or iterdecon
normalizedIs the measured data normalized to an initial correlation peak of 1
InWaveIs the incoming plane wave a p-wave or a s-wave

Definition at line 18 of file C1DRecObjective.cpp.

References SetErrorLevel(), gplib::ResPkModel::SetInputWave(), and gplib::RecCalc::SetNormalize().

gplib::C1DRecObjective::~C1DRecObjective ( )
virtual

Definition at line 45 of file C1DRecObjective.cpp.

Member Function Documentation

virtual C1DRecObjective* gplib::C1DRecObjective::clone ( ) const
inlinevirtual

return a pointer to a copy of the current object

Implements gplib::GeneralObjective.

Reimplemented in gplib::AbsVelRecObjective.

Definition at line 55 of file C1DRecObjective.h.

References C1DRecObjective().

const SeismicDataComp& gplib::C1DRecObjective::GetObservedData ( )
inlineprotected

Definition at line 49 of file C1DRecObjective.h.

C1DRecObjective & gplib::C1DRecObjective::operator= ( const C1DRecObjective source)
double gplib::C1DRecObjective::PostParallel ( const ttranscribed member)
virtual
void gplib::C1DRecObjective::PreParallel ( const ttranscribed member)
virtual
void gplib::C1DRecObjective::SafeParallel ( const ttranscribed member)
virtual

Calculate the misfit between the data calculated from model vector member and measured data given in the constructor.

Reimplemented from gplib::GeneralObjective.

Definition at line 140 of file C1DRecObjective.cpp.

References gplib::GeneralObjective::GetParallelID(), and gplib::RecCalc::SynthSafeParallel().

void gplib::C1DRecObjective::SetErrorLevel ( const double  level)
inline

Set the errorlevel for fit, this is relative to the maximum amplitude, not for each individual data point.

Definition at line 62 of file C1DRecObjective.h.

Referenced by C1DRecObjective(), init(), and main().

void gplib::C1DRecObjective::SetPoisson ( const double  ratio)
inline

Set poisson's ratio, at the moment the same for all layers, used for calculating P-velocity.

Definition at line 73 of file C1DRecObjective.h.

Referenced by init(), and main().

void gplib::C1DRecObjective::SetTimeWindow ( const double  start,
const double  end 
)

Set the time window used for misfit calculations, start and end are in seconds.

Definition at line 57 of file C1DRecObjective.cpp.

Referenced by init(), and main().

virtual void gplib::C1DRecObjective::WriteData ( const std::string &  filename)
inlinevirtual

Write the synthetic data to a sac file with name filename, makes only sense after calculating the misfit.

Reimplemented from gplib::PlottableObjective.

Reimplemented in gplib::AbsVelRecObjective.

Definition at line 78 of file C1DRecObjective.h.

References gplib::SeismicDataComp::WriteAsSac().

Referenced by gplib::AbsVelRecObjective::WriteData().

void gplib::C1DRecObjective::WriteModel ( const std::string &  filename)
inlinevirtual

Write the current model to ascii file for calculations.

Reimplemented from gplib::PlottableObjective.

Definition at line 83 of file C1DRecObjective.h.

References gplib::ResPkModel::WriteModel().

Referenced by main().

void gplib::C1DRecObjective::WritePlot ( const std::string &  filename)
inlinevirtual

Write the current model to ascii file for plotting.

Reimplemented from gplib::PlottableObjective.

Definition at line 88 of file C1DRecObjective.h.

References gplib::SeismicModel::WritePlot().

Referenced by main().

Friends And Related Function Documentation

friend class AbsVelRecObjective
friend

Definition at line 116 of file C1DRecObjective.h.


The documentation for this class was generated from the following files: