{
CoreApplication a(argc, argv, help);
MagnetoTelluricReader reader;
if(reader.setOptions(argc, argv) && reader.read(argc, argv) ) {
return 0;
} else {
return 2;
}
#if 0
CoreApplication a(argc, argv, help);
int i, j=1;
for(i=1; i<argc; i++) {
QByteArray arg=argv[i];
if(arg[0]=='-') {
if(arg=="<long option>" || arg=="<short option>") {
CoreApplication::checkOptionArg(i, argc, argv);
} else {
App::stream() << tr("gpmt: bad option %1, see -help").arg(argv[i]) << endl;
return 2;
}
} else {
argv[j++]=argv[i];
}
}
if(j < argc) {
argv[j]=0;
argc=j;
}
gplib::C1DMTSynthData m;
std::vector<double> r, h, f;
r.push_back(100);
r.push_back(10);
r.push_back(200);
m.SetResistivities(r);
h.push_back(0.020);
h.push_back(0.010);
h.push_back(0.0);
m.SetThicknesses(h);
double f0=1000.0;
double af=pow(0.01,1.0/16.0);
for(int i=0; i<16; i++) {
f.push_back(f0);
f0/=af;
}
m.SetFrequencies(f);
m.GetData();
m.WriteAsMtt("toto");
for(int i=0; i<16; i++) {
App::stream() << m.GetFrequencies().at(i) << " " <<
m.at(i).GetRhoxy() << " " <<
m.at(i).GetPhixy() << endl;
}
MagnetoTelluricCurve c;
c.resize(16);
f0=1000.0;
for(int i=0; i<16; i++) {
c[i].setX(f0);
f0/=af;
}
MagnetoTelluricFactory fac;
fac.setX(c);
fac.linkX(c);
fac.setAngularFrequency();
Profile resistivies;
resistivies.resize(3);
resistivies.setDepth(0, 20);
resistivies.setDepth(1, 30);
resistivies.setDepth(2, 1e99);
resistivies.setValue(0, 100);
resistivies.setValue(1, 10);
resistivies.setValue(2, 200);
fac.calculate(resistivies);
MagnetoTelluricPointOptions co(MagnetoTelluricPointOptions::ApparentResistivity);
QTextStream sout(stdout);
fac.toStream(sout, co);
#endif
}