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.

TEMReceiver.h 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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@lemmasoftware.org
  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 Describes a TEM receiver
  27. \details A general class for TEM receivers
  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. /**
  96. * @return centre point of gates in sec
  97. */
  98. VectorXr GetWindowCentres();
  99. /**
  100. * @return width of gates in sec
  101. */
  102. VectorXr GetWindowWidths();
  103. /**
  104. * @return the reference time
  105. */
  106. Real GetReferenceTime();
  107. /** Returns the name of the underlying class, similiar to Python's type */
  108. virtual std::string GetName() const {
  109. return this->CName;
  110. }
  111. protected:
  112. // ==================== LIFECYCLE =======================
  113. /**
  114. * @copybrief LemmaObject::Release()
  115. * @copydetails LemmaObject::Release()
  116. */
  117. void Release();
  118. private:
  119. /** ASCII string representation of the class name */
  120. static constexpr auto CName = "TEMReceiver";
  121. // ==================== DATA MEMBERS =========================
  122. Real moment;
  123. Real referenceTime;
  124. Vector3r nHat;
  125. FIELDCOMPONENT component;
  126. VectorXr windowCentres;
  127. VectorXr windowWidths;
  128. VectorXr noiseSTD;
  129. //Vector3r location;
  130. }; // ----- end of class TEMReceiver -----
  131. } // ----- end of Lemma name -----
  132. #endif // ----- #ifndef TEMRECEIVER_INC -----