GPLIB++
PTensor1DMTObjective.h
Go to the documentation of this file.
1 #ifndef PTENSOR1DMTOBJECTIVE_H_
2 #define PTENSOR1DMTOBJECTIVE_H_
3 
4 #include "C1DAnisoMTSynthData.h"
5 #include "PTensorMTStation.h"
6 #include "PlottableObjective.h"
7 
8 namespace gplib
9  {
10  //! This is a special objective function to fit phase tensor MT data
11  /*! We don't have analytical expression for the error of phase tensor elements yet/
12  * Recalculating them all the time with Jacknife or bootstrap methods is too expensive
13  * so we calculate them once for the measured data, store it in a special file
14  * and use this objective function to read the file and fit this data.
15  */
17  {
18  private:
19  double errorlevel;
20  PTensorMTStation MeasuredData;
21  C1DAnisoMTSynthData AnisoMTSynth;
22  public:
23  //! Set the minimum relative error
24  void SetErrorLevel(const double e)
25  {
26  errorlevel = e;
27  }
28  //! Calc misfit for a model given by member
29  virtual void SafeParallel(const ttranscribed &member);
30  virtual double PostParallel(const ttranscribed &member);
31  //! write the current model to a file
32  virtual void WriteModel(const std::string &filename)
33  {
34  AnisoMTSynth.WriteModel(filename);
35  }
36  //! write the current model for plotting to a file
37  virtual void WritePlot(const std::string &filename)
38  {
39  AnisoMTSynth.WritePlot(filename);
40  }
41  //! Write current data to a file
42  virtual void WriteData(const std::string &filename)
43  {
44  AnisoMTSynth.WriteAsMtt(filename);
45  }
46  virtual PTensor1DMTObjective *clone() const
47  {
48  return new PTensor1DMTObjective(*this);
49  }
50  PTensor1DMTObjective(const PTensorMTStation &LocalMTData);
52  virtual ~PTensor1DMTObjective();
54  };
55  }
56 #endif /*PTENSOR1DMTOBJECTIVE_H_*/
void WritePlot(std::string filename)
ublas::vector< double > ttranscribed
Definition: gentypes.h:21
void WriteModel(std::string filename)
virtual void WriteData(const std::string &filename)
Write current data to a file.
This is a special objective function to fit phase tensor MT data.
This only adds a few plotting functions to GeneralObjective to define a common interface.
virtual void SafeParallel(const ttranscribed &member)
Calc misfit for a model given by member.
virtual void WriteModel(const std::string &filename)
write the current model to a file
Calculate response of a 1D anisotropic model, code is based on Pek and Santos fortran code...
void SetErrorLevel(const double e)
Set the minimum relative error.
virtual void WritePlot(const std::string &filename)
write the current model for plotting to a file
void WriteAsMtt(const std::string filename)
Write data in goettingen .mtt format.
Definition: MTStation.cpp:681
PTensor1DMTObjective & operator=(const PTensor1DMTObjective &source)
virtual double PostParallel(const ttranscribed &member)
Some operations cannot be done in parallel, these are done after, returns the misfit value...
PTensor1DMTObjective(const PTensorMTStation &LocalMTData)
virtual PTensor1DMTObjective * clone() const
We need clone and create for building an array of derived objects, see FAQ lite 20.8, the return type depends on the derived class.