Lemma is an Electromagnetics API
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

TEMReceiver.h 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. /* This file is part of Lemma, a geophysical modelling and inversion API.
  2. * More information is available at http://lemmasoftware.org
  3. */
  4. /* This Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  7. */
  8. /**
  9. * @file
  10. * @date 10/08/2014 02:36:47 PM
  11. * @author Trevor Irons (ti)
  12. * @email Trevor.Irons@Utah.edu
  13. * @copyright Copyright (c) 2014, Trevor Irons
  14. */
  15. #pragma once
  16. #ifndef TEMRECEIVER_INC
  17. #define TEMRECEIVER_INC
  18. #include <random>
  19. //#include "yaml-cpp/yaml.h"
  20. #include <LemmaCore>
  21. #include <FDEM1D>
  22. //#include <boost/random.hpp>
  23. //#include <boost/random/normal_distribution.hpp>
  24. namespace Lemma {
  25. /**
  26. \brief
  27. \details
  28. */
  29. class TEMReceiver : public FieldPoints {
  30. friend std::ostream &operator<<(std::ostream &stream, const TEMReceiver &ob);
  31. public:
  32. // ==================== LIFECYCLE =======================
  33. /** Default locked constructor. */
  34. explicit TEMReceiver ( const ctor_key& );
  35. /** Locked deserializing constructor. */
  36. TEMReceiver (const YAML::Node& node, const ctor_key&);
  37. /** Default destructor. */
  38. ~TEMReceiver ();
  39. /**
  40. * Factory method for generating concrete class.
  41. * @return a std::shared_ptr of type TEMReceiver
  42. */
  43. static std::shared_ptr<TEMReceiver> NewSP();
  44. /**
  45. * Uses YAML to serialize this object.
  46. * @note The actual calculation results are not serialized, currently.
  47. * @return a YAML::Node
  48. */
  49. YAML::Node Serialize() const;
  50. /**
  51. * Constructs an object from a YAML::Node.
  52. * @param[in] node is a YAML node containing the serialized class information
  53. * @return a std::shared_ptr object of TEMReceiver
  54. */
  55. static std::shared_ptr<TEMReceiver> DeSerialize(const YAML::Node& node);
  56. // ==================== OPERATORS =======================
  57. // ==================== OPERATIONS =======================
  58. /**
  59. * Uses the standard deviations provided to provide an instance
  60. * of the expected noise. A realisation of the noise.
  61. */
  62. VectorXr SampleNoise();
  63. // ==================== ACCESS =======================
  64. /**
  65. * Sets the gate integration windows
  66. */
  67. void SetWindows(const VectorXr& centres, const VectorXr& widths, const TIMEUNITS& Units);
  68. /**
  69. * Sets the moment of the receiver. Defaults to 1 for normalized response.
  70. */
  71. void SetMoment( const Real& moment);
  72. /**
  73. * Sets std deviation values for noise channels.
  74. * @param[in] noise must be of the same length as the number of windows.
  75. */
  76. void SetNoiseSTD( const VectorXr& noise );
  77. /**
  78. * Gets std deviation values for noise channels.
  79. * @return noise std dev.
  80. */
  81. VectorXr GetNoiseSTD( );
  82. /**
  83. * @param[in] refTime sets the reference time, defaults to 0
  84. */
  85. void SetReferenceTime( const Real& refTime, const TIMEUNITS& units );
  86. /**
  87. * What field component to return
  88. */
  89. void SetComponent ( const FIELDCOMPONENT& COMP );
  90. /**
  91. * @param[in] loc is the location of the dipole receiver
  92. */
  93. void SetRxLocation ( const Vector3r& loc );
  94. // ==================== INQUIRY =======================
  95. #ifdef HAVE_YAMLCPP
  96. /**
  97. * Uses YAML to serialize this object.
  98. * @return a YAML::Node
  99. */
  100. YAML::Node Serialize() const;
  101. /**
  102. * Constructs an object from a YAML::Node.
  103. */
  104. static TEMReceiver* DeSerialize(const YAML::Node& node);
  105. #endif
  106. /**
  107. * @return centre point of gates in sec
  108. */
  109. VectorXr GetWindowCentres();
  110. /**
  111. * @return width of gates in sec
  112. */
  113. VectorXr GetWindowWidths();
  114. /**
  115. * @return the reference time
  116. */
  117. Real GetReferenceTime();
  118. protected:
  119. // ==================== LIFECYCLE =======================
  120. /**
  121. * @copybrief LemmaObject::Release()
  122. * @copydetails LemmaObject::Release()
  123. */
  124. void Release();
  125. private:
  126. // ==================== DATA MEMBERS =========================
  127. Real moment;
  128. Real referenceTime;
  129. Vector3r nHat;
  130. FIELDCOMPONENT component;
  131. VectorXr windowCentres;
  132. VectorXr windowWidths;
  133. VectorXr noiseSTD;
  134. //Vector3r location;
  135. }; // ----- end of class TEMReceiver -----
  136. } // ----- end of Lemma name -----
  137. #endif // ----- #ifndef TEMRECEIVER_INC -----