Lemma is an Electromagnetics API
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

datafem.h 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /* This file is part of Lemma, a geophysical modelling and inversion API */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. /**
  6. @file
  7. @author M. Andy Kass
  8. @date 01/03/2013
  9. @version $Id$
  10. **/
  11. #ifndef DATAFEM_H
  12. #define DATAFEM_H
  13. #include "data.h"
  14. namespace Lemma {
  15. // ===================================================================
  16. // Class: DataFEM
  17. /// \brief
  18. /// \details
  19. // ===================================================================
  20. class DataFEM : public Data {
  21. friend std::ostream &operator<<(std::ostream &stream,
  22. const DataFEM &ob);
  23. public:
  24. // ==================== LIFECYCLE =======================
  25. static DataFEM* New();
  26. DataFEM* Clone();
  27. void Delete();
  28. // ==================== OPERATORS =======================
  29. // ==================== OPERATIONS =======================
  30. void Zero();
  31. Real Norm(Data* Data2);
  32. // ==================== ACCESS =======================
  33. /// Set data dimensions
  34. void SetSize(const int &nobs,const int &nfreq);
  35. /// Input the data
  36. void SetData(const MatrixXr &inputdata);
  37. /// Input uncertainties
  38. void SetUncertainties(const MatrixXr &uncertain);
  39. /// Input the positions
  40. void SetPositions(const Vector3Xr &positions);
  41. /// Set the frequencies
  42. void SetFreq(const VectorXr &freqs);
  43. /// Set Tx Orientation
  44. void SetTxOrientation(const Eigen::Matrix<ORIENTATION, Eigen::Dynamic, 1> &txorientation);
  45. /// Set Rx Orientation
  46. void SetRxOrientation(const Eigen::Matrix<ORIENTATION, Eigen::Dynamic, 1> &rxorientation);
  47. /// Set the transmitter moments
  48. void SetTxMom(const VectorXr &txmom);
  49. /// Set Tx/Rx Separation
  50. void SetTxRxSep(const Vector3Xr &txrxsep);
  51. /// Set Scale Factor
  52. void SetScaleFac(const VectorXr &scalefac);
  53. // ==================== INQUIRY =======================
  54. /// Get number of frequencies used
  55. int GetnFreq();
  56. /// Get number of observation locations
  57. int GetnObs();
  58. /// Get the data cube
  59. MatrixXr GetFEMDataCube();
  60. /// Get the uncertainties
  61. MatrixXr GetFEMUncertainCube();
  62. /// Get a single data coefficient
  63. Real GetDataCoeff(const int &x, const int &y);
  64. /// Get the frequency array
  65. VectorXr GetFreqs();
  66. /// Get the position array
  67. Vector3Xr GetXYZ();
  68. /// Get the position for a single datum
  69. VectorXr GetSingleXYZ(const int &x);
  70. /// Get array of transmitter orientations
  71. Eigen::Matrix<ORIENTATION, Eigen::Dynamic, 1> GetTxOrien();
  72. /// Get array of receiver orientations
  73. Eigen::Matrix<ORIENTATION, Eigen::Dynamic, 1> GetRxOrien();
  74. /// Get array of Tx Moments
  75. VectorXr GetTxMom();
  76. /// Get Tx/Rx Separation
  77. Vector3Xr GetTxRxSep();
  78. /// Get Scale Factor
  79. VectorXr GetScaleFac();
  80. protected:
  81. // ==================== LIFECYCLE =======================
  82. /// Default protected constructor.
  83. DataFEM (const std::string &name);
  84. /// Default protected constructor.
  85. ~DataFEM ();
  86. void Release();
  87. // ==================== DATA MEMBERS =========================
  88. /// Number of frequencies
  89. int nFreq;
  90. /// Number of observation locations
  91. int nObs;
  92. /// Data cube containing the inphase and quadrature
  93. MatrixXr FEMDataCube;
  94. /// Data cube containing the uncertainties
  95. MatrixXr FEMUncertainCube;
  96. /// Array of frequencies
  97. VectorXr freq;
  98. /// Position vector, with z as height above the ground surface (pos)
  99. Vector3Xr xyz;
  100. /// Array of Tx orientations (x,y,z) for each freq
  101. Eigen::Matrix<ORIENTATION,Eigen::Dynamic,1> TxOrientation;
  102. /// Array of Rx orientations (x,y,z) for each freq
  103. Eigen::Matrix<ORIENTATION,Eigen::Dynamic,1> RxOrientation;
  104. /// Transmitter moments, one for each frequency
  105. VectorXr TxMom;
  106. /// Tx/Rx Separation in local, right hand system with x aligned with flight
  107. Vector3Xr TxRxSep;
  108. /// Scale factor as described in EM1DFM manual
  109. VectorXr ScaleFac;
  110. private:
  111. }; // ----- end of class DataFEM -----
  112. } // end of namespace Lemma
  113. #endif
  114. /* vim: set tabstop=4 expandtab: */
  115. /* vim: set filetype=cpp: */