20 std::complex<double> Zxx;
21 std::complex<double> Zxy;
22 std::complex<double> Zyx;
23 std::complex<double> Zyy;
38 double CalcRho(
const std::complex<double> &Z)
const
40 return mu / (2 * PI * frequency) * (Z.real() * Z.real() + Z.imag()
41 * Z.imag()) * 1000000.0;
44 double CalcPhase(
const std::complex<double> &Z)
const
46 if (fcmp(Z.real(), 0.0, std::numeric_limits<double>::epsilon()) != 0)
47 return atan2(Z.imag(), Z.real()) / PI * 180;
52 double CalcPhase90(
const std::complex<double> &Z)
const
54 if (fcmp(Z.real(), 0.0, std::numeric_limits<double>::epsilon()) != 0)
55 return atan(Z.imag() / Z.real()) / PI * 180;
60 double CalcdRho(
const std::complex<double> &Z,
const double dZ)
const
62 return mu / (PI * frequency) * std::abs(Z) * dZ * 1000000.0;
65 double CalcdPhase(
const std::complex<double> &Z,
const double dZ)
const
67 if (fcmp(std::abs(Z), 0.0, std::numeric_limits<double>::epsilon()) != 0)
68 return dZ / std::abs(Z) / PI * 180;
73 double CalcZStar(
const std::complex<double> &Z)
const
75 return std::abs((I / (2.0 * PI * frequency) * Z * 1000.0).real());
78 double CalcRhoStar(
const std::complex<double> &Z)
const
80 double phase = CalcPhase(Z) / 180.0 * PI;
82 return 2.0 * pow2(cos(phase)) * CalcRho(Z);
84 return 0.5 * 1. / pow2(sin(phase)) * CalcRho(Z);
93 void SetErrors(
double dxx,
double dxy,
double dyx,
double dyy)
101 void Rotate(
double angle);
205 return CalcPhase(Zxx);
209 return CalcPhase(Zxy);
213 return CalcPhase(Zyx);
217 return CalcPhase(Zyy);
222 return CalcPhase90(Zxx);
226 return CalcPhase90(Zxy);
230 return CalcPhase90(Zyx);
234 return CalcPhase90(Zyy);
239 return CalcdRho(Zxx, dZxx);
243 return CalcdRho(Zxy, dZxy);
247 return CalcdRho(Zyx, dZyx);
251 return CalcdRho(Zyy, dZyy);
256 return CalcdPhase(Zxx, dZxx);
260 return CalcdPhase(Zxy, dZxy);
264 return CalcdPhase(Zyx, dZyx);
268 return CalcdPhase(Zyy, dZyy);
273 return CalcRhoStar(Zxx);
277 return CalcRhoStar(Zxy);
281 return CalcRhoStar(Zyx);
285 return CalcRhoStar(Zyy);
290 return CalcZStar(Zxx);
294 return CalcZStar(Zxy);
298 return CalcZStar(Zyx);
302 return CalcZStar(Zyy);
324 return 0.5 *
GetD2();
329 return 0.5 * sqrt(dZxy * dZxy + dZyx * dZyx);
350 return Zxx * Zyy - Zxy * Zyx;
355 return sqrt(abs(Zyy * Zyy) * dZxx * dZxx + abs(Zxx * Zxx) * dZyy
356 * dZyy + abs(Zxy * Zxy) * dZyx * dZyx + abs(Zyx * Zyx) * dZxy
362 return Zxx.real() * Zyy.real() - Zxy.real() * Zyx.real();
367 return sqrt(pow2(Zyy.real()) * pow2(dZxx) + pow2(Zxx.real()) * pow2(
368 dZyy) + pow2(Zxy.real()) * pow2(dZyx) + pow2(Zyx.real()) * pow2(
397 if (fcmp(denominator, 0.0, std::numeric_limits<double>::epsilon())
400 GetD2())) / (denominator));
411 regalpha += PI / 2.0;
425 if (fcmp(dr, 0.0, std::numeric_limits<double>::epsilon()) != 0)
426 return ((Zyy.real() * Zxx.imag() - Zxy.real() * Zyx.imag()) / dr);
433 if (fcmp(dr, 0.0, std::numeric_limits<double>::epsilon()) != 0)
434 return ((Zyy.real() * Zxy.imag() - Zxy.real() * Zyy.imag()) / dr);
441 if (fcmp(dr, 0.0, std::numeric_limits<double>::epsilon()) != 0)
442 return ((Zxx.real() * Zyx.imag() - Zyx.real() * Zxx.imag()) / dr);
449 if (fcmp(dr, 0.0, std::numeric_limits<double>::epsilon()) != 0)
450 return ((Zxx.real() * Zyy.imag() - Zyx.real() * Zxy.imag()) / dr);
457 if (fcmp(diff, 0.0, std::numeric_limits<double>::epsilon()) != 0)
524 return 0.5 * (Zxx.real() + Zyy.real());
528 return 0.5 * (Zxy.real() + Zyx.real());
532 return 0.5 * (Zxx.real() - Zyy.real());
536 return 0.5 * (Zxy.real() - Zyx.real());
540 return 0.5 * (Zxx.imag() + Zyy.imag());
544 return 0.5 * (Zxy.imag() + Zyx.imag());
548 return 0.5 * (Zxx.imag() - Zyy.imag());
552 return 0.5 * (Zxy.imag() - Zyx.imag());
655 MTTensor(
const std::complex<double> &xx,
const std::complex<double> &xy,
656 const std::complex<double> &yx,
const std::complex<double> &yy,
657 const double freq = 1.,
const double angle = 0.0);
662 std::complex<double>
inline RhoPhiToZ(
const double freq,
const double rho,
665 return sqrt(2 * PI * freq / mu) * 0.001 * sqrt(rho) * (cos(phi / 180
666 * PI) + I * sin(phi / 180 * PI));
double GetAlphaHigh() const
Calculate strike angle, so it points to high conductivity direction (Phixy > Phiyx) ...
double GetRhoyxStar() const
double GetdZxx() const
Return tensor element errors.
double GetPhi11() const
All the following quantities are defined in Caldwell GJI 158, 457-469, the phase tensor elements...
double GetdBerd() const
The error of the Berdichevskyi invariant.
std::complex< double > & SetZyx()
double GetPhiEllip() const
std::complex< double > GetDet() const
The determinant.
double GetRhoyyStar() const
double GetPhi90Berd() const
double GetZxyStar() const
std::complex< double > & SetZyy()
Write access to tensor elements.
double GetRotangle() const
!return the current angle in radian
std::complex< double > GetS1() const
Some invariants and intermediate quantities for strike and skew calculation.
double GetFrequency() const
Get the frequency for the impedance.
double GetMaxPhiDiff() const
Maximum phase difference.
double GetdRhoxx() const
Return Rho Error for tensor elements.
double GetRhoxyStar() const
double GetMu() const
Rotationally invariant phase difference.
std::complex< double > GetZyx() const
std::complex< double > GetZxy() const
double GetEta() const
Bahr's skew.
void Rotate(double angle)
Rotate by the given angle in radian.
double GetNu() const
The degrees of freedom used for transfer function estimation.
double GetPhiStrike() const
double GetAlpha_phi() const
The class MTStation is used to store the transfer functions and related information for a MT-site...
double GetPhi90xx() const
Return phase restricted to 0 to 90 degree range.
double GetZyxStar() const
double GetdPhixx() const
return phase error for tensor elements
std::complex< double > GetS2() const
std::complex< double > GetBerd() const
The Berdichevskyi invariant.
double & SetRotangle()
Set the rotation angle, without performing the corresponding rotation.
double GetRhoxxStar() const
Return Schmucker's rho* for tensor elements.
double GetdRhoBerd() const
double GetdDet() const
The error of the determinant.
std::complex< double > GetD1() const
double GetZxxStar() const
Return Schmucker's z* for tensor elements.
double GetZyyStar() const
double GetPhi90yy() const
std::complex< double > GetD2() const
double GetRhoxx() const
Return apparent resistivity.
std::complex< double > & SetZxx()
double & SetdZyy()
Write access to errors.
Calculate synthetic MT data for a 1D model using Cagniard's algorithm.
double GetdPhi90Berd() const
Stores MT-Tensor components at a single frequency, calculates derived quantities. ...
double GetdDetreal() const
Get the error of the determinant of the real part.
double GetRhoBerd() const
double GetRy() const
Return coherency for the y-direction.
std::complex< double > GetZxx() const
double GetPhi90xy() const
double GetPhixx() const
Return phase.
std::complex< double > & SetZxy()
double GetPhi90yx() const
void SetErrors(double dxx, double dxy, double dyx, double dyy)
Set the errors for the impedance elements.
std::complex< double > GetZyy() const
Return tensor elements.
double GetBeta_phi() const
double GetdZero() const
Function for Errors that cannot be calculated analytically when we don't want Jacknife errors...
double GetRx() const
Return coherency for the x-direction.
double GetDetreal() const
The determinant of the real parts of Z.
std::complex< double > RhoPhiToZ(const double freq, const double rho, const double phi)
MTTensor & operator=(const MTTensor &source)
double GetKappa() const
Swift's skew.