Main Lemma Repository
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email Trevor.Irons@xri-geo.com
  14. * @copyright Copyright (c) 2014, XRI Geophysics, LLC
  15. * @copyright Copyright (c) 2014, Trevor Irons
  16. */
  17. #ifndef TEMRECEIVER_INC
  18. #define TEMRECEIVER_INC
  19. #include "receiverpoints.h"
  20. //#include <boost/random.hpp>
  21. //#include <boost/random/normal_distribution.hpp>
  22. #include <random>
  23. namespace Lemma {
  24. #ifdef HAVE_YAMLCPP
  25. #include "yaml-cpp/yaml.h"
  26. #endif
  27. /**
  28. \brief
  29. \details
  30. */
  31. class TEMReceiver : public ReceiverPoints {
  32. friend std::ostream &operator<<(std::ostream &stream,
  33. const TEMReceiver &ob);
  34. public:
  35. // ==================== LIFECYCLE =======================
  36. /**
  37. * @copybrief LemmaObject::New()
  38. * @copydetails LemmaObject::New()
  39. */
  40. static TEMReceiver* New();
  41. /**
  42. * @return a deep copy of this
  43. */
  44. TEMReceiver* Clone();
  45. /**
  46. * @copybrief LemmaObject::Delete()
  47. * @copydetails LemmaObject::Delete()
  48. */
  49. void Delete();
  50. // ==================== OPERATORS =======================
  51. // ==================== OPERATIONS =======================
  52. /**
  53. * Uses the standard deviations provided to provide an instance
  54. * of the expected noise. A realisation of the noise.
  55. */
  56. VectorXr SampleNoise();
  57. // ==================== ACCESS =======================
  58. /**
  59. * Sets the gate integration windows
  60. */
  61. void SetWindows(const VectorXr& centres, const VectorXr& widths, const TIMEUNITS& Units);
  62. /**
  63. * Sets the moment of the receiver. Defaults to 1 for normalized response.
  64. */
  65. void SetMoment( const Real& moment);
  66. /**
  67. * Sets std deviation values for noise channels.
  68. * @param[in] noise must be of the same length as the number of windows.
  69. */
  70. void SetNoiseSTD( const VectorXr& noise );
  71. /**
  72. * Gets std deviation values for noise channels.
  73. * @return noise std dev.
  74. */
  75. VectorXr GetNoiseSTD( );
  76. /**
  77. * @param[in] refTime sets the reference time, defaults to 0
  78. */
  79. void SetReferenceTime( const Real& refTime, const TIMEUNITS& units );
  80. /**
  81. * What field component to return
  82. */
  83. void SetComponent ( const FIELDCOMPONENT& COMP );
  84. /**
  85. * @param[in] loc is the location of the dipole receiver
  86. */
  87. void SetRxLocation ( const Vector3r& loc );
  88. // ==================== INQUIRY =======================
  89. #ifdef HAVE_YAMLCPP
  90. /**
  91. * Uses YAML to serialize this object.
  92. * @return a YAML::Node
  93. */
  94. YAML::Node Serialize() const;
  95. /**
  96. * Constructs an object from a YAML::Node.
  97. */
  98. static TEMReceiver* DeSerialize(const YAML::Node& node);
  99. #endif
  100. /**
  101. * @return centre point of gates in sec
  102. */
  103. VectorXr GetWindowCentres();
  104. /**
  105. * @return width of gates in sec
  106. */
  107. VectorXr GetWindowWidths();
  108. /**
  109. * @return the reference time
  110. */
  111. Real GetReferenceTime();
  112. protected:
  113. // ==================== LIFECYCLE =======================
  114. /** Default protected constructor, use New */
  115. TEMReceiver (const std::string& name);
  116. #ifdef HAVE_YAMLCPP
  117. /** Default protected de-serializing constructor, use factory DeSerialize */
  118. TEMReceiver (const YAML::Node& node);
  119. #endif
  120. /** Default protected destructor, use Delete */
  121. ~TEMReceiver ();
  122. /**
  123. * @copybrief LemmaObject::Release()
  124. * @copydetails LemmaObject::Release()
  125. */
  126. void Release();
  127. private:
  128. // ==================== DATA MEMBERS =========================
  129. Real moment;
  130. Real referenceTime;
  131. Vector3r nHat;
  132. FIELDCOMPONENT component;
  133. VectorXr windowCentres;
  134. VectorXr windowWidths;
  135. VectorXr noiseSTD;
  136. //Vector3r location;
  137. }; // ----- end of class TEMReceiver -----
  138. } // ----- end of Lemma name -----
  139. #endif // ----- #ifndef TEMRECEIVER_INC -----