10 PTensorMTStation::PTensorMTStation()
14 PTensorMTStation::~PTensorMTStation()
21 const unsigned int nfrequencies = MTData.
GetMTData().size();
22 Tensor.reserve(nfrequencies);
23 for (
unsigned int i = 0; i < nfrequencies; ++i)
33 const trealdata PTensorMTStation::GetFrequencies()
const
35 trealdata temp(Tensor.size());
36 transform(Tensor.begin(), Tensor.end(), temp.begin(), mem_fun_ref(
37 &PTensorMTData::GetFrequency));
41 void PTensorMTStation::GetData(
const std::string &filename)
43 ifstream infile(filename.c_str());
45 double period, phi11, phi12, phi21, phi22, dphi11, dphi12, dphi21,
49 infile >> period >> phi11 >> dphi11 >> phi12 >> dphi12 >> phi21
50 >> dphi21 >> phi22 >> dphi22;
54 phi21, phi22, dphi11, dphi12, dphi21, dphi22));
57 if (Tensor.size() < 1)
61 void PTensorMTStation::WriteData(
const std::string &filename)
63 ofstream outfile((filename +
".ptensor").c_str());
64 const unsigned int nfreq = Tensor.size();
65 for (
unsigned int i = 0; i < nfreq; ++i)
67 outfile << 1. / Tensor.at(i).GetFrequency() <<
" ";
68 outfile << Tensor.at(i).GetPhi11() <<
" "
69 << Tensor.at(i).GetdPhi11() <<
" ";
70 outfile << Tensor.at(i).GetPhi12() <<
" "
71 << Tensor.at(i).GetdPhi12() <<
" ";
72 outfile << Tensor.at(i).GetPhi21() <<
" "
73 << Tensor.at(i).GetdPhi21() <<
" ";
74 outfile << Tensor.at(i).GetPhi22() <<
" "
75 << Tensor.at(i).GetdPhi22() << endl;
This class is for the special case where we only have phase tensor data and errors, but not the full impedance.
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
double GetFrequency() const
Get the frequency for the impedance.
The class MTStation is used to store the transfer functions and related information for a MT-site...
const std::vector< MTTensor > & GetMTData() const
Get the full vector of Tensor elements read only.
The basic exception class for all errors that arise in gplib.