11 using namespace gplib;
22 int main(
int argc,
char* argv[])
27 "$Id: mtt2ptensor.cpp 1849 2010-05-07 11:53:45Z mmoorkamp $";
29 cout <<
"Program " << version << endl;
30 cout <<
" Convert MT data files in .mtt .j .edi format to .ptensor format"
32 cout <<
" This is needed in conjunction with the program ptselect " << endl;
33 cout <<
" to select similar sites." << endl;
42 infilename = AskFilename(
"Input Filename: ");
45 const unsigned int nsites = MTSites.
GetList().size();
46 const unsigned int ntestcases = 10000;
47 for (
unsigned int i = 0; i < nsites; ++i)
49 cout <<
"Writing site " << MTSites.
GetList().at(i).GetName();
51 const unsigned int nfreq = MTSites.
at(i).
GetMTData().size();
52 for (
unsigned j = 0; j < nfreq; ++j)
54 double JackMean, Phi11Var, Phi12Var, Phi21Var, Phi22Var;
72 sqrt(Phi11Var), sqrt(Phi12Var), sqrt(Phi21Var), sqrt(Phi22Var)));
75 cout <<
" ... done" << endl;
This class is for the special case where we only have phase tensor data and errors, but not the full impedance.
MTStation & at(int loc)
Get a reference to a site at a given index.
double GetPhi11() const
All the following quantities are defined in Caldwell GJI 158, 457-469, the phase tensor elements...
const MTTensor & at(const unsigned int i) const
direct acces to a tensor at a given index
std::vector< PTensorMTData > & GetTensor()
void CalcErrors(double &m, double &v)
The main function, calculates the error, by generating samples and calling the derived function...
double GetFrequency() const
Get the frequency for the impedance.
void WriteData(const std::string &filename)
MTStationList holds a number of MTSites, usually associated with a single project, line, etc.
Implements the Jacknifing method of error estimation.
Generate random elements of a calculated quantity for MT impedance data.
tStationList & GetList()
Access to the complete vector of Stations.
void GetData(const std::string filename)
Read a list of filenames and the associated data in those files to fill the list. ...
const std::vector< MTTensor > & GetMTData() const
Get the full vector of Tensor elements read only.