GPLIB++
MTFitSetup.h
Go to the documentation of this file.
1 #ifndef MTFITSETUP_H_
2 #define MTFITSETUP_H_
3 #include "C1DMTObjective.h"
4 #include "Adaptors.h"
5 namespace gplib
6  {
7  template<typename tConfObject>
8  void SetupMTFitParameters(const tConfObject &Configuration,
9  C1DMTObjective &Objective)
10  {
11  if (Configuration.mode == "xy")
12  {
13  if (Configuration.mtfit == "phase")
15  &MTTensor::GetdPhixy, Configuration.phaseerror);
16  if (Configuration.mtfit == "appres")
18  &MTTensor::GetdRhoxy, Configuration.reserror);
19  if (Configuration.mtfit == "resphase")
20  {
22  &MTTensor::GetdRhoxy, Configuration.reserror);
24  &MTTensor::GetdPhixy, Configuration.phaseerror);
25  }
26  }
27  else
28  {
29  if (Configuration.mtfit == "phase")
31  &MTTensor::GetdPhiyx, Configuration.phaseerror);
32  if (Configuration.mtfit == "appres")
34  &MTTensor::GetdRhoyx, Configuration.reserror);
35  if (Configuration.mtfit == "resphase")
36  {
38  &MTTensor::GetdRhoyx, Configuration.reserror);
40  &MTTensor::GetdPhiyx, Configuration.phaseerror);
41  }
42  }
43  if (Configuration.mtfit == "berd")
44  {
45  Objective.AppendFitParameters(boost::bind(gplib::real(),
46  boost::bind(&MTTensor::GetBerd, _1)), &MTTensor::GetdBerd,
47  Configuration.tensorerror);
48  Objective.AppendFitParameters(boost::bind(gplib::imag(),
49  boost::bind(&MTTensor::GetBerd, _1)), &MTTensor::GetdBerd,
50  Configuration.tensorerror);
51  }
52  if (Configuration.mtfit == "det")
53  {
54  Objective.AppendFitParameters(boost::bind(gplib::real(),
55  boost::bind(&MTTensor::GetDet, _1)), &MTTensor::GetdDet,
56  Configuration.tensorerror);
57  Objective.AppendFitParameters(boost::bind(gplib::imag(),
58  boost::bind(&MTTensor::GetDet, _1)), &MTTensor::GetdDet,
59  Configuration.tensorerror);
60  }
61  if (Configuration.mtfit == "all")
62  {
64  &MTTensor::GetdRhoxx, Configuration.reserror);
66  &MTTensor::GetdPhixx, Configuration.phaseerror);
68  &MTTensor::GetdRhoxy, Configuration.reserror);
70  &MTTensor::GetdPhixy, Configuration.phaseerror);
72  &MTTensor::GetdRhoyx, Configuration.reserror);
74  &MTTensor::GetdPhiyx, Configuration.phaseerror);
76  &MTTensor::GetdRhoyy, Configuration.reserror);
78  &MTTensor::GetdPhiyy, Configuration.phaseerror);
79  }
80  if (Configuration.mtfit == "allphase")
81  {
83  &MTTensor::GetdPhixx, Configuration.phaseerror);
85  &MTTensor::GetdPhixy, Configuration.phaseerror);
87  &MTTensor::GetdPhiyx, Configuration.phaseerror);
89  &MTTensor::GetdPhiyy, Configuration.phaseerror);
90  }
91  if (Configuration.mtfit == "offdphase")
92  {
94  &MTTensor::GetdPhixy, Configuration.phaseerror);
96  &MTTensor::GetdPhiyx, Configuration.phaseerror);
98  &MTTensor::GetdZero, Configuration.phaseerror);
99  }
100  if (Configuration.mtfit == "ptensor")
101  {
103  &MTTensor::GetdZero, Configuration.phaseerror);
105  &MTTensor::GetdZero, Configuration.phaseerror);
107  &MTTensor::GetdZero, Configuration.phaseerror);
109  &MTTensor::GetdZero, Configuration.phaseerror);
110  }
111  if (Configuration.mtfit == "ptellip")
112  {
114  &MTTensor::GetdZero, Configuration.phaseerror);
116  &MTTensor::GetdZero, Configuration.phaseerror);
118  &MTTensor::GetdZero, Configuration.phaseerror);
120  &MTTensor::GetdZero, Configuration.phaseerror);
121  }
122  }
123  }
124 #endif /*MTFITSETUP_H_*/
void AppendFitParameters(const datafunc_t TheDataFunc, const datafunc_t TheErrorFunc, const double TheErrLevel)
void SetupMTFitParameters(const tConfObject &Configuration, C1DMTObjective &Objective)
Definition: MTFitSetup.h:8
double GetPhi11() const
All the following quantities are defined in Caldwell GJI 158, 457-469, the phase tensor elements...
Definition: MTTensor.h:422
double GetdBerd() const
The error of the Berdichevskyi invariant.
Definition: MTTensor.h:327
std::complex< double > GetDet() const
The determinant.
Definition: MTTensor.h:348
double GetPhi21() const
Definition: MTTensor.h:438
double GetPhixy() const
Definition: MTTensor.h:207
double GetPhiyx() const
Definition: MTTensor.h:211
double GetPhi12() const
Definition: MTTensor.h:430
double GetdRhoxx() const
Return Rho Error for tensor elements.
Definition: MTTensor.h:237
double GetdRhoxy() const
Definition: MTTensor.h:241
double GetPhiyy() const
Definition: MTTensor.h:215
double GetRhoyy() const
Definition: MTTensor.h:198
double GetPhi22() const
Definition: MTTensor.h:446
double GetAlpha_phi() const
Definition: MTTensor.h:454
double GetAlpha() const
Definition: MTTensor.h:393
double GetRhoxy() const
Definition: MTTensor.h:190
double GetRhoyx() const
Definition: MTTensor.h:194
double GetdPhixx() const
return phase error for tensor elements
Definition: MTTensor.h:254
std::complex< double > GetBerd() const
The Berdichevskyi invariant.
Definition: MTTensor.h:322
double GetdRhoyx() const
Definition: MTTensor.h:245
double GetdPhiyx() const
Definition: MTTensor.h:262
double GetdDet() const
The error of the determinant.
Definition: MTTensor.h:353
double GetRhoxx() const
Return apparent resistivity.
Definition: MTTensor.h:186
double GetdPhixy() const
Definition: MTTensor.h:258
CLevanisoConf Configuration
Definition: cadianiso.cpp:17
double GetPhixx() const
Return phase.
Definition: MTTensor.h:203
double GetBeta_phi() const
Definition: MTTensor.h:462
C1DMTObjective is the base class for MT misfit calculations from 1D models, it provides common functi...
double GetdZero() const
Function for Errors that cannot be calculated analytically when we don't want Jacknife errors...
Definition: MTTensor.h:88
double GetPhiMin() const
Definition: MTTensor.h:485
double GetPhiMax() const
Definition: MTTensor.h:481
double GetdPhiyy() const
Definition: MTTensor.h:266
double GetdRhoyy() const
Definition: MTTensor.h:249