8 #include <boost/bind.hpp>
13 #include "NetCDFTools.h"
15 #include "C1dInvGaConf.h"
21 Configuration.GetData(
"1dinvga.conf");
24 cout <<
"Data name base: ";
26 MTData.GetData(datanamebase +
".mtt");
29 SetupFitParameters(Configuration, MTObjective);
32 cout <<
"Model name base: ";
34 C1DMTSynthData MTModel;
35 MTModel.readmodel(modelnamebase +
"_mt.mod");
37 gplib::rvec MTModelVector(2 * MTModel.GetThicknesses().size());
38 for (
int i = 0; i < MTModel.GetThicknesses().size(); ++i)
40 MTModelVector(i) = log10(MTModel.GetResistivities().at(i));
41 MTModelVector(i + MTModel.GetThicknesses().size())
42 = MTModel.GetThicknesses().at(i);
45 double MTOldRMS = MTObjective.CalcPerformance(MTModelVector);
46 cout <<
"RMS: " << MTOldRMS << endl;
47 gplib::rvec OldData(MTObjective.GetSynthData());
50 MTAnalyser.SetModel(MTModelVector);
51 ofstream evals(
"mtevals.plot");
52 for (
int i = 0; i < MTAnalyser.GetSingularValues().size(); ++i)
53 evals << i <<
" " << MTAnalyser.GetSingularValues()(i) << endl;
54 cout <<
"MT Singular Values : " << MTAnalyser.GetSingularValues() << endl;
55 cout <<
"Relative SVD Threshold: ";
56 double svdthreshold = 0.0;
59 MTAnalyser.SetRelativeSVDThreshold(svdthreshold);
61 gplib::rmat DataCovar(2 * MTData.GetMTData().size(), 2
62 * MTData.GetMTData().size());
63 fill_n(DataCovar.data().begin(), DataCovar.size1() * DataCovar.size2(), 0.0);
64 const size_t length = MTData.GetMTData().size();
65 for (
int i = 0; i < length; ++i)
67 DataCovar(i, i) = MTData.GetMTData().at(i).GetdBerd()
68 * MTData.GetMTData().at(i).GetdBerd();
69 DataCovar(i + length, i + length) = MTData.GetMTData().at(i).GetdBerd()
70 * MTData.GetMTData().at(i).GetdBerd();
72 gplib::rmat ModelCovar = MTAnalyser.GetModelCovariance(DataCovar);
73 WriteMatrixAsNetCDF(
"mtcovar.nc", ModelCovar);
74 WriteMatrixAsNetCDF(
"mtsens.nc", MTAnalyser.GetSensitivityMatrix());
75 ofstream mterrors(
"mterrors");
76 for (
int i = 0; i < MTModel.GetThicknesses().size(); ++i)
79 mterrors << sqrt(ModelCovar(i, i)) << endl;
81 for (
int i = MTModel.GetThicknesses().size(); i < 2
82 * MTModel.GetThicknesses().size(); ++i)
83 mterrors << sqrt(ModelCovar(i, i)) << endl;
boost::shared_ptr< PlottableObjective > MTObjective
The class ModelAnalysis is used to calculate resolution matrix, nullspace and other parameters for mo...
CLevanisoConf Configuration