GPLIB++
printrhostar.cpp
Go to the documentation of this file.
1 #include "MTStation.h"
2 #include "Util.h"
3 #include <iostream>
4 #include <iomanip>
5 
6 using namespace std;
7 using namespace gplib;
8 
9 string version = "$Id: printrhostar.cpp 1845 2010-04-12 11:55:22Z mmoorkamp $";
10 
11 /*!
12  * \addtogroup UtilProgs Utility Programs
13  *@{
14  * \file
15  * Print Schmucker's \f$z^\ast\f$ and \f$\rho^\ast\f$ for the off-diagonal components of an MT Site.
16  * All components are written to the same file as a function of Period.
17  */
18 
19 void PrintRhosZs(const MTTensor &Elem)
20  {
21  cout << setw(10) << 1. / Elem.GetFrequency() << " Zxy*: ";
22  cout << setw(10) << Elem.GetZxyStar() << " Zyx*: ";
23  cout << setw(10) << Elem.GetZyxStar() << " Rhoxy*: ";
24  cout << setw(10) << Elem.GetRhoxyStar() << " Rhoyx*: ";
25  cout << setw(10) << Elem.GetRhoyxStar() << endl;
26  }
27 
28 int main(int argc, char *argv[])
29  {
30  string infilename;
31  MTStation Data;
32  cout
33  << " This is printrhostar: Print Schmucker's rho* z* for a single site"
34  << endl; // write some info
35  cout << " Reads in a single station file and prints values to screen"
36  << endl;
37  cout
38  << " Usage: printrhostar filename or just printrhostar for interactive mode"
39  << endl;
40  cout << " This is Version: " << version << endl << endl;
41  if (argc == 2)
42  {
43  infilename = argv[1];
44  }
45  else
46  {
47  infilename = AskFilename("Input filename: ");
48  }
49  Data.GetData(infilename);
50  for_each(Data.GetMTData().begin(), Data.GetMTData().end(), PrintRhosZs);
51 
52  }
53 /*@}*/
double GetRhoyxStar() const
Definition: MTTensor.h:279
string version
Definition: printrhostar.cpp:9
double GetZxyStar() const
Definition: MTTensor.h:292
virtual void GetData(const std::string filename)
read in data from file, determines format by ending
Definition: MTStation.cpp:597
double GetFrequency() const
Get the frequency for the impedance.
Definition: MTTensor.h:113
double GetRhoxyStar() const
Definition: MTTensor.h:275
The class MTStation is used to store the transfer functions and related information for a MT-site...
Definition: MTStation.h:17
double GetZyxStar() const
Definition: MTTensor.h:296
int main()
Definition: angleavg.cpp:12
void PrintRhosZs(const MTTensor &Elem)
Stores MT-Tensor components at a single frequency, calculates derived quantities. ...
Definition: MTTensor.h:16
const std::vector< MTTensor > & GetMTData() const
Get the full vector of Tensor elements read only.
Definition: MTStation.h:119