GPLIB++
|
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>
Public Member Functions | |
virtual C1DRecObjective * | clone () 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) | |
C1DRecObjective & | operator= (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) | |
PlottableObjective & | operator= (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 tmisfit & | GetMisfit () |
Return the misfit vector. More... | |
const tdata & | GetSynthData () |
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) | |
GeneralObjective & | operator= (const GeneralObjective &source) |
virtual | ~GeneralObjective () |
Protected Member Functions | |
const SeismicDataComp & | GetObservedData () |
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) |
tmisfit & | SetMisfit () |
Only derived classes can write access the Misfit. More... | |
void | SetMisfit (const tmisfit &LocalMisfit) |
tdata & | SetSynthData () |
Only derived classes can write access the Synthetic data. More... | |
void | SetSynthData (const tdata &LocalSynthData) |
Friends | |
class | AbsVelRecObjective |
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.
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.
TheRecData | Shared pointer to the measured receiver function |
myshift | the time shift used for calculating the measured receiver function |
mysigma | sigma used for calculating the measured receiver function |
myc | water level used for calculating the measured receiver function |
myslowness | slowness used for calculating the measured receiver function |
method | The method used to calculate the observed data. Can be specdiv or iterdecon |
normalized | Is the measured data normalized to an initial correlation peak of 1 |
InWave | Is 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().
|
virtual |
Definition at line 45 of file C1DRecObjective.cpp.
|
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().
|
inlineprotected |
Definition at line 49 of file C1DRecObjective.h.
C1DRecObjective & gplib::C1DRecObjective::operator= | ( | const C1DRecObjective & | source | ) |
Definition at line 77 of file C1DRecObjective.cpp.
References gplib::PlottableObjective::operator=().
Referenced by gplib::AbsVelRecObjective::operator=().
|
virtual |
We also clean up files serially.
Implements gplib::GeneralObjective.
Reimplemented in gplib::AbsVelRecObjective.
Definition at line 118 of file C1DRecObjective.cpp.
References gplib::GeneralObjective::CalcMisfit(), gplib::SeismicDataComp::CopyHeader(), gplib::TimeSeriesComponent::GetData(), gplib::GeneralObjective::GetFitExponent(), gplib::GeneralObjective::GetParallelID(), gplib::GeneralObjective::GetRMS(), gplib::GeneralObjective::SetMisfit(), gplib::GeneralObjective::SetRMS(), gplib::GeneralObjective::SetSynthData(), and gplib::RecCalc::SynthPostParallel().
Referenced by gplib::AbsVelRecObjective::PostParallel().
|
virtual |
We have to write runfiles before parallel execution.
Reimplemented from gplib::GeneralObjective.
Definition at line 95 of file C1DRecObjective.cpp.
References gplib::CollapseModel(), gplib::GeneralObjective::GetParallelID(), gplib::SeismicModel::Init(), gplib::SeismicModel::SetDensity(), gplib::SeismicModel::SetDt(), gplib::SeismicModel::SetNpts(), gplib::SeismicModel::SetPVelocity(), gplib::ResPkModel::SetSlowness(), gplib::SeismicModel::SetSVelocity(), gplib::SeismicModel::SetThickness(), and gplib::RecCalc::SynthPreParallel().
|
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().
|
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().
|
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.
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.
|
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().
|
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().
|
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().
|
friend |
Definition at line 116 of file C1DRecObjective.h.