10 #include <boost/program_options.hpp>
11 #include "VectorOptions.h"
16 using namespace boost::program_options;
29 DummyVec<double> Test;
31 options_description desc(
"Joint inversion options");
32 desc.add_options()(
"outputbase", value<std::string> (&outputbase),
33 "The start of the name of the output files")(
"verbose", value(
34 &verbose)->default_value(
false),
"")(
"ptensordata", value(
35 &ptensordata),
"The name of a file containing phase tensor MT data")
37 (
"conddiffweight", value(&conddiffweight),
38 "The weight for regularizing the difference in conductivity between layers")(
39 "anisotropyweight", value(&anisotropyweight),
40 "The weight for regularizing the anisotropy")(
"strikediffweight",
41 value(&strikediffweight),
42 "The weight for regularizing the difference in strike between layers")(
43 "veldiffweight", value(&veldiffweight),
44 "The weight for regularizing the difference in velocity")(
45 "anisovelweight", value(&anisovelweight),
46 "The weight for regularizing the anisotropy of the velocity")(
47 "deltastrikediffweight", value(&deltastrikediffweight),
48 "The weight for regularizing the difference in strike between MT and seismics")(
49 "avelratio", value(&avelratio),
"")(
"thickstep", value<DummyVec<
50 double> > (),
"")(
"resstep", value<DummyVec<double> > (),
"")(
51 "velstep", value<DummyVec<double> > (),
"")(
"aresstep", value<
52 DummyVec<double> > (),
"")(
"avelstep", value<DummyVec<double> > (),
53 "")(
"strikestep", value<DummyVec<double> > (),
"")(
"dstrikestep",
54 value<DummyVec<double> > (),
"")(
"thickstep", value<
55 DummyVec<double> > (),
"")(
"thickbase",
56 value<DummyVec<double> > (),
"")(
"resbase",
57 value<DummyVec<double> > (),
"")(
"velbase",
58 value<DummyVec<double> > (),
"")(
"aresbase",
59 value<DummyVec<double> > (),
"")(
"avelbase",
60 value<DummyVec<double> > (),
"")(
"strikebase", value<DummyVec<
61 double> > (),
"")(
"dstrikebase", value<DummyVec<double> > (),
"")(
62 "thicksizes", value<DummyVec<int> > (),
"")(
"ressizes", value<
63 DummyVec<int> > (),
"")(
"velsizes", value<DummyVec<int> > (),
"")(
64 "aressizes", value<DummyVec<int> > (),
"")(
"avelsizes", value<
65 DummyVec<int> > (),
"")(
"strikesizes", value<DummyVec<int> > (),
"")(
66 "dstrikesizes", value<DummyVec<int> > (),
"")(
"weights", value<
67 DummyVec<double> > (),
"");
70 store(parse_config_file(instream, desc,
true), vm);
73 if (vm.count(
"thickbase"))
75 thickbase = vm[
"thickbase"].as<DummyVec<double> > ().VecVal;
77 if (vm.count(
"thickstep"))
79 thickstep = vm[
"thickstep"].as<DummyVec<double> > ().VecVal;
81 if (vm.count(
"thicksizes"))
83 thicksizes = vm[
"thicksize"].as<DummyVec<int> > ().VecVal;
86 if (vm.count(
"resbase"))
88 resbase = vm[
"resbase"].as<DummyVec<double> > ().VecVal;
90 if (vm.count(
"resstep"))
92 resstep = vm[
"resstep"].as<DummyVec<double> > ().VecVal;
94 if (vm.count(
"ressizes"))
96 ressizes = vm[
"ressizes"].as<DummyVec<int> > ().VecVal;
99 if (vm.count(
"velbase"))
101 velbase = vm[
"velbase"].as<DummyVec<double> > ().VecVal;
103 if (vm.count(
"velstep"))
105 velstep = vm[
"velstep"].as<DummyVec<double> > ().VecVal;
107 if (vm.count(
"velsizes"))
109 velsizes = vm[
"velsizes"].as<DummyVec<int> > ().VecVal;
112 if (vm.count(
"aresbase"))
114 aresbase = vm[
"aresbase"].as<DummyVec<double> > ().VecVal;
116 if (vm.count(
"aresstep"))
118 aresstep = vm[
"aresstep"].as<DummyVec<double> > ().VecVal;
120 if (vm.count(
"aressizes"))
122 aressizes = vm[
"aressizes"].as<DummyVec<int> > ().VecVal;
125 if (vm.count(
"avelbase"))
127 avelbase = vm[
"avelbase"].as<DummyVec<double> > ().VecVal;
129 if (vm.count(
"avelstep"))
131 avelstep = vm[
"avelstep"].as<DummyVec<double> > ().VecVal;
133 if (vm.count(
"avelsizes"))
135 avelsizes = vm[
"avelsizes"].as<DummyVec<int> > ().VecVal;
138 if (vm.count(
"strikebase"))
140 strikebase = vm[
"strikebase"].as<DummyVec<double> > ().VecVal;
142 if (vm.count(
"strikestep"))
144 strikestep = vm[
"strikestep"].as<DummyVec<double> > ().VecVal;
146 if (vm.count(
"strikesizes"))
148 strikesizes = vm[
"strikesizes"].as<DummyVec<int> > ().VecVal;
151 if (vm.count(
"dstrikebase"))
153 dstrikebase = vm[
"dstrikebase"].as<DummyVec<double> > ().VecVal;
155 if (vm.count(
"dstrikestep"))
157 dstrikestep = vm[
"dstrikestep"].as<DummyVec<double> > ().VecVal;
159 if (vm.count(
"dstrikesizes"))
161 dstrikesizes = vm[
"dstrikesizes"].as<DummyVec<int> > ().VecVal;
163 if (vm.count(
"weights"))
165 weights = vm[
"weights"].as<DummyVec<double> > ().VecVal;
void GetData(std::ifstream &instream)